/*
 * Beam CSS variables — colour.
 *
 * VARIABLES ONLY. No selector in this file renders or overrides anything; it
 * declares custom properties and nothing else. That is the contract the name
 * carries, and css_foundation_test.clj enforces it.
 *
 * This is one of three, split by domain on 23 September 2026 because the single
 * file it came from was called tokens.css and "token" means four different
 * things in this repo — the anti-forgery token on every form POST, the preview
 * and API auth tokens, this, and @beam/input-ui/tokens.css which the islands
 * import and which is a different file entirely. Same values, same names,
 * findable by what they are:
 *
 *   vars-colour.css   surfaces, text, borders, --status-*, charts, scrim
 *   vars-layout.css   spacing, drawer and globals widths, z-index
 *   vars-control.css  radii, control heights and padding, component sizing
 *
 * THE TYPE SCALE IS NOT HERE and never was. resources/styleguide.css owns
 * --headings-large-* and --body-*, and specs/presentation.allium
 * (TypographyPresentation) is its behavioural contract. Brand ramps
 * (--primary-*, --secondary-*, --dark-*, --light-*, --alert-*) are owned by
 * resources/tailwind.css. Where sources disagree, styleguide.css is canonical.
 *
 * Names are UNCHANGED by the split: every var() that resolved before resolves
 * now. Only the file a name lives in, and the <link> that pulls it in, moved.
 *
 * Placeholders with no platform precedent, still awaiting ratification:
 * --status-stale-*, --status-changed-*, --status-error-*, --heatmap-*,
 * --tooltip-*, --map-polygon-*, --file-upload-*, --table-status-*, --ag-beam-*.
 *
 * --status-changed-* aliases the warning triple outright, so warning's text
 * #6f5200 is what two of the five states resolve to. CRM 60055 moves the
 * global nav to dark green and the vendor registration sidebar's save
 * indicator draws these states there: `dirty` is unreadable on that ground.
 * Fix the values before that sidebar lands.
 */

:root {
  /* Surfaces and text. Values observed in styleguide.css and site-setup.css. */
  --surface-page: var(--corelight-100); /* styleguide.css --corelight-100 */
  --surface-canvas: #f7f8fb; /* site-setup.css .load-workspace background */
  --surface-panel: var(--corelight-100); /* styleguide.css --corelight-100 */
  --surface-muted: var(--corelight-300); /* styleguide.css --corelight-300 */
  --surface-divider: var(--corelight-500); /* styleguide.css --corelight-500 */
  --text-primary: var(--coredark-700); /* styleguide.css --coredark-700 */
  --text-secondary: #677489; /* site-setup.css modal descriptions */
  --text-inverse: var(--corelight-100); /* styleguide.css --corelight-100 */
  --text-link: #2a578d; /* site-setup.css modal active tab */
  --border-subtle: var(--corelight-500); /* styleguide.css --corelight-500 */
  --border-default: var(--corelight-900); /* styleguide.css --corelight-900 */
  --border-strong: #d8dee8; /* site-setup.css modal/sidebar dividers */

  /* Semantic states. Existing warning chip extracted; other states are placeholders. */
  --status-warning-bg: #fff7d6; /* site-setup.css .modal-dirty-chip background */
  --status-warning-border: #d8a200; /* site-setup.css .modal-dirty-chip border */
  --status-warning-text: #6f5200; /* site-setup.css .modal-dirty-chip color */
  --status-error-bg: #fff1f1; /* new — no platform precedent */
  --status-error-border: var(--alert-700); /* = #c03838 */
  --status-error-text: var(--alert-900); /* = #912b2b */
  --status-success-bg: #eefaf6; /* new — no platform precedent */
  --status-success-border: var(--battery-charged); /* styleguide.css; 3.54:1 on the bg, passes the 3:1 a border needs */
  --status-success-text: var(--primary-500); /* 6.22:1 on the bg. NOT battery-charged, which is 3.54:1 and fails text's 4.5:1 */
  --status-stale-bg: #f7f8fb; /* site-setup.css .load-workspace background */
  --status-stale-border: var(--corelight-900); /* styleguide.css */
  --status-stale-text: var(--coredark-100); /* styleguide.css */
  --status-changed-bg: var(--status-warning-bg); /* current dirty-chip idiom */
  --status-changed-border: var(--status-warning-border); /* current dirty-chip idiom */
  --status-changed-text: var(--status-warning-text); /* current dirty-chip idiom */

  /* Chart aliases. Existing colors alias styleguide energy vars first. */
  --c-load: var(--load); /* styleguide.css */
  --c-grid: var(--grid-supply-primary); /* styleguide.css */
  --c-grid-secondary: var(--grid-supply-secondary); /* styleguide.css */
  --c-gas: var(--gas-supply); /* styleguide.css */
  --c-solar: var(--solar-consumed); /* styleguide.css */
  --c-solar-export: var(--solar-exported); /* styleguide.css */
  --c-battery-charge: var(--battery-charged); /* styleguide.css */
  --c-battery-discharge: var(--battery-discharged); /* styleguide.css */
  --c-ev: var(--ev); /* styleguide.css */
  --c-generator: var(--generator); /* styleguide.css */
  --c-electrification: var(--electrification); /* styleguide.css */
  --chart-grid-line: var(--corelight-500); /* dashboard.html chart grid #E8EAED */
  --chart-axis: var(--coredark-100); /* styleguide.css muted dark */
  --chart-tooltip-bg: var(--coredark-500); /* styleguide.css */
  --chart-tooltip-text: var(--corelight-100); /* styleguide.css */

  /* Component placeholders with no platform precedent yet. */
  --tooltip-bg: var(--coredark-500); /* new — no platform precedent */
  --tooltip-text: var(--corelight-100); /* new — no platform precedent */
  --heatmap-low: var(--corelight-300); /* new — no platform precedent */
  --heatmap-mid: var(--solar-consumed); /* new — no platform precedent */
  --heatmap-high: var(--solar-exported); /* new — no platform precedent */
  --map-polygon-selected: rgba(42, 87, 141, 0.28); /* new — no platform precedent */
  --map-polygon-hover: rgba(42, 87, 141, 0.16); /* new — no platform precedent */
  --file-upload-progress: var(--energygrid-100); /* new — no platform precedent */
  --file-upload-error-bg: var(--status-error-bg); /* new — no platform precedent */
  --file-upload-error-border: var(--status-error-border); /* new — no platform precedent */
  --table-status-bg: var(--surface-muted); /* new — no platform precedent */
  --table-status-text: var(--text-primary); /* new — no platform precedent */
  --table-progress-fill: var(--energygrid-100); /* new — no platform precedent */
  --table-header-bg: var(--corelight-100); /* shared server/ag-grid header treatment */
  --table-header-fg: var(--coredark-300); /* shared server/ag-grid header treatment */
  --ag-beam-background: var(--surface-panel); /* new — no platform precedent */
  --ag-beam-foreground: var(--text-primary); /* new — no platform precedent */
  --ag-beam-border: var(--border-strong); /* new — no platform precedent */
  --ag-beam-header-bg: #fff; /* both, spelled #fff / #FFFFFF */
  --ag-beam-header-fg: var(--coredark-300); /* both hardcoded #35475C */
  --ag-beam-header-hover-bg: transparent; /* both */
  /* Modal scrim (WP-04, I-08). Value taken from the shipped precedent: the dashboard's
     pv-table and site-total modals use Tailwind `bg-black/40` (dashboard.html:424).
     Added as a token because a scrim is a recurring need and the house rule prefers a token
     over scattering the literal. Before this, `.beam-modal` used `--map-polygon-hover`
     (rgba(42,87,141,.16)) as its backdrop — a 16% hover tint, which is why modals read as
     floating over a fully lit, still-interactive page (S-18). */
  --scrim: rgba(0, 0, 0, 0.4);
}
