/* Izma Office design tokens - light.

   Every component in this app consumes these custom properties and never a literal colour, so a
   new theme is a data change rather than a rewrite. tokens.dark.css redefines exactly the same
   names; anything defined only here is deliberately theme-invariant. */

/* ---- Theme-invariant tiers ---------------------------------------------------------------- */
/* "Chrome" is the app frame - the top bar and the two rails that hang off it. It stays dark in
   light mode too: the frame reads as machinery around the document, and keeping it fixed means the
   shell does not restyle itself under the user twice a day. Never use these for page content;
   page content uses the canvas and fg tiers below. */
:root {
  --color-chrome-bg: #08141c;
  --color-chrome-bg-raised: #10222e;
  --color-chrome-bg-hover: #1b3444;
  --color-chrome-fg: #f2f7fa;
  --color-chrome-fg-muted: #8fa8b8;
  --color-chrome-fg-subtle: #6a8496;
  --color-chrome-border: #24404f;

  /* Brand mark. Teal on dark chrome only - as text on white it fails contrast, so page content
     uses the accent tier instead. Teal is never a status colour anywhere in this app: accounting
     screens need red and green to mean exactly one thing each. */
  --color-brand-emphasis: #2ec4b6;
  --color-brand-fg: #04201d;

  /* A tight display face for table headers, KPI numerals and section labels; mono for every figure
     that has to line up in a column. No webfonts - this ships in a container that may never reach
     a CDN, so these are stacks of faces already present on a Windows or Mac workstation. */
  --font-display: "Inter Tight", "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing and radii, so density is tuned in one place rather than per component. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;
}

:root,
[data-theme="light"] {
  color-scheme: light;

  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f5f8fa;
  --color-canvas-inset: #eef3f6;
  --color-canvas-overlay: #ffffff;

  --color-border-default: #cfd9e0;
  --color-border-muted: #dde5ea;
  --color-border-strong: #adbcc7;

  --color-fg-default: #16232b;
  --color-fg-muted: #5b6b76;
  --color-fg-subtle: #78868f;
  --color-fg-on-emphasis: #ffffff;

  --color-accent-fg: #0b6e7f;
  --color-accent-emphasis: #0a7c8f;
  --color-accent-subtle: #ddf3f5;
  --color-accent-muted: rgba(46, 196, 182, 0.42);

  --color-success-fg: #1a7f47;
  --color-success-emphasis: #1f9d57;
  --color-success-subtle: #dcf7e6;

  --color-attention-fg: #8a5a00;
  --color-attention-emphasis: #b07500;
  --color-attention-subtle: #fdf3d2;

  --color-danger-fg: #c32b30;
  --color-danger-emphasis: #cf2f34;
  --color-danger-subtle: #fdeaea;

  --color-neutral-emphasis: #6b7b86;
  --color-neutral-subtle: #e9eef2;

  /* ---- Data grid tier ---------------------------------------------------------------------- */
  /* Split out from the canvas tier because a grid runs denser and higher-contrast than the rest of
     the page - a header that reads as "subtle" in a card is invisible above twelve columns of
     figures. */
  --color-table-header-bg: #e3eaef;
  --color-table-header-fg: #31444f;
  --color-table-zebra: #fafcfd;
  --color-table-foot-bg: #e3eaef;
  --color-table-grid: #e6ecf0;
  --color-table-row-selected: #ddf3f5;

  --shadow-resting-xs: 0 1px 0 rgba(22, 35, 43, 0.04);
  --shadow-resting-sm: 0 3px 6px rgba(105, 122, 134, 0.15);
  --shadow-overlay: 0 8px 24px rgba(105, 122, 134, 0.22);

  /* ---- Domain tokens ----------------------------------------------------------------------- */
  /* Flip automatically with the base tier above. These exist so that "overdue" means one colour
     everywhere - a badge, an aging cell and a dashboard tile cannot drift apart. */

  /* Document lifecycle. Draft is deliberately neutral: an unposted document has no ledger
     consequence yet, and colouring it would imply otherwise. */
  --color-status-draft: var(--color-neutral-emphasis);
  --color-status-draft-subtle: var(--color-neutral-subtle);
  --color-status-posted: var(--color-accent-emphasis);
  --color-status-posted-subtle: var(--color-accent-subtle);
  --color-status-settled: var(--color-success-emphasis);
  --color-status-settled-subtle: var(--color-success-subtle);
  --color-status-pending: var(--color-attention-emphasis);
  --color-status-pending-subtle: var(--color-attention-subtle);
  --color-status-overdue: var(--color-danger-emphasis);
  --color-status-overdue-subtle: var(--color-danger-subtle);
  --color-status-void: var(--color-fg-subtle);
  --color-status-void-subtle: var(--color-canvas-inset);

  /* Money. Negative figures are the only ones that get a colour - painting every positive number
     green turns a ledger into a christmas tree and hides the one line that matters. */
  --color-money-negative: var(--color-danger-fg);
  --color-variance-favourable: var(--color-success-fg);
  --color-variance-adverse: var(--color-danger-fg);

  /* Aging heat ramp, current through 90+. Used by both aging reports and the dunning worklist. */
  --color-aging-0: transparent;
  --color-aging-1: #fdf7e3;
  --color-aging-2: #fdeecd;
  --color-aging-3: #fce0d3;
  --color-aging-4: #fbd5d5;
}
