/* Design tokens — the single source of colour, type, radius, shadow and focus.
 *
 * Layer 1 (this file): CSS custom properties. Colour values are space-separated
 * RGB channels so Tailwind can apply opacity: rgb(var(--primary-700) / 0.5).
 * Layer 2: components/app/tailwind_config.html maps Tailwind colour names onto
 * these variables (primary, success, warning, danger, info, surface, line, fg).
 * Layer 3: ui-* component classes (components/app/head.html) use only layer 2.
 *
 * Rebrand: override --primary-* (see components/app/brand_style.html, driven by
 * settings.BRAND_PRIMARY_SCALE). Never hard-code hex values in templates.
 * Docs: docs/ui/README.md, docs/ui/design-audit.md.
 */
:root {
  /* Primary (brand) — default: engineering teal. 700 is the action colour. */
  --primary-50: 235 246 244;
  --primary-100: 214 237 233;
  --primary-200: 174 219 213;
  --primary-300: 130 200 192;
  --primary-400: 79 170 160;
  --primary-500: 38 144 135;
  --primary-600: 14 124 116;
  --primary-700: 8 107 104;
  --primary-800: 8 83 82;
  --primary-900: 17 62 65;

  /* Mineral surfaces and graphite text. */
  --surface-page: 245 246 244;
  --surface-card: 255 255 255;
  --surface-sunken: 237 240 238;
  --line-default: 216 223 221;
  --line-strong: 178 190 188;
  --fg-default: 23 37 45;
  --fg-muted: 73 90 99;           /* secondary text */
  --fg-subtle: 83 100 108;        /* supporting text */
  --fg-disabled: 124 140 145;      /* disabled controls and decorative icons */
  --fg-on-primary: 255 255 255;

  /* Status: bg (tint), fg (text on tint and on white, >=4.5:1), line (border). */
  --success-bg: 236 253 245;  --success-fg: 4 120 87;    --success-line: 167 243 208;
  --warning-bg: 255 251 235;  --warning-fg: 180 83 9;    --warning-line: 253 230 138;
  --danger-bg: 254 242 242;   --danger-fg: 185 28 28;    --danger-line: 254 202 202;
  --info-bg: 235 246 244;     --info-fg: 8 107 104;      --info-line: 174 219 213;

  /* Chart series (one palette for every report). Values are RGB channels like the rest. */
  --chart-1: var(--primary-700);
  --chart-2: 5 150 105;
  --chart-3: 217 119 6;
  --chart-4: var(--primary-400);
  --chart-5: 83 100 108;
  --chart-muted: 124 140 145;   /* "unapproved" / remainder */

  /* Shape and depth. */
  --radius-sm: 4px;    /* inputs, buttons, badges-square */
  --radius-md: 4px;    /* menus, small cards */
  --radius-lg: 6px;   /* cards, modals */
  --shadow-card: none;
  --shadow-overlay: 0 20px 25px -5px rgb(23 37 45 / 0.15), 0 4px 10px -4px rgb(23 37 45 / 0.1);

  --shell-bg: 23 37 45;
  --shell-muted: 183 201 204;
  --shell-line: 57 76 83;
  --accent-light: 158 228 215;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Type and focus. */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --control-h: 2.5rem;      /* 40px */
  --control-h-sm: 2rem;     /* 32px */
  --focus-ring: 0 0 0 2px rgb(255 255 255), 0 0 0 4px rgb(var(--primary-700));
}

html, body {
  font-family: var(--font-sans);
  background-color: rgb(var(--surface-page));
  color: rgb(var(--fg-default));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
