/* =====================================================================
   Design tokens
   Layer 1 (palette) and Layer 2 (role aliases) follow the SBA Real Estate
   design-system reference v2.0 verbatim. Additions for the application
   shell (sidebar chrome, chart palette, overlay elevation) are marked NEW.
   Components read role aliases only.
   ===================================================================== */
:root {
  /* Brand */
  --brand-navy: #003a70;
  --brand-gold: #d4a24c;
  --brand-teal: #12b7a8;          /* NEW: teal accent used in both brand marks */
  --brand-gold-text: #8a6520;     /* §10 fix: gold-family tone that passes AA on white */

  /* Neutrals & surfaces */
  --ink: #26364b;
  --slate: #5a6b80;
  --border: #d6dee8;
  --panel: #eaf2fb;
  --surface: #f4f6fa;
  --white: #ffffff;
  --row-divider: #eaf0f6;
  --masthead-meta: #afc4de;

  /* Semantic: text / fill / accent / border */
  --positive-text: #2e5009;  --positive-fill: #e6f0da;  --positive-accent: #3b7d23;  --positive-border: #c7dca9;
  --caution-text: #7a4a0a;   --caution-fill: #fbf1dc;   --caution-accent: #b9791a;   --caution-border: #ead3a0;
  --negative-text: #7a1f1f;  --negative-fill: #fbe3e3;  --negative-accent: #a83232;  --negative-border: #eebebe;
  --info-border: #c3d8f0;

  --button-primary-hover: #002851;
  --nav-bg: rgba(244, 246, 250, 0.92);

  /* Role aliases */
  --text-body: var(--ink);
  --text-strong: var(--brand-navy);
  --text-muted: var(--slate);
  --bg-page: var(--surface);
  --bg-card: var(--white);
  --bg-panel: var(--panel);
  --line: var(--border);
  --line-soft: var(--row-divider);
  --link: var(--brand-navy);
  --link-hover: var(--brand-navy);  /* §10 fix: keep navy, underline on hover */
  --info-text: var(--brand-navy);

  /* NEW: application chrome (left navigation) */
  --chrome-bg: #002851;
  --chrome-bg-raised: #0a3563;
  --chrome-text: #c9d7e8;
  --chrome-text-strong: #ffffff;
  --chrome-muted: #7f9cbd;
  --chrome-line: rgba(255, 255, 255, 0.09);
  --chrome-accent: var(--brand-gold);

  /* NEW: chart palette (navy-led, gold + teal accents) */
  --chart-1: #003a70; --chart-2: #3d7ab8; --chart-3: #12a597; --chart-4: #d4a24c;
  --chart-5: #8fb3d9; --chart-6: #a8781f; --chart-7: #7d8ea3; --chart-8: #c6d4e3;
  --chart-grid: #e6ecf3; --chart-axis: #5a6b80;
  --chart-bench: #9aa8b8;

  /* NEW: elevation for floating layers only (drawers, menus, modals). Content stays flat. */
  --overlay-shadow: 0 18px 48px rgba(10, 26, 47, 0.18), 0 2px 6px rgba(10, 26, 47, 0.08);
  --scrim: rgba(10, 26, 47, 0.38);

  /* Type */
  --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, "Courier New", monospace;

  /* Radius */
  --radius-control: 4px;
  --radius-card: 6px;
  --radius-pill: 999px;

  /* Shell metrics */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  --text-body: #d9e2ec;
  --text-strong: #ffffff;
  --text-muted: #9fb0c3;
  --bg-page: #0b1f33;
  --bg-card: #14304a;
  --bg-panel: #1b3d5c;
  --line: #2a4a68;
  --line-soft: #1f3d59;
  --link: #9cc3e8;
  --link-hover: #9cc3e8;
  --nav-bg: rgba(11, 31, 51, 0.92);
  --info-text: #9cc3e8;
  --brand-gold-text: #e3b96b;

  --positive-text: #a9d18e; --positive-fill: #1c3320; --positive-border: #2e5232; --positive-accent: #6fb04f;
  --caution-text: #e3b96b;  --caution-fill: #3a2c12;  --caution-border: #6b5424;  --caution-accent: #d9a13f;
  --negative-text: #e29a9a; --negative-fill: #3a1d1d; --negative-border: #6b3131; --negative-accent: #d46a6a;
  --info-border: #2a4a68;

  --chrome-bg: #071a2c;
  --chrome-bg-raised: #10304d;
  --chrome-line: rgba(255, 255, 255, 0.07);

  --chart-1: #6fa8dc; --chart-2: #2f6fae; --chart-3: #2cc3b3; --chart-4: #e0b260;
  --chart-5: #a9c8e8; --chart-6: #b8873a; --chart-7: #8ea2b8; --chart-8: #3a5a7a;
  --chart-grid: #21405e; --chart-axis: #9fb0c3; --chart-bench: #7f93a8;

  --overlay-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --scrim: rgba(0, 0, 0, 0.5);
}
