/* ═══════════════════════════════════════════════════════════════
   tokens.css — SINGLE SOURCE OF TRUTH for the Consulting suite look.
   Change anything here and it propagates everywhere. No view should
   hardcode a hex color, font, radius or shadow — consume these tokens.

   How to retheme the whole app:
     · Brand color      → --primary / --accent / --warm
     · Background/text   → --bg / --text / --text-muted
     · Roundness         → --radius-*
     · Fonts             → --font-display / --font-sans
   Icons are standardized on Lucide (loaded in base.html). No emojis.
   ═══════════════════════════════════════════════════════════════ */

/* ── Dark (default) — teal sage on green-black, warm gold accent ── */
:root, [data-theme="dark"] {
    /* Brand / accent */
    --primary: #36a789;          /* strong teal — fills, primary buttons */
    --primary-hover: #2d8f74;
    --accent: #7dd3bd;           /* light teal — icons, links, highlights */
    --warm: #d8b56d;             /* warm gold — kickers, "start here" only */
    --warm-soft: #f7deb0;
    --warm-bg: rgba(216, 181, 109, 0.14);

    /* Surfaces */
    --bg: #0c1215;               /* green-black canvas */
    --bg-elev: rgba(22, 31, 34, 0.86);     /* raised panel */
    --bg-card: rgba(255, 255, 255, 0.035);
    --bg-hover: rgba(125, 211, 189, 0.08);
    --bg-surface: rgba(18, 27, 30, 0.92);
    --bg-surface-elevated: rgba(22, 31, 34, 0.92);
    --bg-lighter: rgba(255, 255, 255, 0.06);

    /* Text */
    --text: #f6f2e9;             /* warm cream */
    --text-base: #f6f2e9;
    --text-muted: #a9b6ae;       /* sage gray */
    --text-soft: #8c9a92;

    /* Lines */
    --border: rgba(226, 232, 240, 0.11);

    /* Semantic states */
    --buy: #36a789;
    --buy-bg: rgba(54, 167, 137, 0.15);
    --sell: #e0715a;
    --sell-bg: rgba(224, 113, 90, 0.15);
    --warning: #d8b56d;

    /* Investment stance (opportunities) */
    --stance-strong-buy: #6ee7b7;  --stance-strong-buy-bg: rgba(54, 167, 137, 0.18);
    --stance-buy: #86efac;         --stance-buy-bg: rgba(54, 167, 137, 0.12);
    --stance-hold: #e3c87a;        --stance-hold-bg: rgba(216, 181, 109, 0.14);
    --stance-underperform: #e6a08c; --stance-underperform-bg: rgba(224, 113, 90, 0.12);
    --stance-sell: #e0715a;        --stance-sell-bg: rgba(224, 113, 90, 0.18);

    /* Document kinds (artifact badges) */
    --kind-research: #7dd3bd;  --kind-research-bg: rgba(125, 211, 189, 0.12);
    --kind-dossier: #d8b56d;   --kind-dossier-bg: rgba(216, 181, 109, 0.14);
    --kind-tool: #9ec6ff;      --kind-tool-bg: rgba(158, 198, 255, 0.12);

    /* Journey aliases — kept so existing markup keeps working,
       now resolve to the global palette instead of a rival one */
    --journey-bg: var(--bg);
    --journey-panel: var(--bg-elev);
    --journey-card: var(--bg-surface);
    --journey-line: var(--border);
    --journey-ink: var(--text);
    --journey-muted: var(--text-muted);
    --journey-accent: var(--accent);
    --journey-accent-strong: var(--primary);
    --journey-warm: var(--warm);

    /* Chrome */
    --footer-bg: transparent;
    --footer-text: rgba(246, 242, 233, .6);
    --footer-border: rgba(226, 232, 240, .1);
    --sidebar-bg: rgba(255, 255, 255, 0.02);
    --sidebar-border: rgba(226, 232, 240, 0.08);

    /* Type */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --mono: 'JetBrains Mono', monospace;

    /* ── Editorial deliverable surface ──
       Client-facing reports & dossiers stay light/editorial in BOTH themes
       (these are intentionally NOT overridden in [data-theme="light"]).
       Same teal+gold brand as the cockpit, applied to a paper canvas. */
    --doc-paper: #f4f1ea;          /* page background */
    --doc-surface: #ffffff;        /* white card */
    --doc-surface-soft: #f8f5ef;   /* cream panel */
    --doc-ink: #16231f;            /* heading ink (dark teal-slate) */
    --doc-ink-soft: #59635c;       /* body muted */
    --doc-line: #e6e0d4;           /* hairline */
    --doc-cover-bg: linear-gradient(145deg, #0c1413, #13201d 55%, #1b2c27);
    --doc-cover-soft: #16283b;
    --doc-cover-ink: #f6f2e9;      /* cream on dark cover */
    --doc-accent: #b6862e;         /* gold ink (legible on light) */
    --doc-accent-2: #2d8f74;       /* teal ink / links */

    /* ── Legacy aliases ──
       Older views reference these names. Mapped to real tokens so they
       keep working without per-file edits. Any page that re-declares one
       in its own <style> (loaded after this file) still wins. */
    --primary-color: var(--primary);
    --text-color: var(--text);
    --text-main: var(--text);
    --text-accent: var(--accent);
    --bg-color: var(--bg);
    --bg-main: var(--bg);
    --card-bg: var(--bg-card);
    --bg-card-hover: var(--bg-hover);
    --border-color: var(--border);
    --border-hover: var(--text-muted);
    --header-bg: var(--bg-elev);
    --surface-light: var(--bg-surface);
    --muted: var(--text-muted);
    --warm-gray: var(--text-muted);
    --slate: var(--text-muted);
    --off-white: var(--text);
    --success: var(--buy);
    --accent-light: var(--accent);
    --font-mono: var(--mono);
    --primary-rgb: 54, 167, 137;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.18);
    --shadow-md: var(--shadow);
    --shadow-lg: 0 18px 44px rgba(0,0,0,0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    /* Radius scale */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    /* Spacing scale */
    --space-1: 0.5rem;
    --space-2: 0.85rem;
    --space-3: 1.25rem;
    --space-4: 2rem;
    --space-5: 3rem;

    /* Effects */
    --shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.18);
    --blur: blur(24px);
    --glass-grad: linear-gradient(135deg, rgba(125,211,189,0.05) 0%, rgba(125,211,189,0.01) 100%);

    /* Background orbs */
    --orb-1: radial-gradient(circle at 15% 50%, rgba(54, 167, 137, 0.13), transparent 25%);
    --orb-2: radial-gradient(circle at 85% 30%, rgba(216, 181, 109, 0.07), transparent 25%);
}

/* ── Light (warm editorial — report-on-paper) ── */
[data-theme="light"] {
    --primary: #2d8f74;
    --primary-hover: #226e5a;
    --accent: #36a789;
    --warm: #b6862e;
    --warm-soft: #c9a84c;
    --warm-bg: rgba(201, 168, 76, 0.12);

    --bg: #f4f1ea;
    --bg-elev: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-hover: rgba(54, 167, 137, 0.06);
    --bg-surface: #fffdf9;
    --bg-surface-elevated: #ffffff;
    --bg-lighter: rgba(0, 0, 0, 0.04);

    --text: #1d211f;
    --text-base: #1d211f;
    --text-muted: #5f6b64;
    --text-soft: #8a948d;

    --border: rgba(45, 60, 54, 0.12);

    --buy: #2d8f74;        --buy-bg: rgba(45, 143, 116, 0.14);
    --sell: #c75a42;       --sell-bg: rgba(199, 90, 66, 0.14);
    --warning: #b6862e;

    --stance-strong-buy: #1f7a5e;  --stance-strong-buy-bg: rgba(45, 143, 116, 0.16);
    --stance-buy: #2d8f74;         --stance-buy-bg: rgba(45, 143, 116, 0.1);
    --stance-hold: #9a7424;        --stance-hold-bg: rgba(201, 168, 76, 0.14);
    --stance-underperform: #b5694f; --stance-underperform-bg: rgba(199, 90, 66, 0.1);
    --stance-sell: #c75a42;        --stance-sell-bg: rgba(199, 90, 66, 0.16);

    --kind-research: #2d8f74;  --kind-research-bg: rgba(45, 143, 116, 0.12);
    --kind-dossier: #b6862e;   --kind-dossier-bg: rgba(201, 168, 76, 0.14);
    --kind-tool: #3f6fb0;      --kind-tool-bg: rgba(63, 111, 176, 0.1);

    --journey-bg: var(--bg);
    --journey-panel: var(--bg-elev);
    --journey-card: var(--bg-surface);
    --journey-line: var(--border);
    --journey-ink: var(--text);
    --journey-muted: var(--text-muted);
    --journey-accent: var(--accent);
    --journey-accent-strong: var(--primary);
    --journey-warm: var(--warm);

    --footer-bg: transparent;
    --footer-text: rgba(29, 33, 31, .55);
    --footer-border: rgba(45, 60, 54, .1);
    --sidebar-bg: rgba(255, 255, 255, 0.5);
    --sidebar-border: rgba(45, 60, 54, 0.08);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    --space-1: 0.5rem;
    --space-2: 0.85rem;
    --space-3: 1.25rem;
    --space-4: 2rem;
    --space-5: 3rem;

    --shadow: 0 4px 24px -1px rgba(45, 60, 54, 0.08);
    --shadow-soft: 0 8px 18px rgba(45, 60, 54, 0.06);
    --blur: blur(24px);
    --glass-grad: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.5) 100%);

    --orb-1: radial-gradient(circle at 15% 50%, rgba(54, 167, 137, 0.1), transparent 25%);
    --orb-2: radial-gradient(circle at 85% 30%, rgba(201, 168, 76, 0.08), transparent 25%);
}
