/* ════════════════════════════════════════════════════════
   ORBIT CONTENT — Client Dashboard styles (Futuristic V2)
   Shared by: /login, /forgot-password, /signup, /choose-plan,
   /onboarding/*, /payment-success, /dashboard/*
   Dark navy space theme · Space Grotesk + IBM Plex Mono ·
   deep blue interactive · brand ring gradient (teal→green→indigo)
   Every selector from V1 is preserved — only the look changed.
   ════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Interactive blue (dark royal) */
  --primary:        #1D4ED8;
  --primary-dark:   #1E40AF;
  --primary-light:  #2563EB;
  --accent:         #10B981;
  --accent-light:   #34D399;

  /* Space surfaces */
  --bg-dark:        #05080F;
  --bg-dark-alt:    #0C1428;
  --bg-light:       #0A0F1E;      /* was light grey — now deep panel navy */
  --bg-white:       #0A0F1E;      /* page background */
  --surface-light:  rgba(255,255,255,0.05);

  /* Type on dark */
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;

  --border:         rgba(255,255,255,0.10);
  --border-light:   rgba(255,255,255,0.05);

  /* Status hues (dark-tint chips) */
  --green:          #34D399;
  --green-bg:       rgba(52,211,153,0.10);
  --amber:          #FBBF24;
  --amber-bg:       rgba(251,191,36,0.09);
  --purple:         #93B4FD;                 /* repurposed: scheduled = blue */
  --purple-bg:      rgba(37,99,235,0.14);

  /* Brand extras */
  --teal:           #5EEAD4;
  --indigo:         #818CF8;
  --glass:          rgba(255,255,255,0.04);
  --glass-2:        rgba(255,255,255,0.07);
  --grad-ring:      linear-gradient(135deg, #5EEAD4 0%, #34D399 45%, #818CF8 100%);
  --grad-btn:       linear-gradient(180deg, #1D4ED8 0%, #1E40AF 100%);

  --font-heading:   'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: radial-gradient(ellipse 80% 50% at 70% -10%, rgba(30,64,175,0.16), transparent 60%), var(--bg-white);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(37,99,235,0.4); }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-primary); line-height: 1.25; letter-spacing: -0.01em; }
a { color: var(--primary-light); text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 600; padding: 11px 22px;
  border-radius: 10px; border: none; cursor: pointer; text-decoration: none;
  transition: all 0.18s ease; white-space: nowrap;
}
.btn-primary {
  background: var(--grad-btn); color: #fff;
  box-shadow: 0 8px 24px -6px rgba(30,64,175,0.55), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -6px rgba(29,78,216,0.6), inset 0 1px 0 rgba(255,255,255,0.14); }
.btn-ghost { background: var(--glass); color: var(--text-primary); border: 1px solid var(--border); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: var(--glass-2); color: #fff; border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 11px; border-radius: 7px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ════════════════════════════════════
   AUTH SCREENS (login / forgot password)
   ════════════════════════════════════ */
.auth-layout { display: flex; min-height: 100vh; }
.auth-side {
  width: 42%; min-width: 360px; padding: 56px 48px;
  display: flex; flex-direction: column;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  color: #fff; position: relative; overflow: hidden;
}
.auth-side > * { position: relative; z-index: 2; }
.auth-side-logo { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { flex-shrink: 0; display: block; }
.auth-side-body { margin: auto 0; max-width: 380px; }
.auth-side h1 { color: #fff; font-size: 34px; font-weight: 700; line-height: 1.2; margin-bottom: 18px; }
.auth-side p.sub { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 32px; }
.auth-feat { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; color: #CBD5E1; font-size: 14px; }
.auth-feat svg { flex-shrink: 0; margin-top: 2px; }
.auth-badge {
  margin-top: 36px; padding: 16px 18px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.auth-badge strong { display: block; color: var(--teal); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 5px; }
.auth-badge span { color: var(--text-secondary); font-size: 13px; }
.auth-side-footer { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 18px; padding: 36px; backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.8);
}
.auth-card h2 { font-size: 27px; font-weight: 700; margin-bottom: 8px; }
.auth-card .auth-sub { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; line-height: 1.6; }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; font-family: var(--font-body); font-size: 14px;
  color: var(--text-primary); background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: #334155; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.22);
}
.field select { color-scheme: dark; }
.field select option { background: var(--bg-dark-alt); color: var(--text-primary); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field .hint, .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.field label.check-label { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }

.auth-row { display: flex; justify-content: flex-end; margin: -8px 0 18px; }
.auth-row a { font-size: 13px; font-weight: 500; color: #93B4FD; }
.auth-alt { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); }
.auth-alt a { color: #93B4FD; font-weight: 600; }
.auth-error {
  display: none; background: rgba(248,113,113,0.09); border: 1px solid rgba(248,113,113,0.35); color: #FCA5A5;
  font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; line-height: 1.5;
}
.auth-error.show { display: block; }
.auth-success {
  display: none; background: var(--green-bg); border: 1px solid rgba(52,211,153,0.35); color: var(--accent-light);
  font-size: 13px; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; line-height: 1.6;
}
.auth-success.show { display: block; }

/* ════════════════════════════════════
   APP SHELL (sidebar + main)
   ════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-dark); border-right: 1px solid var(--border);
  padding: 28px 16px 20px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo {
  font-family: var(--font-heading); font-size: 19px; font-weight: 700;
  color: #fff; padding: 0 12px; margin-bottom: 30px; display: flex; align-items: center; gap: 9px;
}
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.13s, color 0.13s;
}
.side-nav a svg { flex-shrink: 0; opacity: 0.8; }
.side-nav a:hover { background: var(--glass); color: #fff; }
.side-nav a.active { background: rgba(30,64,175,0.3); border-color: rgba(37,99,235,0.35); color: #fff; font-weight: 600; }
.side-nav a.active svg { opacity: 1; }

.sidebar-bottom { margin-top: auto; }
.sidebar-bottom .side-nav { margin-bottom: 14px; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-top: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad-ring); color: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 12px; font-weight: 700;
}
.user-meta { min-width: 0; }
.user-meta .u-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .u-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-link { font-size: 12px; color: var(--text-muted); padding: 0 12px; }
.logout-link:hover { color: var(--text-secondary); text-decoration: underline; }

.main { flex: 1; min-width: 0; padding: 36px 44px 64px; background: transparent; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head .page-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── Cards & panels ── */
.card { background: var(--glass); border: 1px solid var(--border); border-radius: 14px; backdrop-filter: blur(10px); }
.card-light { background: var(--bg-dark-alt); border: 1px solid var(--border); border-radius: 14px; }
.card-pad { padding: 24px; }

/* ── Badges / status pills ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 99px; white-space: nowrap;
  border: 1px solid transparent;
}
.pill-green  { background: var(--green-bg);  color: var(--green);  border-color: rgba(52,211,153,0.3); }
.pill-amber  { background: var(--amber-bg);  color: var(--amber);  border-color: rgba(251,191,36,0.3); }
.pill-purple { background: var(--purple-bg); color: var(--purple); border-color: rgba(37,99,235,0.4); }
.pill-primary{ background: rgba(37,99,235,0.14); color: #93B4FD; border-color: rgba(37,99,235,0.4); }
.pill-muted  { background: rgba(100,116,139,0.12); color: var(--text-muted); border-color: rgba(100,116,139,0.35); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data td.t-title { color: var(--text-primary); font-weight: 500; }
table.data tr.rowlink { cursor: pointer; transition: background 0.12s; }
table.data tr.rowlink:hover { background: rgba(255,255,255,0.03); }

/* ── Dashboard specifics ── */
.plan-card { display: flex; gap: 40px; padding: 24px 28px; margin-bottom: 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
.plan-card::before {
  content: ''; position: absolute; right: -120px; top: -160px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(30,64,175,0.25), transparent 70%); pointer-events: none;
}
.plan-card .plan-left { flex: 1; min-width: 260px; position: relative; }
.plan-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.plan-title-row h3 { font-size: 18px; font-weight: 700; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 13px; }
.kv-row .k { color: var(--text-muted); font-weight: 500; }
.kv-row .v { color: var(--text-primary); font-weight: 500; text-align: right; }
.plan-includes { flex: 1; min-width: 260px; padding-left: 36px; border-left: 1px solid var(--border); position: relative; }
.plan-includes h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.inc-item { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); margin-bottom: 9px; line-height: 1.5; }
.inc-item svg { flex-shrink: 0; margin-top: 2px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.metric-card { padding: 20px 22px; }
.metric-card .m-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.metric-card .m-value { font-family: var(--font-heading); font-size: 26px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.metric-card .m-sub { font-size: 12px; color: var(--text-muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.section-head h3 { font-size: 17px; font-weight: 700; }
.section-head a { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.section-head a:hover { color: #93B4FD; }

/* ── Empty state ── */
.welcome-banner {
  background: rgba(30,64,175,0.14); border: 1px solid rgba(37,99,235,0.35); border-radius: 14px;
  padding: 36px 40px; text-align: center; margin-bottom: 28px;
}
.welcome-banner h2 { font-size: 18px; font-weight: 700; color: #BFDBFE; margin-bottom: 12px; }
.welcome-banner p { font-size: 14px; color: #93B4FD; line-height: 1.6; max-width: 640px; margin: 0 auto 22px; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { padding: 22px; }
.step-card .tag { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 12px; display: inline-block; }
.step-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.step-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; background: var(--glass); border: 1px solid var(--border); }

/* ── Filters ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  padding: 7px 16px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--glass); color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all 0.13s;
}
.filter-pill:hover { border-color: rgba(255,255,255,0.22); color: var(--text-primary); }
.filter-pill.active { background: var(--grad-btn); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(30,64,175,0.55); }

/* ── Piece view ── */
.piece-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.piece-topbar .back { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-secondary); }
.piece-topbar .back:hover { color: var(--text-primary); }
.piece-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.piece-layout { display: flex; gap: 32px; align-items: flex-start; }
.piece-article { flex: 1; min-width: 0; }
.piece-eyebrow { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.piece-eyebrow .ptype { color: #93B4FD; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.piece-eyebrow .pmeta { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; }
.piece-article h1 { font-size: 28px; font-weight: 700; margin-bottom: 22px; }
.seo-meta-box { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 28px; }
.seo-meta-box .sm-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 10px; }
.seo-meta-box .sm-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; line-height: 1.5; }
.seo-meta-box .sm-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.article-body { font-size: 15px; color: #CBD5E1; line-height: 1.8; }
.article-body p { margin-bottom: 18px; }
.article-body h2 { font-size: 18px; font-weight: 700; margin: 28px 0 12px; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; }
.article-body li { margin-bottom: 8px; }

.piece-side { width: 300px; flex-shrink: 0; position: sticky; top: 36px; }
.side-panel { padding: 20px; margin-bottom: 18px; }
.side-panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.detail-kv { margin-bottom: 13px; }
.detail-kv .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.detail-kv .v { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rev-box h4 { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.rev-box .rev-sub { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }

/* ── Brief page ── */
.brief-layout { display: flex; gap: 28px; align-items: flex-start; }
.brief-form { flex: 1; min-width: 0; }
.brief-side { width: 300px; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 8px 16px; border-radius: 99px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--glass); color: var(--text-secondary);
  transition: all 0.13s;
}
.chip:hover { border-color: rgba(37,99,235,0.5); color: var(--text-primary); }
.chip.on { background: var(--grad-btn); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 5px 14px -5px rgba(30,64,175,0.55); }
.chip-count { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.deadline-box {
  background: var(--amber-bg); border: 1px solid rgba(251,191,36,0.3); border-radius: 12px;
  padding: 14px 16px; margin-top: 18px;
}
.deadline-box strong { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); font-weight: 600; margin-bottom: 5px; }
.deadline-box span { font-size: 12px; color: #D6B25E; line-height: 1.5; }

/* ── Billing ── */
.bill-plan-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bill-price { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.bill-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bill-stat .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }
.bill-stat .v { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.pm-row { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.pm-icon { width: 44px; height: 30px; border-radius: 6px; background: var(--bg-dark); border: 1px solid var(--border); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.pm-meta { flex: 1; }
.pm-meta .pm-name { font-size: 14px; font-weight: 500; }
.pm-meta .pm-exp { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Settings ── */
.settings-section { margin-bottom: 32px; }
.settings-section > h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border-light); }
.set-row:last-child { border-bottom: none; }
.set-row .k { width: 180px; flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--text-muted); }
.set-row .v { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.set-row input.v-edit {
  flex: 1; font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--text-primary); background: rgba(255,255,255,0.03);
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.set-row input.v-edit:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.22); }
.set-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.toggle-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-meta { flex: 1; }
.toggle-row .t-title { font-size: 14px; font-weight: 500; }
.toggle-row .t-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px; background: rgba(100,116,139,0.4);
  transition: background 0.18s; cursor: pointer;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 0.18s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(2,4,10,0.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-dark-alt); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px; padding: 28px; box-shadow: 0 24px 64px rgba(0,0,0,0.7); }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal .modal-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #F1F5F9; color: var(--bg-dark); font-size: 13px; font-weight: 600;
  padding: 12px 22px; border-radius: 99px; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  opacity: 0; transition: all 0.25s ease; z-index: 300; pointer-events: none;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════
   3D LAYERS & FUTURISTIC HELPERS (new)
   ════════════════════════════════════ */
#orbit3d { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.above3d { position: relative; z-index: 2; }
.panel3d { position: absolute !important; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.panel3d canvas { width: 100% !important; height: 100% !important; }

/* Cosmic pages — full-page ambient 3D behind translucent shells */
.cosmic .app, .cosmic .auth-layout, .cosmic .ob-wrap, .cosmic .plan-wrap { position: relative; z-index: 2; }
.cosmic .sidebar, .cosmic .auth-side { background: rgba(5,8,15,0.72); }
.cosmic .auth-main { background: transparent; }

.mono-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.sys-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #CBD5E1;
}
.sys-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px 2px rgba(94,234,212,0.5); animation: orbit-pulse 2s ease-in-out infinite; }
@keyframes orbit-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

/* ════════════════════════════════════
   RESPONSIVE (mobile pass)
   ════════════════════════════════════ */
.mobile-topbar { display: none; }
.mobile-menu { display: none; }

@media (max-width: 1100px) {
  .piece-layout, .brief-layout { flex-direction: column; }
  .piece-side, .brief-side { width: 100%; position: static; }
  .bill-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .auth-side { display: none; }
  .sidebar { display: none; }
  .app { flex-direction: column; }
  .main { padding: 24px 18px 80px; }
  .metric-grid, .step-grid { grid-template-columns: 1fr; }
  .plan-includes { padding-left: 0; border-left: none; border-top: 1px solid var(--border); padding-top: 18px; }
  .page-head { flex-direction: column; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    background: rgba(5,8,15,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 14px 18px;
  }
  .mobile-topbar .m-logo { font-family: var(--font-heading); font-size: 17px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
  .mobile-topbar button { background: none; border: none; padding: 4px; color: #fff; }
  .mobile-menu {
    display: none; position: fixed; inset: 0; z-index: 150; background: var(--bg-dark);
    padding: 70px 24px 24px; flex-direction: column; gap: 4px;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { padding: 14px 12px; font-size: 17px; font-weight: 600; color: var(--text-primary); border-radius: 10px; }
  .mobile-menu a.active { background: rgba(30,64,175,0.3); color: #BFDBFE; }
  .mobile-menu .mm-close { position: absolute; top: 18px; right: 20px; font-size: 26px; background: none; border: none; color: var(--text-secondary); }
  .mobile-menu .mm-logout { margin-top: auto; color: var(--text-muted); font-size: 14px; font-weight: 500; }

  .set-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .set-row .k { width: auto; }
  table.data th:nth-child(2), table.data td:nth-child(2) { display: none; }

  /* Phone performance: no backdrop blurs on mobile (scroll jank) */
  * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .card, .auth-card { background: rgba(20,28,50,0.7); }
  .mobile-topbar { background: rgba(5,8,15,0.96); }
}
