/* ============================================================
   PinnacleIQ — Regal Enterprise Design System v3.0
   Zero Gradients | Gold Accent | Daily-Use Optimized
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Backgrounds — Deep Charcoal (regal, not blue-tinted) */
  --bg-base:        #0C0E11;
  --bg-surface:     #111418;
  --bg-card:        #16191F;
  --bg-input:       #1C2028;
  --bg-hover:       #20242C;
  --bg-selected:    #1A2035;

  /* Borders */
  --border:         #252A34;
  --border-strong:  #323844;
  --border-focus:   #4F6EF7;

  /* Primary — Enterprise Blue */
  --primary:        #4F6EF7;
  --primary-hover:  #3B5BDB;
  --primary-dim:    rgba(79, 110, 247, 0.10);

  /* Gold Accent — Regal Identity */
  --gold:           #C9A84C;
  --gold-dim:       rgba(201, 168, 76, 0.10);
  --gold-border:    rgba(201, 168, 76, 0.25);

  /* Semantic */
  --green:          #2D9E4E;
  --green-dim:      rgba(45, 158, 78, 0.10);
  --green-border:   rgba(45, 158, 78, 0.25);
  --red:            #D94040;
  --red-dim:        rgba(217, 64, 64, 0.10);
  --red-border:     rgba(217, 64, 64, 0.25);
  --amber:          #D97706;
  --amber-dim:      rgba(217, 119, 6, 0.10);
  --amber-border:   rgba(217, 119, 6, 0.25);
  --purple:         #7C3AED;
  --purple-dim:     rgba(124, 58, 237, 0.10);
  --cyan:           #0E7490;
  --cyan-dim:       rgba(14, 116, 144, 0.10);

  /* Text */
  --text-primary:   #ECEEF2;
  --text-secondary: #8B929E;
  --text-muted:     #525964;
  --text-inverse:   #0C0E11;

  /* Typography */
  --font-display:   'DM Sans', 'Inter', sans-serif;
  --font-body:      'Inter', sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;

  /* Radii — Sharp, Enterprise */
  --radius-xs:      3px;
  --radius-sm:      5px;
  --radius-md:      7px;
  --radius-lg:      10px;
  --radius-xl:      14px;

  /* Shadows — Flat structural only */
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.5);
  --shadow-card:    0 1px 3px rgba(0,0,0,0.6);
  --shadow-menu:    0 6px 20px rgba(0,0,0,0.7), 0 0 0 1px var(--border);

  /* Transitions */
  --transition:     all 0.12s ease;
  --transition-md:  all 0.2s ease;
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:        #F5F6F8;
  --bg-surface:     #FFFFFF;
  --bg-card:        #FFFFFF;
  --bg-input:       #F9FAFB;
  --bg-hover:       #F0F2F5;
  --bg-selected:    #EEF1FF;

  --border:         #E2E5EA;
  --border-strong:  #CDD0D8;
  --border-focus:   #4F6EF7;

  --text-primary:   #141619;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  --shadow-sm:      0 1px 2px rgba(0,0,0,0.07);
  --shadow-card:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-menu:    0 6px 20px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: var(--font-body); }
button { cursor: pointer; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-primary);
}
h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
p  { line-height: 1.65; color: var(--text-secondary); }

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-gold      { color: var(--gold) !important; }
.text-green     { color: var(--green) !important; }
.text-red       { color: var(--red) !important; }
.text-amber     { color: var(--amber) !important; }
.text-blue      { color: var(--primary) !important; }
.text-sm        { font-size: 0.85rem; }
.text-xs        { font-size: 0.78rem; }
.font-mono      { font-family: var(--font-mono); }
.font-display   { font-family: var(--font-display); }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }

/* Text gradient replaced with solid gold */
.text-gradient  { color: var(--gold); }
.text-primary-color { color: var(--primary); }

/* ── Layout Utilities ────────────────────────────────────── */
.container       { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-5  { gap: 20px; }
.gap-6  { gap: 24px; }
.gap-8  { gap: 32px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: var(--transition);
}
.card:hover         { border-color: var(--border-strong); }
.card-sm            { padding: 12px 14px; border-radius: var(--radius-sm); }
.card-flush         { padding: 0; overflow: hidden; }
.card-gold          { border-color: var(--gold-border); }
.card-gold:hover    { border-color: var(--gold); }
.card-surface       { background: var(--bg-surface); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.btn svg, .btn i { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-gold {
  background: var(--gold);
  color: #0C0E11;
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover { background: #B8972C; border-color: #B8972C; }

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-danger   { background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red); }
.btn-danger:hover   { background: var(--red); color: #fff; border-color: var(--red); }

.btn-success  { background: var(--green-dim); border: 1px solid var(--green-border); color: var(--green); }
.btn-success:hover  { background: var(--green); color: #fff; border-color: var(--green); }

.btn-ghost    { background: transparent; border: 1px solid transparent; color: var(--text-secondary); }
.btn-ghost:hover    { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }

.btn-sm       { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg       { padding: 10px 22px; font-size: 0.92rem; font-weight: 600; }
.btn-icon     { padding: 6px; border-radius: var(--radius-sm); }
.btn-icon-sm  { padding: 4px; border-radius: var(--radius-xs); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 5px; }
.form-label   { font-size: 0.80rem; color: var(--text-secondary); font-weight: 500; }
.form-hint    { font-size: 0.75rem; color: var(--text-muted); }
.form-error   { font-size: 0.75rem; color: var(--red); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.10);
  background: var(--bg-hover);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-select   { cursor: pointer; }
.form-select option { background: var(--bg-surface); }

.form-checkbox {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); user-select: none;
}
.form-checkbox input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary);
}

/* Input with left icon */
.input-wrap          { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.input-wrap .input-icon svg, .input-wrap .input-icon i { width: 14px; height: 14px; }
.input-wrap .form-input { padding-left: 34px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-xs);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.badge svg, .badge i { width: 10px; height: 10px; }
.badge-blue     { background: var(--primary-dim); color: var(--primary); border-color: rgba(79,110,247,0.2); }
.badge-gold     { background: var(--gold-dim); color: var(--gold); border-color: var(--gold-border); }
.badge-green    { background: var(--green-dim); color: var(--green); border-color: var(--green-border); }
.badge-red      { background: var(--red-dim); color: var(--red); border-color: var(--red-border); }
.badge-amber    { background: var(--amber-dim); color: var(--amber); border-color: var(--amber-border); }
.badge-purple   { background: var(--purple-dim); color: var(--purple); border-color: rgba(124,58,237,0.25); }
.badge-neutral  { background: var(--bg-hover); color: var(--text-secondary); border-color: var(--border); }
/* old aliases */
.badge-cyan     { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(14,116,144,0.25); }

/* ── Status ──────────────────────────────────────────────── */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.connected    { background: var(--green); }
.status-dot.connecting   { background: var(--amber); animation: blink 0.8s infinite; }
.status-dot.disconnected { background: var(--text-muted); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-xs);
  font-size: 0.78rem; font-weight: 500; border: 1px solid transparent;
}
.status-pill.connected    { background: var(--green-dim); color: var(--green); border-color: var(--green-border); }
.status-pill.connecting   { background: var(--amber-dim); color: var(--amber); border-color: var(--amber-border); }
.status-pill.disconnected { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border); }

/* ── Sidebar Layout ──────────────────────────────────────── */
.app-layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Header / Logo */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.logo-icon svg, .logo-icon i { width: 13px; height: 13px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.logo-badge {
  font-size: 0.60rem;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}
.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 500;
  border-color: rgba(79,110,247,0.2);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 2px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-item .nav-icon svg, .nav-item .nav-icon i { width: 15px; height: 15px; }
.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: var(--primary-dim);
  color: var(--primary);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
  transition: var(--transition);
}
.user-chip:hover { border-color: var(--border-strong); }
.user-avatar {
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  background: var(--primary-dim);
  border: 1px solid rgba(79,110,247,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-info    { flex: 1; min-width: 0; }
.user-name    { font-size: 0.80rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-plan    { font-size: 0.68rem; color: var(--text-muted); }

/* ── Main Content Area ───────────────────────────────────── */
.main-content {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 100vh;
  background: var(--bg-base);
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.page-header-left  { display: flex; flex-direction: column; gap: 2px; }
.page-title        { font-size: 1.05rem; font-weight: 600; font-family: var(--font-display); }
.page-subtitle     { font-size: 0.78rem; color: var(--text-muted); }
.page-header-right { display: flex; align-items: center; gap: 8px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card-gold  { border-color: var(--gold-border); }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg, .stat-icon i { width: 17px; height: 17px; }
.stat-icon.blue   { background: var(--primary-dim); color: var(--primary); }
.stat-icon.green  { background: var(--green-dim); color: var(--green); }
.stat-icon.gold   { background: var(--gold-dim); color: var(--gold); }
.stat-icon.red    { background: var(--red-dim); color: var(--red); }
.stat-icon.amber  { background: var(--amber-dim); color: var(--amber); }
.stat-icon.purple { background: var(--purple-dim); color: var(--purple); }
.stat-icon.cyan   { background: var(--cyan-dim); color: var(--cyan); }
.stat-body        { flex: 1; min-width: 0; }
.stat-value       { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.stat-label       { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.01em; }
.stat-delta       { font-size: 0.73rem; color: var(--green); font-weight: 500; margin-top: 4px; }
.stat-delta.down  { color: var(--red); }

/* ── Topbar (Landing Page) ───────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo { display: flex; align-items: center; gap: 9px; }
.topbar-logo .logo-text { font-size: 0.95rem; font-weight: 700; }
.topbar-nav  { display: flex; align-items: center; gap: 2px; }
.topbar-nav a {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.topbar-nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Inner App Topbar ────────────────────────────────────── */
.inner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.inner-topbar-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.inner-topbar-actions { display: flex; align-items: center; gap: 8px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.80rem;
  color: var(--text-muted);
}
.breadcrumb-sep { color: var(--border-strong); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.85rem;
  border: 1px solid transparent;
}
.alert svg, .alert i { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-dim); border-color: var(--green-border); color: var(--green); }
.alert-error   { background: var(--red-dim);   border-color: var(--red-border);   color: var(--red); }
.alert-warning { background: var(--amber-dim); border-color: var(--amber-border); color: var(--amber); }
.alert-info    { background: var(--primary-dim); border-color: rgba(79,110,247,0.2); color: var(--primary); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 8px 14px;
  font-size: 0.83rem;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab svg, .tab i { width: 13px; height: 13px; }
.tab:hover  { color: var(--text-primary); }
.tab.active { color: var(--gold); font-weight: 600; border-bottom-color: var(--gold); }

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle-switch {
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--bg-hover); border: 1px solid var(--border);
  position: relative; transition: var(--transition);
}
.toggle-switch::after {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); top: 2px; left: 2px;
  transition: var(--transition);
}
.toggle.on .toggle-switch { background: var(--primary-dim); border-color: var(--primary); }
.toggle.on .toggle-switch::after { background: var(--primary); transform: translateX(16px); }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.75rem; color: var(--text-muted);
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar  { height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.4s ease; }
.progress-fill.gold  { background: var(--gold); }
.progress-fill.green { background: var(--green); }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-md);
  color: var(--text-muted);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary);
}
.upload-zone svg, .upload-zone i { width: 28px; height: 28px; margin: 0 auto 10px; display: block; }

/* ── QR Box ──────────────────────────────────────────────── */
.qr-box {
  width: 190px; height: 190px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin: 0 auto;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

/* ── Document Card ───────────────────────────────────────── */
.doc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.doc-card:hover { border-color: var(--border-strong); }
.doc-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg, .doc-icon i { width: 16px; height: 16px; }
.doc-icon.pdf   { background: var(--red-dim); color: var(--red); }
.doc-icon.txt   { background: var(--primary-dim); color: var(--primary); }
.doc-icon.docx  { background: var(--cyan-dim); color: var(--cyan); }
.doc-icon.other { background: var(--bg-card); color: var(--text-muted); }
.doc-meta       { flex: 1; min-width: 0; }
.doc-name       { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-size       { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.doc-actions    { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
}
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-base);
}
.auth-form-box         { width: 100%; max-width: 380px; }
.auth-form-box h2      { margin-bottom: 4px; font-size: 1.25rem; }
.auth-form-box > .sub  { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 22px; }
.auth-form             { display: flex; flex-direction: column; gap: 13px; }
.auth-footer-text      { text-align: center; margin-top: 14px; font-size: 0.80rem; color: var(--text-muted); }
.auth-footer-text a    { color: var(--primary); font-weight: 500; }

/* Auth Left Panel */
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 44px; }
.auth-brand .logo-text { font-size: 1.05rem; }
.auth-tagline { font-size: 0.72rem; color: var(--gold); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.auth-headline { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.auth-desc { font-size: 0.85rem; color: var(--text-secondary); max-width: 360px; line-height: 1.6; }
.auth-features { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-feature {
  display: flex; align-items: flex-start; gap: 10px;
}
.auth-feature-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-feature-icon svg, .auth-feature-icon i { width: 14px; height: 14px; }
.auth-feature-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 1px; }
.auth-feature-desc  { font-size: 0.78rem; color: var(--text-muted); }

/* ── Prompt Editor ───────────────────────────────────────── */
.prompt-editor {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  min-height: 220px;
  background: var(--bg-base) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-primary) !important;
}
.prompt-editor:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px var(--gold-dim) !important; }

/* ── Tag ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-icon  { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--text-muted); }
.empty-icon svg, .empty-icon i { width: 44px; height: 44px; }
.empty-state h4 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-state p  { font-size: 0.83rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes blink    { 0%,100% { opacity:1; } 50% { opacity:0.35; } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:0.6; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in    { animation: fadeUp 0.25s ease both; }
.fade-in-d1 { animation-delay: 0.05s; }
.fade-in-d2 { animation-delay: 0.10s; }
.fade-in-d3 { animation-delay: 0.15s; }
.fade-in-d4 { animation-delay: 0.20s; }

/* ── Landing Specific ────────────────────────────────────── */
.section { padding: 64px 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.70rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border);
  padding: 3px 10px; border-radius: var(--radius-xs); margin-bottom: 12px;
}
.section-title  { margin-bottom: 10px; }
.section-sub    { font-size: 0.92rem; color: var(--text-secondary); max-width: 500px; }
.hero {
  padding: 80px 24px 64px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; margin-bottom: 20px;
  background: var(--bg-card); border: 1px solid var(--gold-border);
  border-radius: var(--radius-xs);
  font-size: 0.75rem; font-weight: 500; color: var(--gold);
}
.hero-eyebrow {
  font-size: 0.72rem; color: var(--gold); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.feature-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.feature-icon svg, .feature-icon i { width: 16px; height: 16px; }
.feature-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.feature-desc  { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Pricing ─────────────────────────────────────────────── */
.pricing-grid     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-card     { display: flex; flex-direction: column; }
.pricing-amount   { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.pricing-feature  {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.83rem;
}
.pricing-feature:last-child { border-bottom: none; }
.pricing-feature svg, .pricing-feature i { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.check { color: var(--green); }

/* ── Language Switcher ───────────────────────────────────── */
.language-switcher {
  padding: 5px 9px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.80rem;
  cursor: pointer;
  transition: var(--transition);
}
.language-switcher:focus { outline: none; border-color: var(--border-focus); }
.language-switcher option { background: var(--bg-surface); }

/* ── Payment Badge ───────────────────────────────────────── */
.payment-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  border-radius: var(--radius-xs);
  font-size: 0.72rem; font-weight: 600; color: var(--gold);
}

/* ── Hindi Support ───────────────────────────────────────── */
html[lang="hi"],
html[lang="hi"] * { font-family: 'Noto Sans Devanagari', 'Inter', sans-serif; letter-spacing: 0.01em; }
html[lang="hi"] h1,
html[lang="hi"] h2,
html[lang="hi"] h3 { font-family: 'Noto Sans Devanagari', var(--font-display), sans-serif; }

/* ── Utility Modals / Overlays ───────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.55);
  align-items: center; justify-content: center;
}
.overlay.show { display: flex; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-menu);
  width: 100%; max-width: 480px; margin: 16px;
  animation: fadeUp 0.2s ease both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 0.95rem; font-weight: 600; }
.modal-body  { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Section separator line ──────────────────────────────── */
.section-line { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Error Message (forms) ───────────────────────────────── */
.error-msg {
  color: var(--red); font-size: 0.80rem;
  background: var(--red-dim); border: 1px solid var(--red-border);
  padding: 9px 12px; border-radius: var(--radius-sm); display: none;
}
.error-msg.show  { display: block; }
.success-msg {
  color: var(--green); font-size: 0.80rem;
  background: var(--green-dim); border: 1px solid var(--green-border);
  padding: 9px 12px; border-radius: var(--radius-sm); display: none;
}
.success-msg.show { display: block; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-surface);
}

/* ── Mobile Responsiveness ────────────────────────────────── */
.mobile-header {
  display: none; /* Hidden on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.mobile-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.mobile-menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 992px) {
  /* Layout Changes */
  .app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  .mobile-header {
    display: flex; /* Show mobile header */
  }

  /* Sidebar styling for mobile (Off-canvas) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }

  /* Grid Layouts collapse to 1 or 2 columns */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Form Grids */
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Main content adjustments */
  .main-content {
    padding: 16px;
    padding-bottom: 40px;
    width: 100%;
  }

  /* Page Header stacking */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .page-header-right {
    width: 100%;
    justify-content: space-between;
  }

  /* Typography tweaks */
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
