/* ============================================================
   Portal design tokens (HQU-1593)
   --------------------------------------------------------------
   Ported from the AuditTrace portal's hque-tokens.css, trimmed to
   what this portal uses. ONE light palette, no dark counterpart.
   Mirrored in C# at Components/Layout/PortalTheme.cs for MudBlazor,
   which types palette properties as MudColor and will not accept
   var(--…) strings — change both together.

   The arrangement, which is the reverse of the blue-appbar-and-
   grey-drawer this replaced:
     --canvas-subtle  #F1F4F1  the PAPER the panes sit on
     --canvas-default #FFFFFF  RAISED surfaces: nav, topbar, cards
     --canvas-inset   #E9EDEA  wells and hovers
     --fg-default     #16211D  INK — text, and every structural
                               emphasis (active nav row, primary
                               button). The brand accent is kept for
                               links and focused fields only.
   ============================================================ */

:root {
    /* --- Canvas / surfaces --- */
    --canvas-default: #FFFFFF;
    --canvas-subtle: #F1F4F1;
    --canvas-inset: #E9EDEA;
    --canvas-overlay: #FFFFFF;
    /* Alternate table rows: half a step off white, so a striped row never
       reads as the paper-tinted header label row (HQU-1606). */
    --canvas-stripe: #F8FAF8;

    /* --- Borders ---
       -muted is the LIGHTER of the two. Inputs carry a heavier rule than any
       divider, so an editable field announces itself before it is focused. */
    --border-default: #D3DAD5;
    --border-muted: #E4E9E5;
    --border-input: #A9B6AF;

    /* --- Foreground / text ---
       --fg-subtle is the darkest grey that still clears 4.5:1 on the paper. */
    --fg-default: #16211D;
    --fg-muted: #47574F;
    --fg-subtle: #627268;
    --fg-on-emphasis: #FFFFFF;

    /* --- Accent: links, focused fields, selection. Not the primary button. --- */
    --accent-fg: #2563EB;
    --accent-subtle: #DDEBFE;

    /* --- Emphasis (structural, non-brand): active nav row, primary button,
       the brand mark. "You are here" and "do this" are ink, not blue. --- */
    --emphasis-bg: var(--fg-default);
    --emphasis-bg-hover: #0B120F;
    --emphasis-fg: #FFFFFF;

    /* --- Semantic --- */
    --success-fg: #12603B;
    --success-subtle: #DCEBE1;
    --attention-fg: #A93B08;
    --attention-subtle: #FCE9DD;
    --danger-fg: #A31212;
    --danger-subtle: #FBE4E2;
    --info-fg: #0E5A66;
    --info-subtle: #DDEEF0;
    --done-fg: #6B3F86;
    --done-subtle: #F1E9F6;

    --neutral-subtle: #E5EAE7;
    --neutral-muted: rgba(110, 127, 119, 0.16);

    /* The one background a hoverable surface moves to — one step below the
       paper, so a row inside a white card still visibly hovers. */
    --hover-bg: var(--canvas-inset);

    /* --- Type ---
       Public Sans for running text, Archivo for display (see fonts.css).
       Both carry a system fallback so a failed font load degrades rather
       than reflowing into Times. */
    --font-sans: 'Public Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-display: 'Archivo', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    --display-tracking: -0.012em;

    /* Nothing is set below 13px. */
    --text-xs: 13px;
    --text-sm: 13px;
    --text-md: 14px;   /* body baseline, matches Typography.Default */
    --text-15: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 22px;
    --text-4xl: 26px;
    --text-6xl: 32px;

    /* --- Radii — the only ones in the app. --- */
    --radius-xs: 4px;    /* badges, tags */
    --radius-sm: 6px;    /* controls: inputs, buttons, chips, nav rows */
    --radius-md: 10px;   /* cards, list rows, menus */
    --radius-lg: 8px;    /* panels, dialogs — squarer than a card, on purpose */
    --radius-xl: 14px;   /* hero cards: the sign-in card */
    --radius-pill: 999px;

    /* --- Shell --- */
    --nav-w: 250px;
    --topbar-height: 52px;
    /* The reading column inside the pane. The chrome is full-bleed; a data row
       whose two ends are 1600px apart cannot be read across, so the page is not. */
    --page-max: 1200px;
    --nav-slide-dur: 200ms;
    --nav-slide-ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows are tinted with the ink — a grey shadow on the paper reads as dirt.
       Surfaces carry 1px borders, not shadows; these are for things that float. */
    --shadow-floating: 0 8px 24px rgba(22, 33, 29, 0.14);
    --shadow-dialog: 0 20px 50px rgba(22, 33, 29, 0.28);
    --scrim: rgba(22, 33, 29, 0.45);

    /* --- Status tones: one .tone-* class carries fg + bg (see mud-overrides.css). --- */
    --tone-neutral-fg: #55665F;  --tone-neutral-bg: var(--neutral-subtle);
    --tone-info-fg: var(--info-fg);       --tone-info-bg: var(--info-subtle);
    --tone-success-fg: var(--success-fg); --tone-success-bg: var(--success-subtle);
    --tone-warning-fg: var(--attention-fg); --tone-warning-bg: var(--attention-subtle);
    --tone-danger-fg: var(--danger-fg);   --tone-danger-bg: var(--danger-subtle);
    --tone-done-fg: var(--done-fg);       --tone-done-bg: var(--done-subtle);
    --tone-success-border: #BCD6C6;
}

@media (prefers-reduced-motion: reduce) {
    :root { --nav-slide-dur: 0s; }
}
