/* ============================================================
   tokens.css — Covered Care design system  (v6 — "Instrument")

   An instrument panel for merchant onboarding, not a report about it.
   Dark is the primary theme: navy #16155C driven to near-black, three
   elevation planes instead of borders everywhere, hairline rules, and
   Covered orange #F15A22 as the ONE signal colour. Light is a full
   equal — it is what prints and what goes in a leadership deck.

   Fully offline: UI = embedded Archivo · data/numbers = embedded IBM
   Plex Mono. No CDN, no external font.

   RULES FOR ANYONE EDITING THIS FILE
   1. Token NAMES are a public API. js/charts.js reads --c-*, --grid,
      --ink-3, --surface, --font and --font-data at draw time, and view
      templates reference var(--…) inline. Renaming breaks them silently.
   2. Every colour must be defined in BOTH :root and [data-theme="dark"].
      A colour defined in only one block breaks the other theme.
   3. If you change a --c-* value, update the FB fallback map in
      js/charts.js to match, or the headless test harness diverges from
      the browser.
   ============================================================ */

:root {
  /* ---- brand: Covered navy (from the logo) ---------------------- */
  --navy:        #16155C;
  --navy-800:    #1C1B6E;
  --navy-700:    #232270;
  --navy-600:    #34338C;
  --navy-500:    #4A49A8;
  --navy-200:    #C8C8E6;
  --navy-100:    #E7E7F4;
  --navy-50:     #F2F2FB;

  /* ---- signal: Covered orange ----------------------------------
     The ONLY orange in the interface. Primary actions, the live
     number, current selection. Never decoration.                   */
  --orange:      #E8500F;   /* fills, primary action                */
  --orange-600:  #C6410B;   /* hover / pressed                      */
  --orange-700:  #9C3308;   /* orange text on light (AA on white)   */
  --orange-400:  #F15A22;   /* the pure brand tone — marks, charts  */
  --orange-100:  #FCE3D8;
  --orange-50:   #FEF3EE;

  /* ---- neutrals: navy-tinted, not slate-blue -------------------- */
  --ink:         #0D0D22;   /* primary text — navy-black            */
  --ink-2:       #3A3E58;   /* secondary text                       */
  --ink-3:       #62687F;   /* muted / meta                         */
  --ink-4:       #8A90A6;   /* faint / disabled                     */
  --line:        #DEE2EC;   /* borders                              */
  --line-2:      #ECEFF6;   /* hairlines / zebra                    */
  --bg:          #F4F5FA;   /* app canvas — plane 0                 */
  --bg-2:        #FAFBFD;   /* sunken / inset                       */
  --surface:     #FFFFFF;   /* cards — plane 1                      */
  --surface-2:   #F3F5FA;   /* table head / inset on card — plane 2 */
  --surface-3:   #E9EDF5;   /* deepest inset                        */

  /* ---- sidebar plane (its own scale so it never depends on
          --navy inverting between themes) ------------------------- */
  --sb-bg:       #16155C;
  --sb-bg-2:     #1C1B6E;
  --sb-line:     #2C2B7A;
  --sb-ink:      #FFFFFF;
  --sb-ink-2:    #B9B8E4;
  --sb-ink-3:    #8281C0;

  /* ---- semantic status (accessible pairs on light) -------------- */
  --good:        #0E7050;   --good-600: #0A5B40;   --good-bg: #E2F5EC;   --good-line: #B6E3CD;
  --warn:        #855409;   --warn-600: #6B4407;   --warn-bg: #FBF0D7;   --warn-line: #EFD9A2;
  --bad:         #B62F29;   --bad-600:  #96231E;   --bad-bg:  #FCE5E3;   --bad-line:  #F3C5C2;
  --info:        #2A54AE;   --info-600: #1F4291;   --info-bg: #E5EDFB;   --info-line: #C3D6F3;

  /* aliases some components expect */
  --ok-700:      var(--good-600);
  --ok-bg:       var(--good-bg);
  --warn-700:    var(--warn-600);
  --muted:       var(--ink-3);
  --text-muted:  var(--ink-3);

  /* ---- chart series ---------------------------------------------
     Orange leads (it is the outcome the business cares about), then a
     cool ramp. No gold, no lavender-first. Keep js/charts.js FB in sync. */
  --c-navy:   #3B3AA0;
  --c-orange: #E8500F;
  --c-teal:   #0E8FA8;
  --c-violet: #6B5BC4;
  --c-amber:  #B8830C;
  --c-green:  #12805A;
  --c-rose:   #C93B33;
  --c-slate:  #767D96;
  --c-navy-2: #2C6ECB;   /* second blue — keeps Total vs Direct tellable apart */
  --grid:     #E6EAF2;

  /* ---- per-area accent (drives body[data-area]) ------------------ */
  --area-reporting: #3B3AA0;
  --area-data:      #0E7C90;
  --area-work:      #C6410B;
  --area-reference: #6B4FC0;
  --area-guide:     #4A5068;

  /* ---- shape ----------------------------------------------------- */
  --r-xs:   5px;
  --r-sm:   8px;
  --r-md:   10px;
  --r:      12px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-pill: 999px;

  /* ---- elevation -------------------------------------------------- */
  --sh-0:   0 0 0 1px rgba(13,13,34,.05);
  --sh-1:   0 1px 2px rgba(13,13,34,.05), 0 1px 3px rgba(13,13,34,.04);
  --sh-2:   0 2px 6px rgba(13,13,34,.05), 0 8px 24px rgba(13,13,34,.07);
  --sh-3:   0 4px 12px rgba(13,13,34,.07), 0 18px 48px rgba(13,13,34,.15);
  --sh-glow-orange: 0 0 0 3px rgba(232,80,15,.18);
  --sh-glow-navy:   0 0 0 3px rgba(59,58,160,.18);
  --ring:   0 0 0 3px rgba(42,84,174,.38);   /* keyboard focus */

  /* ---- motion ----------------------------------------------------- */
  --ease:    cubic-bezier(.4, 0, .2, 1);
  --spring:  cubic-bezier(.16, 1, .3, 1);
  --fast:    .14s var(--ease);
  --med:     .22s var(--ease);
  --slide:   .28s var(--spring);

  /* ---- typography -------------------------------------------------
     One family carries headings, buttons, labels and body — product UI
     does not need a display/body pairing. Numbers, IDs and table cells
     use the mono for tabular alignment.                               */
  --font:      "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --mono:      var(--font-data);

  /* ---- type scale (fixed rem, ~1.15 ratio) -------------------------
     Fixed, not fluid: product UI is viewed at consistent DPI and a
     clamp()-sized heading that shrinks inside a sidebar looks worse.  */
  --fs-3xs: .625rem;    /* 10px — micro labels                       */
  --fs-2xs: .6875rem;   /* 11px — eyebrows, chips                    */
  --fs-xs:  .75rem;     /* 12px — meta, notes                        */
  --fs-sm:  .8125rem;   /* 13px — dense UI, table cells              */
  --fs-md:  .875rem;    /* 14px — base body                          */
  --fs-lg:  1rem;       /* 16px — card titles                        */
  --fs-xl:  1.1875rem;  /* 19px — section titles                     */
  --fs-2xl: 1.4375rem;  /* 23px — page titles                        */
  --fs-3xl: 1.75rem;    /* 28px — stat values                        */
  --fs-4xl: 2.375rem;   /* 38px — hero metrics                       */
  --fs-5xl: 3.25rem;    /* 52px — the one dominant number            */

  --lh-tight:  1.1;
  --lh-snug:   1.28;
  --lh-normal: 1.5;
  --lh-loose:  1.62;

  --tr-tight:  -.015em;   /* tracking for large type                 */
  --tr-normal: 0;
  --tr-wide:   .04em;     /* small caps / eyebrows                   */
  --tr-wider:  .08em;

  /* ---- spacing scale ---------------------------------------------- */
  --s-0:  0;
  --s-1:  2px;
  --s-2:  4px;
  --s-3:  6px;
  --s-4:  8px;
  --s-5:  12px;
  --s-6:  16px;
  --s-7:  20px;
  --s-8:  24px;
  --s-9:  32px;
  --s-10: 40px;
  --s-11: 56px;
  --s-12: 72px;

  /* ---- z-index scale ----------------------------------------------- */
  --z-base:     0;
  --z-sticky:   2;    /* sticky table headers                         */
  --z-header:   10;   /* sticky page header                           */
  --z-sidebar:  30;
  --z-overlay:  60;   /* drilldown panel, modals                      */
  --z-palette:  80;   /* Ctrl+K                                       */
  --z-toast:    90;
}

/* ============================================================
   Dark — the primary theme. <html data-theme="dark">
   Navy driven to near-black. Three planes, hairlines, one signal.
   ============================================================ */
[data-theme="dark"] {
  /* brand tint reads as light on a dark ground; never used as a
     background here — the sidebar has its own --sb-* plane */
  --navy:        #B9B8FF;
  --navy-800:    #12112F;
  --navy-700:    #171640;
  --navy-600:    #6E6BE8;
  --navy-500:    #8B89F0;
  --navy-200:    #33325E;
  --navy-100:    #24234A;
  --navy-50:     #1B1A3C;

  --orange:      #FF6B35;
  --orange-600:  #F15A22;
  --orange-700:  #FF8A5C;
  --orange-400:  #FF7A45;
  --orange-100:  #33180C;
  --orange-50:   #241008;

  --ink:         #E9EAF6;
  --ink-2:       #A7ACC6;
  --ink-3:       #838AA6;
  --ink-4:       #5E6480;
  --line:        #23233E;
  --line-2:      #1A1A30;
  --bg:          #08080F;   /* plane 0 — the ground                  */
  --bg-2:        #0B0B16;   /* sunken                                */
  --surface:     #101021;   /* plane 1 — cards                       */
  --surface-2:   #17172C;   /* plane 2 — table head / inset          */
  --surface-3:   #1E1E38;   /* deepest inset                         */

  --sb-bg:       #06060D;
  --sb-bg-2:     #0C0C1A;
  --sb-line:     #1C1C33;
  --sb-ink:      #EDEEF8;
  --sb-ink-2:    #8E94B0;
  --sb-ink-3:    #666C88;

  --good:        #35D07F;   --good-600: #5EE0A0;   --good-bg: #0B2A1D;   --good-line: #16452F;
  --warn:        #E8B44A;   --warn-600: #F0C670;   --warn-bg: #2A2110;   --warn-line: #453718;
  --bad:         #FF6B6B;   --bad-600:  #FF8F8F;   --bad-bg:  #2C1416;   --bad-line:  #472124;
  --info:        #7B95FF;   --info-600: #9BAEFF;   --info-bg: #14182E;   --info-line: #26304F;

  --c-navy:   #5468E8;
  --c-orange: #FF6B35;
  --c-teal:   #17B8C4;
  --c-violet: #8B6FE0;
  --c-amber:  #D99A3C;
  --c-green:  #2FBF7A;
  --c-rose:   #F0605E;
  --c-slate:  #6E7590;
  --c-navy-2: #4D9BFF;
  --grid:     #1C1C32;

  --area-reporting: #7A78F0;
  --area-data:      #2AB8D4;
  --area-work:      #FF6B35;
  --area-reference: #9B87F0;
  --area-guide:     #8189A6;

  --sh-0:   0 0 0 1px rgba(255,255,255,.05);
  --sh-1:   0 1px 3px rgba(0,0,0,.5);
  --sh-2:   0 2px 8px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.45);
  --sh-3:   0 4px 12px rgba(0,0,0,.6), 0 18px 48px rgba(0,0,0,.6);
  --sh-glow-orange: 0 0 0 3px rgba(255,107,53,.22);
  --sh-glow-navy:   0 0 0 3px rgba(110,107,232,.24);
  --ring:   0 0 0 3px rgba(123,149,255,.5);
}

html { transition: background-color var(--med), color var(--med); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
