/* Business Analyser — design tokens & shared UI */
/* Ported from the Linchpin SaaS / LMS Advanced design system: clean light theme by
   default (Skool-inspired), with an opt-in black + accent-red premium dark theme via
   the toggle button. */

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

:root {
  --bg: #f5f6fa;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --card: #ffffff;
  --border: rgba(20,22,31,0.14);
  --border-soft: rgba(20,22,31,0.08);
  --ink: #14161f;
  --ink-dim: #5b6072;
  --ink-ghost: #8b8fa3;

  --accent: #4f6bfb;
  --accent-2: #3d56e0;
  --accent-dim: #2f42b8;
  --accent-soft: rgba(79,107,251,0.10);
  --signal: #d97706;
  --growth: #16a34a;
  --fire: #dc2626;
  --info: #3b82f6;

  --rail-bg: var(--surface);

  --gradient-accent: linear-gradient(135deg, #5b7bfd 0%, #3d56e0 100%);
  --gradient-hero: radial-gradient(60% 100% at 30% 0%, rgba(79,107,251,.14) 0%, transparent 60%), radial-gradient(50% 80% at 85% 20%, rgba(59,130,246,.10) 0%, transparent 60%);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(20,22,31,0.06);
  --shadow-md: 0 8px 22px rgba(20,22,31,0.08);
  --shadow-lg: 0 20px 46px rgba(20,22,31,0.14);
  --shadow-glow: 0 0 0 1px rgba(79,107,251,.18), 0 8px 20px rgba(79,107,251,.14);
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-alt: #101216;
  --surface: #16181e;
  --surface-2: #1c1f26;
  --card: #16181e;
  --border: rgba(255,255,255,0.14);
  --border-soft: rgba(255,255,255,0.08);
  --ink: #f4f5f7;
  --ink-dim: #aeb4c0;
  --ink-ghost: #72798a;

  --accent: #ff3b4e;
  --accent-2: #ff6a3d;
  --accent-dim: #c81e3a;
  --accent-soft: rgba(255,59,78,0.14);
  --signal: #f59e0b;
  --growth: #22c55e;
  --fire: #ef4444;
  --info: #3b82f6;

  --gradient-accent: linear-gradient(135deg, #ff4d5e 0%, #c81e3a 100%);
  --gradient-hero: radial-gradient(60% 100% at 30% 0%, rgba(255,59,78,.16) 0%, transparent 60%), radial-gradient(50% 80% at 85% 20%, rgba(255,106,61,.1) 0%, transparent 60%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.45);
  --shadow-glow: 0 0 0 1px rgba(255,59,78,.25), 0 8px 24px rgba(255,59,78,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700; margin: 0 0 8px; color: var(--ink); letter-spacing: -.01em; }
p { margin: 0 0 8px; color: var(--ink-dim); }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-ghost); }

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

/* ─── Layout utilities ──────────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.mb-16 { margin-bottom: 16px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; background: var(--accent-dim); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-signal { background: var(--signal); color: #1c0f04; font-weight: 700; }
.btn-signal:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); color: var(--ink); }
.btn-danger { background: var(--fire); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ─── Theme toggle ──────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; border: 2px solid #fff;
  background: var(--gradient-accent); color: #fff; cursor: pointer; transition: all .15s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,107,251,0.35);
}
:root[data-theme="dark"] .theme-toggle { box-shadow: 0 4px 12px rgba(255,59,78,0.4); }
.theme-toggle:hover { transform: translateY(-1px) scale(1.05); box-shadow: 0 6px 16px rgba(79,107,251,0.45); }
:root[data-theme="dark"] .theme-toggle:hover { box-shadow: 0 6px 16px rgba(255,59,78,0.5); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle-fixed {
  position: fixed; bottom: 22px; right: 22px; z-index: 999;
  width: 50px; height: 50px;
}

/* ─── Icon rail (primary nav strip) ─────────────────────────────────────── */
.icon-rail { width: 64px; flex-shrink: 0; background: var(--rail-bg); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; align-items: center; padding: 16px 0; }
.icon-rail .theme-toggle { border-color: var(--bg-alt); }
.rail-logo { width: 36px; height: 36px; border-radius: 11px; background: var(--gradient-accent); display: flex; align-items: center; justify-content: center; color: #fff; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 16px; margin-bottom: 20px; text-decoration: none; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.rail-link { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--ink-ghost); margin-bottom: 6px; transition: all .15s ease; text-decoration: none; flex-shrink: 0; }
.rail-link:hover { background: var(--surface-2); color: var(--ink); }
.rail-link.active { background: var(--accent-soft); color: var(--accent); }
.rail-spacer { flex: 1; }
.rail-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gradient-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.form-label.required::after { content: ' *'; color: var(--fire); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--ink-ghost); margin-top: 4px; }

/* ─── Alerts / badges ───────────────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13px; }
.alert-error { background: rgba(255,77,109,.1); color: var(--fire); border: 1px solid rgba(255,77,109,.28); }
.alert-success { background: rgba(45,212,167,.1); color: var(--growth); border: 1px solid rgba(45,212,167,.28); }
.alert-info { background: rgba(56,189,248,.1); color: var(--info); border: 1px solid rgba(56,189,248,.28); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-signal { background: rgba(255,138,61,.15); color: var(--signal); }
.badge-growth { background: rgba(45,212,167,.15); color: var(--growth); }
.badge-fire { background: rgba(255,77,109,.15); color: var(--fire); }
.badge-info { background: rgba(56,189,248,.15); color: var(--info); }
.badge-ghost { background: rgba(110,110,123,.15); color: var(--ink-ghost); }

/* ─── Auth pages ────────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; background: var(--bg); }
.auth-page::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: var(--gradient-hero); }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.logo-mark { width: 40px; height: 40px; background: var(--gradient-accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 18px; color: #fff; margin: 0 auto 12px; box-shadow: var(--shadow-sm); }

/* ─── Landing page ──────────────────────────────────────────────────────── */
.landing { position: relative; background: var(--bg); }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.hero { text-align: center; padding: 96px 24px 40px; max-width: 780px; margin: 0 auto; position: relative; }
.hero-banner { position: relative; z-index: 1; }
.hero::before { content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%); z-index: 0; width: 1000px; max-width: 140vw; height: 560px; pointer-events: none; background: var(--gradient-hero); }
.hero h1 { font-size: 50px; line-height: 1.12; position: relative; }
.hero h1 span { background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero > .hero-banner > p, .hero > p { font-size: 17px; max-width: 620px; margin: 0 auto 8px; position: relative; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding: 0 24px; max-width: 1120px; margin: 0 auto; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.feature-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 0 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; text-align: center; position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.pricing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pricing-card.featured { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gradient-accent); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.pricing-name { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 20px; }
.pricing-price { font-size: 34px; font-weight: 700; margin: 10px 0; }
.pricing-price span { font-size: 14px; color: var(--ink-ghost); font-weight: 400; }
.pricing-features { text-align: left; margin: 16px 0; }
.pricing-feature { padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; color: var(--ink-dim); }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,17,24,.5); backdrop-filter: blur(4px); align-items: center; justify-content: center; z-index: 100; }
:root[data-theme="dark"] .modal-overlay { background: rgba(4,4,6,.7); }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-close { background: none; border: none; color: var(--ink-ghost); cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 22px; }

/* ─── App shell ─────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border-soft); padding: 20px 12px; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-dim); font-size: 13px; font-weight: 500; margin-bottom: 2px; position: relative; transition: all .15s ease; }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.main { flex: 1; min-width: 0; padding: 28px 32px; max-width: 980px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }

/* ─── Cards / wizard steps ──────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; min-width: 0; box-shadow: var(--shadow-sm); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.checklist li:last-child { border-bottom: none; }

/* Wizard step tabs */
/* ─── Wizard: progress row, numbered stepper, panel head, CTA panel ────────
   Replaces the old pill-row wizard-steps with a real numbered/connected
   stepper (Typeform/Stripe Checkout-style) — functional wayfinding for an
   8-section form, not decoration. */
.wizard-progress-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.wizard-progress-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.wizard-progress-fill { height: 100%; background: var(--gradient-accent); border-radius: 4px; transition: width .3s ease; }
.wizard-progress-label { font-size: 12px; color: var(--ink-ghost); white-space: nowrap; flex-shrink: 0; }

.stepper { display: flex; align-items: flex-start; margin-bottom: 28px; overflow-x: auto; padding-bottom: 4px; }
.stepper-item { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 76px; position: relative; cursor: pointer; }
.stepper-line { position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.stepper-item:first-child .stepper-line { display: none; }
.stepper-item.done .stepper-line { background: var(--accent); }
.stepper-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-ghost); position: relative; z-index: 1; transition: all .15s ease; flex-shrink: 0; }
.stepper-item.active .stepper-dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.stepper-item.done .stepper-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.stepper-label { font-size: 11px; color: var(--ink-ghost); margin-top: 8px; text-align: center; line-height: 1.3; max-width: 90px; transition: color .15s ease; }
.stepper-item.active .stepper-label { color: var(--ink); font-weight: 600; }
.stepper-item.done .stepper-label { color: var(--ink-dim); }
.stepper-item:hover .stepper-label { color: var(--ink); }

.wizard-panel-head { margin-bottom: 22px; }
.wizard-panel-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.wizard-panel-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.wizard-panel-desc { font-size: 13px; color: var(--ink-ghost); margin: 0; }

.wizard-panel { animation: wizardFadeIn .25s ease; }
@keyframes wizardFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wizard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.wizard-foot-step { font-size: 12px; color: var(--ink-ghost); }

.cta-panel { text-align: center; padding: 44px 32px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.cta-panel.ready { border-color: rgba(79,107,251,.28); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 65%); }
.cta-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.cta-icon.locked { background: var(--surface-2); color: var(--ink-ghost); }
.cta-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.cta-desc { font-size: 13px; color: var(--ink-ghost); max-width: 440px; margin: 0 auto 22px; }

@media (max-width: 640px) {
  .stepper-label { display: none; }
  .stepper-item { min-width: 0; }
}

/* Profile grid */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.profile-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: transform .15s ease, border-color .15s ease; text-decoration: none; display: block; }
.profile-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.profile-card h4 { font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.profile-card-meta { font-size: 12px; color: var(--ink-ghost); margin-bottom: 10px; }
.profile-card-empty { border: 1.5px dashed var(--border); background: transparent; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--ink-ghost); min-height: 140px; }
.profile-card-empty:hover { border-color: var(--accent); color: var(--accent); }

/* Score ring / verdict */
.score-ring-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.score-ring { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.score-ring-val { font-size: 30px; font-weight: 800; color: var(--ink); }
.score-ring-max { font-size: 12px; color: var(--ink-ghost); }
.verdict-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.verdict-highly_capable { background: rgba(45,212,167,.15); color: var(--growth); }
.verdict-capable_with_gaps { background: rgba(255,138,61,.15); color: var(--signal); }
.verdict-not_yet_ready { background: rgba(255,77,109,.15); color: var(--fire); }

.category-bar-row { margin-bottom: 14px; }
.category-bar-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.category-bar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.category-bar-fill { height: 100%; border-radius: 4px; background: var(--gradient-accent); }

/* ─── Spinner ───────────────────────────────────────────────────────────── */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Admin analytics dashboard ─────────────────────────────────────────── */
.alert-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.alert-pill { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 12px; color: var(--ink-dim); }
.ap-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--kpi-accent, var(--accent)); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: var(--shadow-sm); transition: transform .15s ease; }
.kpi:hover { transform: translateY(-2px); }
.kpi-label { font-size: 11px; color: var(--ink-ghost); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.kpi-val { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.kpi-val.sm { font-size: 21px; }
.kpi-sub { margin-top: 8px; font-size: 11px; color: var(--ink-ghost); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge-up { color: var(--growth); font-weight: 700; }
.badge-down { color: var(--fire); font-weight: 700; }
.badge-neutral { color: var(--ink-ghost); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; min-width: 0; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title { font-size: 13px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
.panel-badge { font-size: 11px; color: var(--ink-ghost); }
.panel-link { font-size: 12px; color: var(--accent); }
.db-row { display: grid; gap: 18px; }
.db-row-2b { grid-template-columns: 2fr 1fr; }
.db-row-3 { grid-template-columns: repeat(3, 1fr); }
.db-row-equal { grid-template-columns: 1fr 1fr; }

.chart-tabs { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: 999px; border: 1px solid var(--border-soft); }
.ctab { background: transparent; border: none; color: var(--ink-dim); font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .15s ease; }
.ctab.active { background: var(--accent); color: #fff; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; color: var(--ink-ghost); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 8px; border-bottom: 1px solid var(--border-soft); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.status-dot.sd-active { background: var(--growth); }
.status-dot.sd-trial { background: var(--signal); }
.status-dot.sd-suspended { background: var(--fire); }
.status-dot.sd-cancelled { background: var(--ink-ghost); }

.plan-chip { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

.pay-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.pay-row:last-child { border-bottom: none; }
.pay-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gradient-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pay-info { flex: 1; min-width: 0; }
.pay-name { font-size: 12px; color: var(--ink); font-weight: 600; }
.pay-email { font-size: 11px; color: var(--ink-ghost); }
.pay-amount { font-size: 13px; font-weight: 700; color: var(--growth); text-align: right; }
.pay-date { font-size: 10px; color: var(--ink-ghost); text-align: right; }

/* ─── Admin: page headers, segmented tabs, plan cards, data tables ─────────
   A dedicated admin component set — deliberately restrained (neutral surfaces,
   one accent, dot/underline indicators instead of filled color badges
   everywhere) rather than reusing the public marketing pricing-card/tier-card
   components inside admin screens. */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head-title { font-size: 24px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; color: var(--ink); }
.page-head-sub { font-size: 13px; color: var(--ink-ghost); margin: 0; max-width: 520px; }
.page-head-actions { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.page-stat { text-align: right; }
.page-stat-label { font-size: 10.5px; color: var(--ink-ghost); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.page-stat-val { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1; }

.seg-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.seg-tab { position: relative; background: none; border: none; padding: 10px 4px; margin-right: 26px; font-size: 13px; font-weight: 600; color: var(--ink-ghost); cursor: pointer; white-space: nowrap; transition: color .15s ease; }
.seg-tab:hover { color: var(--ink); }
.seg-tab.active { color: var(--ink); }
.seg-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.seg-tab-count { color: var(--ink-ghost); font-weight: 500; }

.status-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-dim); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .15s ease; }
.plan-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; }
.plan-card-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.plan-card-price { font-size: 32px; font-weight: 800; color: var(--ink); margin: 12px 0 2px; letter-spacing: -.01em; }
.plan-card-price span { font-size: 13px; font-weight: 500; color: var(--ink-ghost); }
.plan-card-annual { font-size: 12px; color: var(--ink-ghost); margin-bottom: 18px; }
.plan-card-divider { height: 1px; background: var(--border-soft); margin: 2px 0 16px; }
.kv-list { margin-bottom: 4px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.kv-row span { color: var(--ink-dim); }
.kv-row strong { color: var(--ink); font-weight: 600; }
.plan-card-features { margin: 16px 0 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-card-feature { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.plan-card-feature svg { color: var(--growth); flex-shrink: 0; }
.plan-card-foot { margin-top: auto; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-ghost); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border-soft); color: var(--ink-dim); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table td.strong { color: var(--ink); font-weight: 600; }
.data-table-empty { text-align: center; padding: 40px 16px; color: var(--ink-ghost); font-size: 13px; }

.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.settings-row-desc { font-size: 12px; color: var(--ink-ghost); max-width: 440px; }
.settings-row-control { flex-shrink: 0; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.stat-tile { background: var(--card); padding: 16px 18px; }
.stat-tile-val { font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-tile-label { font-size: 11px; color: var(--ink-ghost); margin-top: 4px; }

@media (max-width: 900px) {
  .db-row-2b, .db-row-3, .db-row-equal { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .icon-rail { width: 100%; flex-direction: row; padding: 10px 16px; }
  .rail-logo { margin-bottom: 0; margin-right: 8px; }
  .rail-spacer { display: none; }
  .sidebar { width: 100%; }
  .page-head-actions { width: 100%; justify-content: space-between; }
}
