/* ============================================================
   FAST -> design-token compatibility shim.

   The app's custom CSS (app.css, dashboard.css, variables-view.css,
   component .razor.css) and many inline Style attributes were
   authored against FluentUI v4 FAST token names. FluentUI v5
   removed those, and the UI was really designed against the
   Colectica design system (see design-tokens.css). This file
   aliases each consumed FAST token onto the corresponding design
   token, so the whole custom UI adopts the design palette and
   flips correctly between light and dark (the design tokens carry
   the theme).

   Load order (index.html): after design-tokens.css, before
   app.css / dashboard.css / variables-view.css.

   IMPORTANT: these aliases are declared on `body`, NOT `:root`. A var() inside a
   custom-property declaration is resolved at the element that declares it, using
   that element's other custom properties. The light theme overrides the surface and
   text tokens on `body` (design-tokens.css), while :root/html always holds the dark
   values. Declaring these aliases on :root would therefore freeze them to the dark
   source values and inherit dark everywhere, so light mode would show dark cards,
   rails, etc. On `body` each var() resolves against body's themed value (its light
   override, or the dark values inherited from :root), so the aliases flip correctly.
   Do not move this block back to :root.

   Do NOT write a token glob like "surface-star-slash" literally in this comment: the
   slash-star sequence would close the comment early and corrupt the rule below.
   ============================================================ */

body {
    /* Surfaces (FAST "layers" -> design surfaces) */
    --neutral-layer-1: var(--surface-app);
    --neutral-layer-2: var(--surface-card);
    --neutral-layer-3: var(--surface-rail);
    --neutral-layer-4: var(--surface-track);
    --neutral-base-color: var(--text-faint);

    /* Foreground text */
    --neutral-foreground-rest: var(--text-secondary);
    --neutral-foreground-hint: var(--text-muted);
    --neutral-foreground-hint-rest: var(--text-muted);

    /* Strokes / dividers */
    --neutral-stroke-rest: var(--border-strong);
    --neutral-stroke-divider-rest: var(--border-subtle);
    --neutral-stroke-strong: var(--border-strong);
    --neutral-stroke-strong-rest: var(--border-strong);

    /* Stealth fills */
    --neutral-fill-stealth-rest: transparent;
    --neutral-fill-stealth-hover: var(--neutral-bg);

    /* Brand / accent */
    --accent-fill-rest: var(--brand-accent);
    --accent-fill-hover: var(--brand-primary-hover);
    --accent-foreground-rest: var(--brand-accent);
    --foreground-on-accent-rest: #ffffff;

    /* App status/semantic tokens (dashboard.css also defines these as
       literals; align them to the design semantics here as a fallback). */
    --status-success: var(--success);
    --status-info: var(--sem-info); /* NOT var(--info): FluentUI v5 injects a gray --info via a constructed stylesheet that wins the cascade. */
    --status-danger: var(--danger);
    --status-warning: var(--warning);
    --status-success-bg: var(--success-bg);
    --status-info-bg: var(--info-bg);
    --status-danger-bg: var(--danger-bg);
    --status-warning-bg: var(--warning-bg);
    --status-neutral-bg: var(--neutral-bg);
}
