/* ════════════════════════════════════════════════════════════════════
   Design tokens — Spartan palette + theme variables
   Dark is the default; [data-theme="light"] flips the same names.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Tell native form controls (number-input value text, date pickers,
     scrollbars) to render in dark mode by default. Without this hint,
     browsers fall back to the OS preference — on a light-mode OS, that
     produced black text on near-black input backgrounds in our number
     fields. The light-theme override below flips it. */
  color-scheme: dark;

  /* Spartan palette (dark mode tokens) */
  --background: #0d0d0d;
  --foreground: #f8f8f8;
  --card: #030303;
  --card-foreground: #f8f8f8;
  --popover: #030303;
  --popover-foreground: #f8f8f8;
  --primary: #f8f8f8;
  --primary-foreground: #0d0d0d;
  --secondary: #0b0b0b;
  --secondary-foreground: #f8f8f8;
  --muted: #161616;
  --muted-foreground: #717171;
  --accent: #0b0b0b;
  --accent-foreground: #f8f8f8;
  --destructive: #82181a;
  --destructive-foreground: #fb2c36;
  --border: #161616;
  --border-strong: #262626;
  --input: #0b0b0b;
  --ring: #484848;

  /* Functional palette */
  --profit: #51c148;
  --loss: #e40014;
  --status-live: #51c148;
  --status-dev: #f8a800;

  /* Chart palette (dark) */
  --chart-1: #1447e6;
  --chart-2: #00bb7f;
  --chart-3: #f99c00;
  --chart-4: #ac4bff;
  --chart-5: #ff2357;

  /* OTC accents (from spartan-dashboard OTC tab) */
  --otc-token: #D4A574;  /* token / locked side */
  --otc-hedge: #627EEA;  /* hedge / perp side */
  --otc-cyan:  #22D3EE;  /* projected/simulated */

  /* Liquidation ladder — qualitative OKLCH ramp with ~45° hue jumps so
     adjacent stacked segments read as discrete steps, not a gradient.
     Walks green → cyan → blue → purple → magenta → red as the unwind
     horizon lengthens. Chroma 0.16–0.22 keeps each step saturated; the
     locked tail spikes chroma + drops lightness for an unambiguous
     "danger" read. */
  --ladder-1d:       oklch(0.78 0.16 150);
  --ladder-3d:       oklch(0.74 0.15 195);
  --ladder-7d:       oklch(0.68 0.16 245);
  --ladder-30d:      oklch(0.66 0.17 295);
  --ladder-90d:      oklch(0.68 0.18 340);
  --ladder-illiquid: oklch(0.60 0.22 25);

  --surface:   #0d0d0d;
  --surface-2: #161616;
  --surface-3: #1e1e1e;

  /* Card / KPI / deal-card backgrounds (theme-aware so they read correctly
     against both light & dark page backgrounds). */
  --surface-card:     rgba(3, 3, 3, .30);
  --surface-card-2:   rgba(3, 3, 3, .40);
  --surface-elevated: rgba(255, 255, 255, .02);
  --surface-tinted:   rgba(255, 255, 255, .04);
  --hover-tint:       rgba(255, 255, 255, .04);
  --pill-bg:          var(--secondary);
  --watermark-svg:    url('/spartan_text_light.svg');

  --radius: 0.25rem;
  --shadow-card: 0 1px 0 rgba(255,255,255,.02), 0 4px 20px rgba(0,0,0,.45);

  --font-mono: 'Geist Mono', 'Geist Mono Fallback', 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* ════════════════════════════════════════════════════════════════════
   LIGHT THEME — token mirror of the dark palette, driven by
   [data-theme="light"] on <html>. auth.js setTheme() flips the attr.
   ════════════════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  color-scheme: light;
  --background: #fafafa;
  --foreground: #111111;
  --card: #ffffff;
  --card-foreground: #111111;
  --popover: #ffffff;
  --popover-foreground: #111111;
  --primary: #111111;
  --primary-foreground: #ffffff;
  --secondary: #f0f0f0;
  --secondary-foreground: #111111;
  --muted: #ebebeb;
  --muted-foreground: #6b6b6b;
  --accent: #f0f0f0;
  --accent-foreground: #111111;
  --destructive: #fee2e2;
  --destructive-foreground: #b91c1c;
  --border: #e5e5e5;
  --border-strong: #cfcfcf;
  --input: #ffffff;
  --ring: #94a3b8;
  --status-live: #16a34a;
  --status-dev: #d97706;
  --profit: #16a34a;
  --loss: #dc2626;
  --chart-1: #1d4ed8;
  --chart-2: #059669;
  --chart-3: #d97706;
  --chart-4: #7c3aed;
  --chart-5: #db2777;
  --otc-token: #b07a3a;
  --otc-hedge: #3b56b8;
  --otc-cyan:  #0891b2;
  /* Liquidation ladder — light theme: lower lightness for contrast on
     the white card surface, same wide-hue rotation. */
  --ladder-1d:       oklch(0.58 0.18 150);
  --ladder-3d:       oklch(0.54 0.16 195);
  --ladder-7d:       oklch(0.50 0.17 245);
  --ladder-30d:      oklch(0.48 0.18 295);
  --ladder-90d:      oklch(0.50 0.20 340);
  --ladder-illiquid: oklch(0.54 0.22 25);
  --surface:   #ffffff;
  --surface-2: #f5f5f5;
  --surface-3: #ececec;
  /* Light-theme overrides for card surfaces — solid white reads cleaner
     than translucent black-on-white. */
  --surface-card:     #ffffff;
  --surface-card-2:   #ffffff;
  --surface-elevated: rgba(0, 0, 0, .025);
  --surface-tinted:   rgba(0, 0, 0, .04);
  --hover-tint:       rgba(0, 0, 0, .035);
  --pill-bg:          #f4f4f4;
  --watermark-svg:    url('/spartan_text_dark.svg');
}
