/* ============================================================
   AgentAIShield — Global Design System
   Dark-first · Inter · Phosphor Icons · Vercel/Linear aesthetic
   ============================================================ */

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

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Dark theme (default) */
  --bg:          #0a0a0f;
  --bg-alt:      #0e0e15;
  --surface:     #13131a;
  --surface-2:   #1a1a24;
  --border:      #1e1e2e;
  --border-light:#2a2a3e;

  --primary:     #6366f1;
  --primary-dim: rgba(99,102,241,0.15);
  --primary-hover:#7c7ff5;
  --violet:      #8b5cf6;
  --violet-dim:  rgba(139,92,246,0.15);

  --text:        #e2e8f0;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --text-inverse:#0a0a0f;

  --success:     #10b981;
  --success-dim: rgba(16,185,129,0.12);
  --warning:     #f59e0b;
  --warning-dim: rgba(245,158,11,0.12);
  --danger:      #ef4444;
  --danger-dim:  rgba(239,68,68,0.12);
  --info:        #3b82f6;
  --info-dim:    rgba(59,130,246,0.12);

  /* Layout */
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Transitions */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --dur:         180ms;

  /* Extended design tokens */
  --surface-glass: rgba(13,13,20,0.7);
  --surface-3:   #1e1e2c;
  --text-muted:  var(--text-3);
  --space-lg:    24px;
}

/* Light theme */
[data-theme="light"] {
  --bg:          #f8fafc;
  --bg-alt:      #f1f5f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e2e8f0;
  --border-light:#cbd5e1;
  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --text-inverse:#ffffff;

  /* Dim variants — lighter on white */
  --primary-dim: rgba(99,102,241,0.1);
  --violet-dim:  rgba(139,92,246,0.1);
  --success-dim: rgba(16,185,129,0.1);
  --warning-dim: rgba(245,158,11,0.1);
  --danger-dim:  rgba(239,68,68,0.1);
  --info-dim:    rgba(59,130,246,0.1);

  /* Extended tokens — light overrides */
  --surface-glass: rgba(255,255,255,0.95);
  --surface-3:   #e2e8f0;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  font-size: 16px; 
  scroll-behavior: smooth; 
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Dark theme: subtle gradient instead of flat background */
html[data-theme="dark"],
[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f0f1a 0%, #0a0a14 50%, #0d0b1a 100%);
  background-attachment: fixed;
}
/* Light theme: clean white background */
html[data-theme="light"],
[data-theme="light"] body {
  background: #f8fafc;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ─── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--text-2); }

code, pre {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1;
}
.btn i { font-size: 16px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c7ff5 0%, #8b5cf6 100%);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--border-light); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-sm { padding: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(15, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  outline: none;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(15, 15, 28, 0.9);
}
/* Light theme overrides for form controls */
[data-theme="light"] .form-control {
  background: var(--bg-alt);
  border-color: var(--border);
}
[data-theme="light"] .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: var(--bg-alt);
}
.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
}
.checkbox-group label {
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: 0;
  line-height: 1.5;
}

/* ─── Badge / Chip ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger);  }
.badge-info    { background: var(--info-dim);    color: var(--info);    }
.badge-purple  { background: var(--violet-dim);  color: var(--violet);  }
.badge-primary { background: var(--primary-dim); color: var(--primary); }
.badge-neutral { background: var(--surface-2);   color: var(--text-2);  }

/* ─── Tables ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ─── Dashboard Layout ──────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
}
.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo img { height: 32px; width: auto; }
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}
.sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 0;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  user-select: none;
  position: relative;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active {
  color: var(--primary);
  background: var(--primary-dim);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.sidebar-user:hover { background: var(--surface-2); }

/* Top Bar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 90;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 6px;
  border-radius: var(--radius-sm);
}
.hamburger-btn:hover { background: var(--surface-2); color: var(--text); }
.hamburger-btn i { font-size: 22px; }

.landing .page-title {
  display: none;
}
.page-breadcrumb {
  font-size: 13px;
  color: var(--text-3);
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 32px;
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}
.main-inner { max-width: 1280px; margin: 0 auto; }
#announcements-container { margin-left: var(--sidebar-w); margin-top: var(--topbar-h); position: relative; z-index: 5; }
#announcements-container:empty { display: none; }
#announcements-container:not(:empty) + .main-content { margin-top: 0; }
@media (max-width: 900px) { #announcements-container { margin-left: 0; } }

/* ─── KPI Cards ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-delta {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-3); }

/* ─── Avatar ────────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-lg { width: 40px; height: 40px; font-size: 15px; }

/* ─── Dropdown ──────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur);
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item i { font-size: 16px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ─── Sidebar overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ─── Utilities ─────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: 8px; }
.gap-4         { gap: 16px; }
.gap-6         { gap: 24px; }
.mt-2          { margin-top: 8px; }
.mt-4          { margin-top: 16px; }
.mb-4          { margin-bottom: 16px; }
.mb-6          { margin-bottom: 24px; }
.p-0           { padding: 0; }
.w-full        { width: 100%; }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; }
.text-muted    { color: var(--text-3); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-primary  { color: var(--primary); }
.font-mono     { font-family: 'SF Mono', 'Fira Code', monospace; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

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

/* ─── Alerts / Toasts ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-dim); border-color: rgba(16,185,129,0.3); color: #34d399; }
.alert-warning { background: var(--warning-dim); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.alert-danger  { background: var(--danger-dim);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.alert-info    { background: var(--info-dim);    border-color: rgba(59,130,246,0.3); color: #60a5fa; }

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  font-size: 13px;
  color: var(--text);
  animation: slideUp 200ms var(--ease);
  max-width: 360px;
}
.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error   i { color: var(--danger); }
.toast.info    i { color: var(--info); }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  animation: slideUp 200ms var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  display: flex;
}
.modal-close:hover { color: var(--text); }
.modal-close i { font-size: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ─── Loading / Spinner ─────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
.empty-state i { font-size: 48px; color: var(--border-light); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; color: var(--text-3); max-width: 280px; margin-bottom: 24px; }

/* ─── Toggle Switch ─────────────────────────────────────────── */
/* Toggle styles defined in dashboard.css — do not duplicate here */

/* ─── Code Block ────────────────────────────────────────────── */
.code-block {
  background: #060609;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.code-block-lang {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.code-block-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.code-block-copy:hover { background: var(--surface-2); color: var(--text); }
.code-block pre {
  padding: 20px;
  margin: 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  color: #a5b4fc;
}
.code-block pre .comment { color: #475569; }
.code-block pre .string  { color: #34d399; }
.code-block pre .keyword { color: #f472b6; }
.code-block pre .var     { color: #fbbf24; }

/* ─── Landing Page Specific ─────────────────────────────────── */
body.landing { background: var(--bg); }

/* Landing Nav */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
}
.nav-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hero */
.hero {
  padding: 140px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-container { max-width: 760px; margin: 0 auto; position: relative; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-dim);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 28px;
}
.hero-badge i { font-size: 14px; }

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title span {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.6;
}
.hero-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-sub span { display: flex; align-items: center; gap: 5px; }
.hero-sub span i { font-size: 14px; color: var(--primary); }

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease);
  text-decoration: none;
}
.btn-hero-primary:hover { background: var(--primary-hover); text-decoration: none; transform: translateY(-1px); }
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
  text-decoration: none;
}
.btn-hero-secondary:hover { border-color: var(--border-light); color: var(--text); text-decoration: none; }

/* Sections */
.section { padding: 80px 24px; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 14px;
}
.section-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 16px; }
.section-desc { font-size: 16px; color: var(--text-2); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* Feature grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--dur);
}
.feature-card:hover { border-color: var(--border-light); }
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-icon i { font-size: 24px; }
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-3); line-height: 1.6; }

/* How it works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  position: relative;
}
.step-card { text-align: center; }
.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary-dim);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 auto 20px;
}
.step-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.step-desc { font-size: 14px; color: var(--text-3); line-height: 1.6; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
.pricing-grid .plan-card.plan-enterprise {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  align-items: center;
  padding: 32px 40px;
}
.plan-enterprise .enterprise-right .plan-features { margin-top: 8px; }
@media (max-width: 900px) {
  .pricing-grid .plan-card.plan-enterprise { grid-template-columns: 1fr; }
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: border-color var(--dur);
}
.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, var(--surface) 100%);
}
.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
}
.pricing-plan { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.pricing-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.pricing-price span { font-size: 16px; font-weight: 500; color: var(--text-3); }
.pricing-period { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.pricing-desc { font-size: 13px; color: var(--text-2); margin-bottom: 24px; line-height: 1.5; }
.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li i { font-size: 16px; color: var(--success); flex-shrink: 0; }

/* Footer */
.landing-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand-desc { font-size: 14px; color: var(--text-3); line-height: 1.7; margin-top: 14px; max-width: 280px; }
.footer-col-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 13px; color: var(--text-3); transition: color var(--dur); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy { font-size: 12px; color: var(--text-3); }
.footer-social { display: flex; gap: 16px; align-items: center; }
.footer-social a { color: var(--text-3); font-size: 18px; transition: color var(--dur); display: inline-flex; align-items: center; justify-content: center; }
.footer-social a:hover { color: var(--primary); text-decoration: none; }

/* ─── Auth Pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
}
.auth-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
}
.auth-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
}
.auth-logo-text { font-size: 16px; font-weight: 700; color: var(--text); }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-3); margin-bottom: 28px; }
.auth-footer-text { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 24px; }
.auth-footer-text a { color: var(--primary); }

/* Social auth buttons */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur);
  font-family: inherit;
  text-decoration: none;
}
.social-btn:hover { background: var(--surface-2); border-color: var(--border-light); text-decoration: none; }
.social-btn img { width: 18px; height: 18px; }
.social-btn i { font-size: 18px; }
.social-btns { display: flex; flex-direction: column; gap: 10px; }

/* ─── Onboarding ────────────────────────────────────────────── */
.onboarding-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 0;
}
.onboarding-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
.onboarding-progress {
  height: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  transition: width 400ms var(--ease);
}
.onboarding-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px;
  min-height: calc(100vh - 100px);
}
.onboarding-card {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
}
.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all var(--dur);
}
.step-dot.active { background: var(--primary); width: 24px; border-radius: 4px; }
.step-dot.done { background: var(--success); }
.onboarding-step-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-dim);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.onboarding-step-icon i { font-size: 28px; color: var(--primary); }
.onboarding-step-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.onboarding-step-desc { font-size: 15px; color: var(--text-2); line-height: 1.6; margin-bottom: 32px; }
.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Provider selector */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.provider-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--dur);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.provider-btn:hover { border-color: var(--border-light); color: var(--text); }
.provider-btn.selected { border-color: var(--primary); background: var(--primary-dim); color: var(--primary); }
.provider-btn i { font-size: 24px; }

/* ─── Animations ────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in  { animation: fadeIn 300ms var(--ease); }
.slide-up { animation: slideUp 300ms var(--ease); }

/* Page transitions */
#main-content > * { animation: slideUp 280ms var(--ease); }

/* ─── Responsive ────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
  /* Sidebar becomes overlay */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  .sidebar-footer {
    padding-bottom: 24px;
    position: relative;
    z-index: 10;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }

  /* Topbar */
  .topbar { left: 0; }
  .hamburger-btn { display: flex; }

  /* Main content */
  .main-content { margin-left: 0; padding: 8px 16px 20px; }

  /* Nav links + auth buttons hidden on mobile (available in hamburger menu) */
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .hero { padding: 100px 16px 64px; }
  .section { padding: 56px 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .onboarding-card { padding: 28px 20px; }
  .provider-grid { grid-template-columns: repeat(3, 1fr); }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn-hero-primary, .btn-hero-secondary { justify-content: center; }
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── Selection ─────────────────────────────────────────────── */
::selection { background: var(--primary-dim); color: var(--primary); }

/* ─── Focus visible ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME — style.css component overrides
   ═══════════════════════════════════════════════════════════════ */

/* Landing nav — remove dark glass, use white */
[data-theme="light"] .landing-nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Dropdown — lighter shadow on white */
[data-theme="light"] .dropdown-menu {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
}

/* Toast — lighter shadow */
[data-theme="light"] .toast {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
}

/* Modal — lighter shadow */
[data-theme="light"] .modal {
  box-shadow: 0 16px 64px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
}

/* Alerts — readable in light mode */
[data-theme="light"] .alert-success { background: rgba(16,185,129,0.08); color: #059669; }
[data-theme="light"] .alert-warning { background: rgba(245,158,11,0.08); color: #d97706; }
[data-theme="light"] .alert-danger  { background: rgba(239,68,68,0.08);  color: #dc2626; }
[data-theme="light"] .alert-info    { background: rgba(59,130,246,0.08); color: #2563eb; }

/* Hero section — tweak gradient for light bg */
[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
}

/* Auth page bg — light gradient */
[data-theme="light"] .auth-page::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.06) 0%, transparent 60%);
}

/* Feature cards — light hover */
[data-theme="light"] .feature-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Code block — keep dark but add border */
[data-theme="light"] .code-block {
  background: #1e1e2e;
  border-color: #e2e8f0;
}

/* KPI cards (style.css version) — ensure shadow in light */
[data-theme="light"] .kpi-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

/* Cards — add elevation in light mode */
[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
[data-theme="light"] .card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Table hover in light mode */
[data-theme="light"] tbody tr:hover td {
  background: #f8fafc;
}

/* Buttons — ghost gets darker text in light mode */
[data-theme="light"] .btn-ghost {
  color: #475569;
}
[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Secondary button — light mode */
[data-theme="light"] .btn-secondary {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}
[data-theme="light"] .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Form controls — better in light */
[data-theme="light"] .form-control {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .form-control:focus {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Social buttons */
[data-theme="light"] .social-btn {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .social-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Provider buttons */
[data-theme="light"] .provider-btn {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .provider-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ═══════════════════════════════════════════════════════════════
   REAL-TIME UI ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

/* Slide in from top (for prepended feed items) */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flash highlight (for updated values) */
@keyframes flashHighlight {
  0% {
    background: rgba(99, 102, 241, 0.2);
  }
  100% {
    background: transparent;
  }
}

/* Pulse glow (for live indicators) */
@keyframes pulseGlow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Utility classes */
.kpi-value-flash {
  animation: flashHighlight 1s ease-out;
}

.feed-row-new {
  animation: slideInFromTop 0.3s ease-out;
}

.row-highlight {
  animation: flashHighlight 1.5s ease-out;
}
