/* ═══════════════════════════════════════════════════════════
   Aeldorado — Design System
   "The Legendary Intelligence" by Solanacy Technologies

   Stripe/Vercel-inspired dark dashboard.
   Professional, restrained, fast.
   ═══════════════════════════════════════════════════════════ */

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

:root {
  /* Surface */
  --bg-root:       #0a0d14;
  --bg-surface:    #111520;
  --bg-elevated:   #161b28;
  --bg-hover:      #1c2233;
  --bg-active:     #222940;

  /* Borders */
  --border:        #1e2536;
  --border-subtle: #171d2a;
  --border-focus:  #3b82f6;

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #8890a4;
  --text-muted:     #555d73;
  --text-inverse:   #0a0d14;

  /* Accent */
  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-subtle: rgba(59,130,246,0.12);
  --accent-text:   #60a5fa;

  /* Semantic */
  --success:       #10b981;
  --success-bg:    rgba(16,185,129,0.1);
  --warning:       #f59e0b;
  --warning-bg:    rgba(245,158,11,0.1);
  --danger:        #ef4444;
  --danger-bg:     rgba(239,68,68,0.1);

  /* Type */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(59,130,246,0.15);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 200ms;
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent-text); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: white; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Loader ────────────────────────────────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-root);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-ring {
  width: 48px; height: 48px; margin: 0 auto var(--space-4);
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-brand { display: flex; align-items: center; gap: var(--space-2); justify-content: center; }
.loader-icon { font-size: 1.5rem; }
.loader-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: var(--space-4); right: var(--space-4); z-index: 10000;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-3) var(--space-5);
  font-size: 0.875rem; box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease);
  max-width: 380px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }
.toast.out     { animation: toastOut 0.3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(20px); } }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.btn-outline   { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-secondary); background: var(--bg-hover); }
.btn-ghost     { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-hover); }
.btn-google {
  background: white; color: #333; border-color: #dadce0;
  padding: var(--space-3) var(--space-6); font-size: 0.9375rem; width: 100%;
  border-radius: var(--radius);
}
.btn-google:hover { background: #f8f9fa; box-shadow: var(--shadow-sm); }
.btn-lg  { padding: var(--space-3) var(--space-8); font-size: 1rem; border-radius: var(--radius); }
.btn-sm  { padding: var(--space-1) var(--space-3); font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn-link  { background: none; border: none; color: var(--accent-text); cursor: pointer; font-size: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-arrow { transition: transform var(--duration) var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-4); }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-1); letter-spacing: 0.02em; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: var(--space-2) var(--space-3);
  background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-sans); font-size: 0.9375rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); outline: none;
}
.form-group textarea { resize: vertical; font-family: var(--font-sans); }
.form-group select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

/* ── Page Management ───────────────────────────────────────── */
.page { min-height: 100vh; animation: fadeIn 0.35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }

/* ═══ LANDING PAGE ═══════════════════════════════════════════ */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-8);
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,13,20,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-brand { display: flex; align-items: center; gap: var(--space-2); }
.brand-icon { font-size: 1.5rem; }
.brand-name { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.03em; }
.brand-badge {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  background: var(--accent-subtle); color: var(--accent-text);
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.06em;
}
.nav-links { display: flex; align-items: center; gap: var(--space-4); }
.nav-link { color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; }
.nav-link:hover { color: var(--text-primary); }

/* Hero */
.hero {
  position: relative; padding: var(--space-16) var(--space-8);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12);
  align-items: center; max-width: 1200px; margin: 0 auto;
  min-height: calc(100vh - 60px);
}
.hero-glow {
  position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  top: 10%; left: -10%; pointer-events: none;
}
.hero-badge {
  font-size: 0.75rem; font-weight: 600; color: var(--accent-text);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--space-4);
}
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.04em; margin-bottom: var(--space-4); }
.hero-title-accent {
  background: linear-gradient(135deg, var(--accent), #8b5cf6, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 1.125rem; color: var(--text-secondary); max-width: 480px; margin-bottom: var(--space-8); line-height: 1.7; }
.hero-actions { display: flex; gap: var(--space-3); margin-bottom: var(--space-10); }

/* Hero Code Block */
.hero-code {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; max-width: 520px;
}
.code-header {
  display: flex; align-items: center; gap: 6px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot.red    { background: #ef4444; }
.code-dot.yellow { background: #f59e0b; }
.code-dot.green  { background: #10b981; }
.code-lang { margin-left: auto; font-size: 0.6875rem; color: var(--text-muted); font-family: var(--font-mono); }
.code-body {
  padding: var(--space-4); font-family: var(--font-mono);
  font-size: 0.8125rem; line-height: 1.7; color: var(--text-secondary);
  overflow-x: auto; white-space: pre;
}
.code-body code { font-family: inherit; }
.code-kw  { color: var(--accent-text); }
.code-str { color: var(--success); }

/* Agent Orbit */
.hero-agents { display: flex; align-items: center; justify-content: center; position: relative; }
.agent-orbit { position: relative; width: 340px; height: 340px; }
.agent-node {
  position: absolute; width: 64px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: 1.5rem; transition: all 0.3s var(--ease);
  top: 50%; left: 50%;
  --angle: calc(var(--i) * 51.43deg - 90deg);
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-140px) rotate(calc(var(--angle) * -1));
  animation: orbitPulse 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.3s);
}
.agent-node:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-140px) rotate(calc(var(--angle) * -1)) scale(1.15); }
.agent-node label { font-size: 0.625rem; font-weight: 700; color: var(--text-muted); margin-top: 2px; font-family: var(--font-sans); }
.orbit-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 80px; height: 80px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 2px solid var(--accent);
  border-radius: 50%; font-size: 2rem; box-shadow: 0 0 30px rgba(59,130,246,0.2);
}
.orbit-center label { font-size: 0.5rem; font-weight: 800; color: var(--accent-text); letter-spacing: 0.05em; text-transform: uppercase; }
@keyframes orbitPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Features */
.features, .pricing { padding: var(--space-16) var(--space-8); max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: var(--space-12); }
.section-header h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: var(--space-2); }
.section-header p { color: var(--text-secondary); font-size: 1.0625rem; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.feature-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6); transition: all 0.3s var(--ease);
}
.feature-card:hover { border-color: var(--border-focus); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.feature-icon { font-size: 1.75rem; margin-bottom: var(--space-3); }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-2); }
.feature-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.price-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6); position: relative; transition: all 0.3s var(--ease);
}
.price-card:hover { border-color: var(--accent); }
.price-card.popular { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.price-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; font-size: 0.6875rem; font-weight: 700;
  padding: 2px 12px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.price-tier { font-size: 0.875rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.price-amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: var(--space-4); }
.price-currency { font-size: 1.25rem; font-weight: 600; color: var(--text-secondary); vertical-align: super; }
.price-period { font-size: 0.875rem; font-weight: 400; color: var(--text-muted); }
.price-features { list-style: none; margin-bottom: var(--space-6); }
.price-features li {
  padding: var(--space-2) 0; font-size: 0.875rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.price-features li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* Footer */
.landing-footer {
  text-align: center; padding: var(--space-12) var(--space-8);
  border-top: 1px solid var(--border-subtle);
}
.footer-brand { display: flex; align-items: center; gap: var(--space-2); justify-content: center; margin-bottom: var(--space-2); }
.footer-by { color: var(--text-muted); font-size: 0.8125rem; }
.footer-tagline { color: var(--text-secondary); font-style: italic; margin-bottom: var(--space-2); font-size: 0.9375rem; }
.footer-copy { color: var(--text-muted); font-size: 0.75rem; }

/* ═══ AUTH PAGE ═══════════════════════════════════════════════ */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.auth-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--space-10); width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-header { text-align: center; margin-bottom: var(--space-8); }
.auth-header .brand-icon { font-size: 2.5rem; display: block; margin-bottom: var(--space-3); }
.auth-header h2 { font-size: 1.375rem; font-weight: 700; }
.auth-header p { color: var(--text-secondary); font-size: 0.875rem; margin-top: var(--space-1); }
.auth-divider { text-align: center; margin: var(--space-6) 0; position: relative; }
.auth-divider::before { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: var(--border); }
.auth-divider span { position: relative; background: var(--bg-surface); padding: 0 var(--space-3); color: var(--text-muted); font-size: 0.8125rem; }
.auth-form { display: flex; flex-direction: column; gap: var(--space-3); }
.auth-form input { padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: 0.9375rem; }
.auth-switch { text-align: center; margin-top: var(--space-4); font-size: 0.875rem; color: var(--text-secondary); }
.auth-back { display: block; text-align: center; margin-top: var(--space-4); font-size: 0.8125rem; color: var(--text-muted); }

/* ═══ DASHBOARD LAYOUT ═══════════════════════════════════════ */
.dashboard-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: var(--bg-surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: var(--space-5);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-8); padding: var(--space-1) 0; }
.sidebar-brand .brand-name { font-size: 1rem; font-weight: 800; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--duration) var(--ease); text-decoration: none;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-link.active { color: var(--text-primary); background: var(--accent-subtle); }
.sidebar-link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-footer { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-subtle); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 700;
}
.user-name { font-size: 0.8125rem; font-weight: 600; display: block; }
.user-tier { font-size: 0.6875rem; color: var(--text-muted); display: block; text-transform: uppercase; letter-spacing: 0.04em; }

/* Main Content */
.main-content { padding: var(--space-8); overflow-y: auto; }
.view { display: none; animation: viewIn 0.3s var(--ease); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }
.view-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.view-desc { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: var(--space-6); max-width: 600px; }

/* Tier Badge */
.tier-badge {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 10px; letter-spacing: 0.04em;
  background: var(--accent-subtle); color: var(--accent-text);
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-8); }
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); text-align: center;
}
.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-3); }
.stat-ring { position: relative; width: 100px; height: 100px; margin: 0 auto var(--space-2); }
.stat-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s var(--ease); }
.ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.375rem; font-weight: 700; font-family: var(--font-mono); }
.stat-limit { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.stat-big { font-size: 2.5rem; font-weight: 800; margin: var(--space-3) 0; font-family: var(--font-mono); }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ── Quick Actions ──────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-8); }
.action-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); display: flex; align-items: center; gap: var(--space-3);
  cursor: pointer; transition: all var(--duration) var(--ease);
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; color: var(--text-primary);
}
.action-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.action-icon { font-size: 1.25rem; }

/* ── Endpoint Table ─────────────────────────────────────────── */
.endpoint-table-wrap { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.endpoint-table-wrap h3 { font-size: 0.9375rem; font-weight: 700; margin-bottom: var(--space-4); }
.endpoint-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.endpoint-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); text-transform: uppercase; font-size: 0.6875rem; letter-spacing: 0.06em; }
.endpoint-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 0.8125rem; }
.method { font-size: 0.6875rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; font-family: var(--font-mono); }
.method.post { background: var(--accent-subtle); color: var(--accent-text); }
.method.get  { background: var(--success-bg); color: var(--success); }
.tok-high { color: var(--warning); }
.tok-low  { color: var(--success); }
.tok-none { color: var(--text-muted); }

/* ── Panel (Keys, Vault) ────────────────────────────────────── */
.panel {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6); margin-bottom: var(--space-5);
}
.panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-4); }
.panel-success { border-color: var(--success); }
.panel-header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.panel-warn { color: var(--warning); font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--space-3); }
.key-display {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-3); font-family: var(--font-mono); font-size: 0.8125rem; word-break: break-all;
}
.key-display code { flex: 1; color: var(--success); }

/* ── Keys List ──────────────────────────────────────────────── */
.keys-list { display: flex; flex-direction: column; gap: var(--space-3); }
.key-item {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); display: flex; align-items: center; justify-content: space-between;
  transition: border-color var(--duration) var(--ease);
}
.key-item:hover { border-color: var(--border-focus); }
.key-item-info { display: flex; flex-direction: column; gap: 2px; }
.key-item-name { font-weight: 600; font-size: 0.875rem; }
.key-item-prefix { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }
.key-item-scope { font-size: 0.6875rem; color: var(--accent-text); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.key-item-meta { text-align: right; }
.key-item-date { font-size: 0.6875rem; color: var(--text-muted); }
.key-item.revoked { opacity: 0.5; }
.key-item.revoked .key-item-name::after { content: " (revoked)"; color: var(--danger); font-weight: 400; }

/* ── Vault ──────────────────────────────────────────────────── */
.vault-badge {
  font-size: 0.6875rem; font-weight: 700; padding: 3px 10px; border-radius: 10px;
  background: var(--success-bg); color: var(--success); letter-spacing: 0.02em;
}
.vault-notice {
  display: flex; gap: var(--space-4); padding: var(--space-5);
  background: var(--accent-subtle); border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-lg); margin-bottom: var(--space-6);
}
.vault-notice-icon { font-size: 1.5rem; flex-shrink: 0; }
.vault-notice strong { font-size: 0.875rem; display: block; margin-bottom: 2px; }
.vault-notice p { font-size: 0.8125rem; color: var(--text-secondary); margin: 0; }
.vault-add { margin-bottom: var(--space-6); }
.provider-detect {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
  background: var(--success-bg); border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 600; color: var(--success);
}
.detect-badge { font-size: 0.625rem; background: var(--success); color: white; padding: 1px 6px; border-radius: 8px; font-weight: 700; }
.vault-list { display: flex; flex-direction: column; gap: var(--space-3); }
.vault-item {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); display: flex; align-items: center; justify-content: space-between;
}
.vault-item-info { display: flex; align-items: center; gap: var(--space-4); }
.vault-item-icon { font-size: 1.5rem; }
.vault-item-name { font-weight: 700; font-size: 0.9375rem; }
.vault-item-masked { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.vault-item-model { font-size: 0.6875rem; color: var(--accent-text); margin-top: 2px; }
.vault-item-actions { display: flex; gap: var(--space-2); }

/* ── Playground ─────────────────────────────────────────────── */
.playground-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin-bottom: var(--space-8); }
.playground-input, .playground-output {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.status-badge { padding: 2px 8px; border-radius: 8px; font-size: 0.6875rem; font-weight: 700; }
.status-badge { background: var(--bg-hover); color: var(--text-muted); }
.status-badge.loading { background: var(--warning-bg); color: var(--warning); }
.status-badge.success { background: var(--success-bg); color: var(--success); }
.status-badge.error   { background: var(--danger-bg); color: var(--danger); }
.output-body {
  background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-4); font-family: var(--font-mono); font-size: 0.8125rem;
  max-height: 400px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: var(--text-secondary); line-height: 1.6;
}
.output-meta { margin-top: var(--space-3); font-size: 0.75rem; color: var(--text-muted); display: flex; gap: var(--space-4); }

/* Snippets */
.snippets { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.snippets h3 { font-size: 0.9375rem; font-weight: 700; margin-bottom: var(--space-3); }
.snippet-tabs { display: flex; gap: 2px; margin-bottom: var(--space-3); }
.snippet-tab {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.8125rem; font-weight: 600; font-family: var(--font-mono);
  transition: all var(--duration) var(--ease);
}
.snippet-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.snippet-tab.active { color: var(--accent-text); background: var(--accent-subtle); }
.snippet-code {
  background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-4); font-family: var(--font-mono); font-size: 0.8125rem;
  white-space: pre-wrap; color: var(--text-secondary); line-height: 1.6;
  max-height: 300px; overflow: auto;
}

/* ── Docs ────────────────────────────────────────────────────── */
.docs-content { max-width: 720px; }
.docs-content h2 { font-size: 1.25rem; font-weight: 700; margin: var(--space-8) 0 var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.docs-content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.docs-content h3 { font-size: 1rem; font-weight: 600; margin: var(--space-5) 0 var(--space-2); color: var(--accent-text); }
.docs-content p  { color: var(--text-secondary); margin-bottom: var(--space-3); line-height: 1.7; font-size: 0.9375rem; }
.docs-content pre {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); font-family: var(--font-mono); font-size: 0.8125rem;
  overflow-x: auto; margin-bottom: var(--space-4); white-space: pre-wrap;
  color: var(--text-secondary);
}
.docs-content code { font-family: var(--font-mono); background: var(--bg-hover); padding: 1px 4px; border-radius: 3px; font-size: 0.875em; }
.docs-content pre code { background: none; padding: 0; }
.docs-content ul, .docs-content ol { margin: 0 0 var(--space-4) var(--space-6); color: var(--text-secondary); }
.docs-content li { margin-bottom: var(--space-1); font-size: 0.9375rem; }
.docs-content table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-4); font-size: 0.875rem; }
.docs-content th { text-align: left; font-weight: 600; color: var(--text-muted); padding: var(--space-2); border-bottom: 1px solid var(--border); }
.docs-content td { padding: var(--space-2); border-bottom: 1px solid var(--border-subtle); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s;
}
.modal-content {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--space-8); max-width: 500px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease);
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: var(--space-10) var(--space-4); }
  .hero-subtitle { margin: 0 auto var(--space-8); }
  .hero-actions { justify-content: center; }
  .hero-code { margin: 0 auto; }
  .hero-agents { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .playground-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .landing-nav { padding: var(--space-3) var(--space-4); }
  .nav-links { gap: var(--space-2); }
  .hero-title { font-size: 2.25rem; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .chart-header { flex-direction: column; gap: var(--space-3); }
  .chart-stats { justify-content: flex-start; }
  .logs-table-wrap { overflow-x: auto; }
  .logs-table { min-width: 700px; }
}

/* ═══════════════════════════════════════════════════════════
   V2 — New Components
   ═══════════════════════════════════════════════════════════ */

/* ── Mobile Hamburger ─────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1000;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: var(--bg-hover); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

/* ── SVG Icon Base ────────────────────────────────────────── */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon svg {
  width: 100%;
  height: 100%;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* ── Analytics Chart ──────────────────────────────────────── */
.chart-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.chart-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.chart-stats {
  display: flex;
  gap: var(--space-5);
}
.chart-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chart-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chart-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.chart-canvas-wrap {
  width: 100%;
  height: 220px;
  position: relative;
}
.chart-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Request Logs Table ───────────────────────────────────── */
.logs-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.logs-table thead {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.logs-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.logs-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.log-row:hover { background: var(--bg-hover); }
.log-row.log-error { background: rgba(239,68,68,0.05); }
.log-row.log-error:hover { background: rgba(239,68,68,0.1); }
.log-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.log-model { font-family: var(--font-mono); font-size: 0.75rem; }
.log-latency { font-family: var(--font-mono); }
.log-tokens { font-family: var(--font-mono); color: var(--accent); }
.log-agent { display: inline-flex; align-items: center; gap: 4px; }
.log-agent .icon { width: 14px; height: 14px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-auto {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
}
.badge-direct {
  background: rgba(16,185,129,0.15);
  color: #34d399;
}
.badge-success {
  background: rgba(16,185,129,0.15);
  color: #34d399;
}
.badge-error {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  max-width: 640px;
}
.settings-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.settings-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.settings-count {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.ip-textarea {
  width: 100%;
  background: var(--bg-root);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  resize: vertical;
  transition: border-color 0.2s;
}
.ip-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}
.ip-textarea::placeholder {
  color: var(--text-muted);
}

/* ── Danger buttons ───────────────────────────────────────── */
.btn-danger { color: var(--danger) !important; }
.btn-danger:hover { background: rgba(239,68,68,0.1) !important; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  color: var(--text-muted);
  padding: var(--space-6);
  text-align: center;
  font-size: 0.875rem;
}

/* ── Form Hints ───────────────────────────────────────────── */
.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: var(--space-2);
  font-weight: 400;
}
.form-hint code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

/* ── Spinner ──────────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin { animation: spin 0.8s linear infinite; }

/* ── Status Badge ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.status-badge.badge-success {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
  color: #34d399;
}
.status-badge.badge-error {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}
.status-badge.badge-auto {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
  color: #818cf8;
}

/* ── Output Meta ──────────────────────────────────────────── */
.output-meta {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  gap: var(--space-4);
}

/* ── Playground conv wrap ─────────────────────────────────── */
#pg-conv-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.75rem;
}
#pg-conv-wrap code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}
