/* ASRT Support Console — design tokens.
 *
 * Identity: "warm ledger". The paper neutrals, the single engineered teal and the
 * tabular mono for every figure are inherited from the IBMS system this console was
 * built on, and they stay.
 *
 * This file went through one redesign and one correction of that redesign, and the
 * correction is the part worth recording. The redesign added what a component gallery
 * has: gradients on the buttons and the rail, a frosted top bar, capsule chips, 20-26px
 * corners, cards that rise off the page when the mouse passes them, a bounce on the
 * switch knob. Every one of those is a decision nobody had to make for this product,
 * which is exactly how it reads on screen — an interface with no opinion about anything
 * except its own softness. What this console is for is being scanned all day by two
 * people who know what every field means, so the surfaces are flat again, the corners
 * stop at 12px, and the only depth left is the two steps that separate a floating layer
 * (a menu, a modal) from the page under it.
 *
 * What survived: the elevation ramp, used sparingly; motion tokens, so a state is
 * defined once; a type scale with one step added; the tabular mono for figures.
 *
 * Every name below is load-bearing: the component layer (ui.css) and nine view
 * modules reference these by name, and ui.css re-maps the older --brand-* / --ink-*
 * / --surface-* aliases onto them. Nothing here is decorative.
 */

:root {
  color-scheme: light;

  /* signature accent — signal orange, still used nowhere as a wash */
  --accent: #f28c28;
  --accent-strong: #bf6a12;
  --accent-soft: rgba(242, 140, 40, 0.10);
  --accent-line: rgba(242, 140, 40, 0.32);
  --accent-ink: #17243b;

  /* cool paper neutrals, navy-tinted rather than warm */
  --bg-canvas: #f4f6fa;
  --bg-surface: #f8f9fc;
  --bg-surface-2: #eef1f6;
  --bg-surface-3: #e3e8f1;
  --bg-raised: #ffffff;
  --bg-inverse: #17243b;
  --bg-input: #ffffff;
  --bg-hover: #e9eaf0;
  --bg-selected: #fdeedd;

  --text-primary: #17243b;
  --text-secondary: #465267;
  --text-muted: #929baa;
  --text-inverse: #f7f9fc;
  --text-link: #b47c32;

  --border-subtle: #e9eaf0;
  --border-strong: #d8dbe3;
  --border-hairline: #eef0f4;
  --border-focus: var(--accent);

  /* semantic — muted, print-like */
  --ok: #1f7a53;
  --ok-bg: #e4f0e8;
  --ok-line: #b6d8c4;
  --warn: #8f5e08;
  --warn-bg: #f7eed8;
  --warn-line: #e3cd9a;
  --bad: #ab2f26;
  --bad-bg: #f7e6e3;
  --bad-line: #e6bab2;
  --info: #2b5f8f;
  --info-bg: #e5ecf3;
  --info-line: #c2d2e1;
  --neutral: #5d6b81;
  --neutral-bg: #eef1f6;
  --neutral-line: #d8dbe3;

  /* status chips — keys follow this console's status vocabulary: tickets,
   * conversations, email jobs, attachments, AI drafts. Only a status that must NOT
   * share its tone's colour needs an entry; app/ui drive the rest from the families. */
  --chip-new: var(--info);
  --chip-new-bg: var(--info-bg);
  --chip-open: var(--accent);
  --chip-open-bg: var(--accent-soft);
  --chip-pending: var(--warn);
  --chip-pending-bg: var(--warn-bg);
  --chip-on-hold: var(--neutral);
  --chip-on-hold-bg: var(--neutral-bg);
  --chip-snoozed: var(--neutral);
  --chip-snoozed-bg: var(--neutral-bg);
  --chip-resolved: var(--ok);
  --chip-resolved-bg: var(--ok-bg);
  --chip-closed: var(--neutral);
  --chip-closed-bg: var(--neutral-bg);
  --chip-urgent: var(--bad);
  --chip-urgent-bg: var(--bad-bg);
  --chip-overdue: var(--bad);
  --chip-overdue-bg: var(--bad-bg);
  --chip-failed: var(--bad);
  --chip-failed-bg: var(--bad-bg);
  --chip-bounced: var(--bad);
  --chip-bounced-bg: var(--bad-bg);
  --chip-sent: var(--ok);
  --chip-sent-bg: var(--ok-bg);
  --chip-discarded: var(--neutral);
  --chip-discarded-bg: var(--neutral-bg);

  /* data viz — accent + neutrals + two signal hues, nothing else */
  --chart-1: #f28c28;
  --chart-2: #5d6b81;
  --chart-3: #ab2f26;
  --chart-4: #8f5e08;
  --chart-5: #2b5f8f;
  --chart-6: #a9b2c0;
  --chart-grid: rgba(23, 36, 59, 0.09);
  --chart-text: #465267;

  /* elevation — the ramp. Two steps are all a console this dense needs: a surface that
   * is raised, and a layer that floats above the page. Warm-tinted rather than grey so a
   * shadow sits on paper instead of floating over it. */
  --shadow-xs: 0 1px 1px rgba(25, 24, 20, 0.05);
  --shadow-sm: 0 1px 2px rgba(25, 24, 20, 0.05), 0 2px 6px -2px rgba(25, 24, 20, 0.10);
  --shadow-md: 0 2px 4px rgba(25, 24, 20, 0.06), 0 8px 18px -6px rgba(25, 24, 20, 0.16);
  --shadow-lg: 0 4px 8px rgba(25, 24, 20, 0.06), 0 14px 32px -8px rgba(25, 24, 20, 0.22);
  --shadow-xl: 0 6px 12px rgba(25, 24, 20, 0.08), 0 22px 48px -12px rgba(25, 24, 20, 0.28);
  --shadow-focus: 0 0 0 3px rgba(13, 122, 99, 0.24);

  /* radii — one scale, used by role rather than by taste. The top of it is where the
   * redesign originally ran away from this console: 20-26px on a card and a modal is what
   * every generated dashboard looks like. Nothing round here is rounder than 12px. */
  --r-xs: 4px;   /* chips, badges, kbd, tiny inline parts */
  --r-sm: 6px;   /* buttons, inputs, menu rows, avatars */
  --r-md: 8px;   /* cards, popovers, media, small panels */
  --r-lg: 9px;   /* modals, sheets, the auth card */
  --r-xl: 12px;  /* the one featured surface, when a screen has one */
  --r-2xl: 14px;
  --r-full: 999px;

  /* spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 11px;
  --s-4: 15px;
  --s-5: 20px;
  --s-6: 28px;
  --s-7: 38px;
  --s-8: 52px;

  /* type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xxs: 10.5px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 15.5px;
  --fs-xl: 19px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-money: 22px;
  --lh-tight: 1.2;
  --tracking-tight: -0.017em;
  --tracking-label: 0.08em;

  /* motion — declared once, so an interaction state is not re-invented per component */
  --dur-1: 0.11s;
  --dur-2: 0.18s;
  --dur-3: 0.3s;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 0.84, 0.28, 1);
  --dur: var(--dur-2);

  /* layout */
  --rail-w: 236px;
  --rail-w-collapsed: 56px;
  --topbar-h: 56px;
  --content-max: 1680px;

  --sidebar-bg: #16150f;
  --sidebar-fg: #b7b0a1;
  --sidebar-fg-active: #fbf9f3;
  --sidebar-line: rgba(247, 245, 240, 0.09);
  --sidebar-hover: rgba(140, 220, 200, 0.09);
  --sidebar-active: rgba(43, 179, 148, 0.16);

  --skeleton: linear-gradient(90deg, #eae7dc 25%, #f5f3ea 37%, #eae7dc 63%);
  --overlay: rgba(23, 22, 18, 0.42);
  --paper-grid: rgba(25, 24, 20, 0.05);
  --accent-on-dark: #f2a44e;

  /* legacy aliases — components reference the accent through these */
  --brand-teal: var(--accent);
  --brand-teal-strong: var(--accent-strong);
  --brand-navy: var(--bg-inverse);
  --brand-ink: #262319;
  --brand-steel: var(--info);
  --brand-amber: var(--warn);
  --brand-orange: var(--warn);
}

[data-theme="dark"] {
  color-scheme: dark;

  --accent: #f2a44e;
  --accent-strong: #f28c28;
  --accent-soft: rgba(242, 164, 78, 0.16);
  --accent-line: rgba(242, 164, 78, 0.38);
  --accent-ink: #17243b;

  --bg-canvas: #111c30;
  --bg-surface: #17243b;
  --bg-surface-2: #1c2a45;
  --bg-surface-3: #223350;
  --bg-raised: #1f2d48;
  --bg-inverse: #f4f6fa;
  --bg-input: #131f36;
  --bg-hover: #223350;
  --bg-selected: #3a2a15;

  --text-primary: #e8eefb;
  --text-secondary: #b3bdd0;
  --text-muted: #8b98b0;
  --text-inverse: #111c30;
  --text-link: #e5b36b;

  --border-subtle: #22314d;
  --border-strong: #2e4062;
  --border-hairline: #1c2740;

  --ok: #56c995;
  --ok-bg: rgba(86, 201, 149, 0.14);
  --ok-line: rgba(86, 201, 149, 0.34);
  --warn: #e0b45c;
  --warn-bg: rgba(224, 180, 92, 0.14);
  --warn-line: rgba(224, 180, 92, 0.34);
  --bad: #ea8377;
  --bad-bg: rgba(234, 131, 119, 0.14);
  --bad-line: rgba(234, 131, 119, 0.34);
  --info: #8fbde8;
  --info-bg: rgba(143, 189, 232, 0.14);
  --info-line: rgba(143, 189, 232, 0.34);
  --neutral: #8b98b0;
  --neutral-bg: rgba(139, 152, 176, 0.14);
  --neutral-line: rgba(139, 152, 176, 0.32);

  --chart-1: #f2a44e;
  --chart-2: #b3bdd0;
  --chart-3: #ea8377;
  --chart-4: #e0b45c;
  --chart-5: #8fbde8;
  --chart-6: #5d6b81;
  --chart-grid: rgba(232, 238, 251, 0.09);
  --chart-text: #b3bdd0;

  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 8px 20px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4), 0 18px 40px -10px rgba(0, 0, 0, 0.66);
  --shadow-xl: 0 6px 12px rgba(0, 0, 0, 0.45), 0 22px 48px -12px rgba(0, 0, 0, 0.7);
  --shadow-focus: 0 0 0 3px rgba(53, 201, 165, 0.32);

  --sidebar-bg: #0c0d0b;
  --sidebar-fg: #a29c8f;
  --sidebar-hover: rgba(53, 201, 165, 0.1);
  --sidebar-active: rgba(53, 201, 165, 0.18);

  --skeleton: linear-gradient(90deg, #1f2220 25%, #282c29 37%, #1f2220 63%);
  --overlay: rgba(4, 5, 4, 0.66);
  --paper-grid: rgba(235, 233, 225, 0.05);
  --accent-on-dark: #f2a44e;

  --brand-teal: var(--accent);
  --brand-teal-strong: var(--accent-strong);
  --brand-navy: var(--bg-inverse);
  --brand-ink: #262319;
  --brand-steel: var(--info);
  --brand-amber: var(--warn);
  --brand-orange: var(--warn);
}

/* The elevation ramp and the lift are the whole redesign; a surface that animates
 * itself into place on a phone mid-scroll is not. Everything motion-shaped is
 * switched off here and the states still read, because they are colour and shadow. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0.01ms; --dur-2: 0.01ms; --dur-3: 0.01ms; --dur: 0.01ms; }
}
