/* =====================================================================
   FBM Design System — tokens v2.0  (2026-11-10)
   LIGHT IS THE DEFAULT AND ONLY AUTOMATIC THEME.
   Dark applies ONLY when <html data-theme="dark"> is set explicitly.
   No prefers-color-scheme switching — pages must look the same on every machine.
   Every hex in the system lives here. Components use var(--…) only.
   ===================================================================== */
:root {
  color-scheme: light;

  /* ---- Brand ---- */
  --brand-navy:      #021c36;  /* ink, sidebar base */
  --brand-navy-2:    #0b2a4a;  /* sidebar surface */
  --brand-navy-3:    #143d69;  /* logo navy, sidebar active item */
  --brand-amber:     #ffb03a;  /* accent: header rule, primary CTA fill, active rail, badges */
  --brand-amber-hover:#f5a11f;
  --brand-amber-soft:#fff3df;  /* amber-tinted chips (client context pill) */
  --brand-amber-ink: #8a5a00;  /* amber-family text on light (AA) */

  /* ---- Surfaces ---- */
  --bg:          #f4f6f9;  /* page canvas */
  --surface:     #ffffff;  /* cards, top bar, controls */
  --surface-2:   #f2f5f9;  /* wells, table header, segmented track, hover */
  --surface-3:   #e9eef4;  /* pressed, progress track */
  --border:      #e3e8ef;  /* card + divider */
  --border-strong:#cfd7e2; /* control border */
  --overlay:     rgba(2,28,54,.40);

  /* ---- Text ---- */
  --ink:    #0f1f33;  /* primary text (navy-black) */
  --ink-2:  #516176;  /* secondary, labels, subtitles */
  --ink-3:  #627185;  /* tertiary, axis ticks, placeholders — 5.0:1 on white, 4.6:1 on --bg (AA) */
  --ink-inverse: #ffffff;

  /* ---- Sidebar (always navy, both themes) ---- */
  --nav-bg:        #0b2a4a;
  --nav-surface:   #10335a;  /* grouped section panel */
  --nav-active:    #1a4373;
  --nav-text:      #d6e2ef;
  --nav-text-dim:  #8fa6c0;
  --nav-section:   #ffb03a;  /* section labels: MARKETING / SALES */

  /* ---- Status (always icon + label + color) ---- */
  --good:  #12805c;  --good-bg:  #e2f4ec;
  --warn:  #a35d00;  --warn-bg:  #fff1db;
  --info:  #1d5fa8;  --info-bg:  #e6effa;
  --neutral:#56657a; --neutral-bg:#edf0f4;   /* negative movement uses NEUTRAL, never red */
  --danger:#c2372b;  --danger-bg:#fdecea;    /* RED = destructive actions only */

  /* ---- Categorical data series (portal palette; order is fixed) ---- */
  --s1: #1f6fd1;  /* blue   — primary / organic */
  --s2: #f2941f;  /* orange — paid search */
  --s3: #14a37a;  /* green  */
  --s4: #5a3fa6;  /* purple */
  --s5: #b3367a;  /* berry  (was gold — failed ΔE vs orange) */
  --s6: #2a9bb7;  /* teal   */
  --s-muted: #a6b2c2;  /* prior period / baseline / other */
  --s1-soft: #dbe8f8;  /* area fills under sparklines/lines use the soft tint */

  /* ---- Typography ---- */
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --fs-11: 11px;  /* overlines, axis ticks */
  --fs-12: 12px;  /* captions, pills, table headers */
  --fs-13: 13px;  /* body small, controls, table body */
  --fs-14: 14px;  /* body */
  --fs-16: 16px;  /* card title */
  --fs-18: 18px;  /* page title (top bar) */
  --fs-22: 22px;  /* section title */
  --fs-28: 28px;  /* KPI value */
  --fs-34: 34px;  /* ring / hero number */
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --lh-tight: 1.2; --lh: 1.5;

  /* ---- Spacing (4px grid) ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --card-pad: 20px;
  --gap: 16px;          /* gap between cards */
  --gutter: 24px;       /* page side padding (desktop) */

  /* ---- Control sizing — every control in one row shares a height ---- */
  --ctl-sm: 28px;  --ctl-md: 36px;  --ctl-lg: 44px;
  --ctl-pad-x: 12px;
  --icon-sm: 14px; --icon-md: 16px; --icon-lg: 20px;

  /* ---- Shape & elevation ---- */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(15,31,51,.05);
  --shadow-2: 0 1px 3px rgba(15,31,51,.06), 0 4px 12px rgba(15,31,51,.05);
  --shadow-pop: 0 12px 32px rgba(15,31,51,.18);
  --shadow-inset: inset 0 1px 2px rgba(15,31,51,.06);  /* selector wells (picker, segmented track) */
  --focus: 0 0 0 3px rgba(255,176,58,.45);

  /* ---- Layout ---- */
  --sidebar-w: 244px; --sidebar-w-collapsed: 72px;
  --topbar-h: 64px; --rule-h: 3px;
  --content-max: 1600px;
  --report-max: 1200px;
  --gutter-sm: 16px;      /* page side padding (mobile) */
  --sidebar-canvas: var(--brand-navy);  /* sidebar base; panels use --nav-bg */

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2,.8,.2,1); --dur-1: 120ms; --dur-2: 200ms; --dur-3: 300ms;
  --ease-spring: cubic-bezier(.34,1.36,.64,1);
}

/* Explicit opt-in dark theme. Sidebar + top bar logo area keep their look. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1522; --surface: #111f2f; --surface-2: #17283b; --surface-3: #1e3248;
  --border: #22364c; --border-strong: #31495f;
  --ink: #e7edf4; --ink-2: #a8b6c6; --ink-3: #8193a8;
  --brand-amber-soft: #3a2a10; --brand-amber-ink: #ffcf85;
  --good: #4cc390; --good-bg: #12352a; --warn: #f2b453; --warn-bg: #3a2a10;
  --info: #7fb2ea; --info-bg: #14304d; --neutral: #a5b1bf; --neutral-bg: #1f2c3a;
  --danger: #f0786b; --danger-bg: #3e1d1a;
  --s1: #4d8fe0; --s2: #f2a347; --s3: #34bf94; --s4: #8b72d6; --s5: #d65a9c; --s6: #4db6cf;
  --s-muted: #5b6c80; --s1-soft: #19365a;
  --shadow-1: none; --shadow-2: 0 1px 2px rgba(0,0,0,.4); --shadow-inset: inset 0 1px 2px rgba(0,0,0,.25);
}
