/* u4cnext-ui · tokens.css
   All design decisions as CSS variables, in three layers:
   1. base values  2. semantic names  3. dark theme (customer and employee scope)
   plus the white-label variables a reseller may set.
   Components and pages use the semantic names only (layer 2). */

/* ---------- fonts: original releases, WOFF2, not subset (see fonts/README.md) ---------- */
@font-face{font-family:"Archivo";src:url("fonts/Archivo[wdth,wght].woff2") format("woff2-variations"),url("fonts/Archivo[wdth,wght].woff2") format("woff2");font-weight:100 900;font-stretch:62% 125%;font-style:normal;font-display:swap}
@font-face{font-family:"Instrument Sans";src:url("fonts/InstrumentSans[wdth,wght].woff2") format("woff2-variations"),url("fonts/InstrumentSans[wdth,wght].woff2") format("woff2");font-weight:400 700;font-stretch:75% 100%;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("fonts/IBMPlexMono-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("fonts/IBMPlexMono-Medium.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
/* metric-matched fallbacks: no layout shift while the fonts load */
@font-face{font-family:"Archivo Fallback";src:local("Arial"),local("ArialMT"),local("Liberation Sans");size-adjust:102%;ascent-override:86.1%;descent-override:20.6%;line-gap-override:0%}
@font-face{font-family:"Instrument Sans Fallback";src:local("Arial"),local("ArialMT"),local("Liberation Sans");size-adjust:102.2%;ascent-override:94.9%;descent-override:24.5%;line-gap-override:0%}
@font-face{font-family:"Plex Mono Fallback Consolas";src:local("Consolas");size-adjust:109.1%;ascent-override:94%;descent-override:25.2%;line-gap-override:0%}
@font-face{font-family:"Plex Mono Fallback Menlo";src:local("Menlo"),local("Menlo-Regular");size-adjust:99.7%;ascent-override:102.8%;descent-override:27.6%;line-gap-override:0%}

/* ---------- 1. base values ---------- */
:root{
  /* brand palette (style.md v2) */
  --u-ink:#16181D; --u-paper:#FAF9F6; --u-beige:#F1EFEA; --u-deep:#12151B; --u-white:#FFFFFF;
  --u-red:#E12D39; --u-red-bright:#FF4A52; --u-red-dark:#C9252C;
  --u-grey-700:#4A4E55; --u-grey-500:#6B6E75; --u-sand-300:#DEDBD3; --u-sand-200:#E9E6DF; --u-sand-50:#FCFBF9;
  /* status hues (text contrast ≥ 4.5:1 on white) */
  --u-green:#2F6B4F; --u-amber:#A86A00; --u-crimson:#B42318; --u-steel:#3E5C76; --u-slate:#6B6E75;
  /* chart series (validated: lightness band, chroma, colour-blind separation) */
  --u-chart-blue:#1D6FA8; --u-chart-brown:#B4651E;

  /* font families: three only */
  --font-head:"Archivo","Archivo Fallback",Arial,sans-serif;
  --font-body:"Instrument Sans","Instrument Sans Fallback",Arial,sans-serif;
  --font-mono:"IBM Plex Mono","Plex Mono Fallback Consolas","Plex Mono Fallback Menlo",ui-monospace,monospace;

  /* type scale: size / line height / weight */
  --fs-h1:26px;  --lh-h1:1.25;  --fw-h1:700;   /* Archivo */
  --fs-h2:17px;  --lh-h2:1.35;  --fw-h2:600;   /* Archivo */
  --fs-h3:15px;  --lh-h3:1.4; --fw-h3:600;   /* Archivo */
  --fs-kpi:28px; --lh-kpi:1.1; --fw-kpi:600;  /* Archivo, tabular figures */
  --fs-body:15px;--lh-body:1.5;--fw-body:400; /* Instrument Sans */
  --fs-small:13px;--lh-small:1.45;--fw-small:400; /* Instrument Sans */
  --fs-label:12.5px;--lh-label:1.35;--fw-label:600; /* Instrument Sans: labels never in mono */
  --fs-data:12.5px;--lh-data:1.4;--fw-data:400;  /* IBM Plex Mono: data, timestamps, codes */
  --fw-strong:600; --fw-medium:500;
  /* allowed weights — Archivo 600 700 · Instrument Sans 400 500 600 · Plex Mono 400 500 */

  /* spacing (4 px grid) */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px; --sp-12:48px;
  /* radius */
  --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:10px; --r-xl:14px; --r-pill:999px;
  /* line widths */
  --bw:1px; --bw-strong:1.5px; --bw-focus:2px;
  /* breakpoints (for reference in scripts; media queries use the literal values) */
  --bp-phone:760px; --bp-tablet:1100px; --bp-desktop:1280px;
  /* touch target */
  --target-touch:44px;
  /* motion */
  --dur-fast:120ms; --dur:200ms;
}

/* ---------- 2. semantic names ---------- */
:root{
  --text-strong:var(--u-ink);       /* headings, values, primary text on cards */
  --text:var(--u-grey-700);         /* body text */
  --text-muted:var(--u-grey-500);   /* help, small text */
  --text-inverse:var(--u-white);
  --surface-page:var(--u-paper);
  --surface-card:var(--u-white);
  --surface-sunken:var(--u-beige);  /* inset areas, notes, scheduled rows */
  --surface-th:var(--u-sand-50);    /* table header */
  --surface-inverse:var(--u-deep);  /* sidebar, next-step block, code */
  --border:var(--u-sand-300);
  --border-soft:var(--u-sand-200);
  --accent:var(--u-red);            /* max once per screen */
  --accent-strong:var(--u-red-bright); /* primary button, one highlight */
  --accent-hover:var(--u-red-dark);
  --focus-ring:var(--u-ink);
  --error:var(--u-crimson);
  /* status: shape + colour + word, meaning "who has to act" */
  --status-ok:var(--u-green);        /* done */
  --status-turn:var(--u-amber);      /* your move */
  --status-wait:var(--u-crimson);    /* waiting for u4cnext / the provider */
  --status-customer:var(--u-steel);  /* waiting for the customer */
  --status-none:var(--u-slate);      /* not started */
  --surface-light:var(--u-white);   /* stays white in dark theme: light button on an inverse surface */
  --text-on-light:var(--u-ink);      /* stays dark in dark theme: text on --surface-light */
  --text-on-inverse:#C9CBD0; --text-on-inverse-strong:#E6E7EA; --text-on-inverse-muted:#AEB3BB;
  --border-danger:#E3B6B1;
  --highlight:#FFE7A8;               /* search match */
  --switch-off:#CFCCC4;
  --overlay:rgba(18,21,27,.35);     /* behind modal and drawer */
  --border-on-inverse:rgba(255,255,255,.5);
  --chart-1:var(--u-chart-blue);
  --chart-2:var(--u-chart-brown);
  --chart-grid:var(--u-sand-200);
  --chart-text:var(--u-grey-500);
}

/* ---------- 3. dark theme (customer and employee scope only) ---------- */
[data-theme=dark]{
  --surface-page:#0F1216; --surface-card:#171B21; --surface-th:#1B2027; --surface-sunken:#1F252D; --surface-inverse:#0A0C10;
  --text-strong:#ECEDEF; --text:#C9CDD3; --text-muted:#A3A9B2;
  --border:#2E353F; --border-soft:#252B33; --focus-ring:#ECEDEF;
  --status-ok:#3FB37F; --status-turn:#E2A33A; --status-wait:#FF7A70; --status-customer:#8DB4D8; --status-none:#9AA0A8; --error:#FF7A70;
  --chart-grid:#252B33; --chart-text:#A3A9B2;
  --highlight:#6B5313; --switch-off:#4A515C;
}

/* ---------- white label: what a reseller may set ----------
   Only these three. The portal checks the primary colour against white text and
   refuses values below a contrast of 4.5:1 (WCAG AA). Everything else stays u4cnext. */
:root{
  --wl-name:"u4cnext";        /* shown in the brand mark and on documents */
  --wl-logo:none;             /* url(...) of an SVG or PNG, or none */
  --wl-primary:#1F5F8B;       /* buttons and brand mark in the customer and employee scope */
  --wl-on-primary:#FFFFFF;    /* fixed: text on the primary colour */
  --wl-min-contrast:4.5;
}
