/* ============================================================================
   QUARTZ DESIGN TOKENS  (design 03 "Quartz", scheme B "Indigo")
   ----------------------------------------------------------------------------
   Single source of truth for every color/font/measure in the Quartz re-skin.
   Token names keep the kv- prefix: they are MACHINERY shared with views,
   page CSS, and tests — not Kavalier branding (see QUARTZ-REDESIGN-PLAN §1.2).

   Rollback story: every consumer uses var(--kv-token, legacyFallback).
   Removing this stylesheet (and quartz.css) restores the legacy look.
   Never hard-code a theme color outside this file; new colors = new token.
   ============================================================================ */

/* --- Self-hosted DM Sans (variable font, weights 100-1000; NO CDN) -------- */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('../fonts/DMSans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('../fonts/DMSans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-weight: 100 1000;
    font-display: swap;
    src: url('../fonts/DMSans-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-weight: 100 1000;
    font-display: swap;
    src: url('../fonts/DMSans-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- rem re-base ------------------------------------------------------------
   Bootstrap 3 sets html { font-size: 10px }. All rem values in the Quartz
   theme (and Kendo 2025) assume a 16px base. This file only loads when the
   theme is on, so the re-base ships and rolls back with the theme. */
html {
    font-size: 16px;
}

/* Kendo 2025 (classic-opal) palette remap — the vendor theme is variable-
   driven and built on the legacy blue family (#003f59 text, #def4fd
   surfaces, #bacdd5 borders, #7bd2f6 primary). Redefining its tokens here
   re-skins every widget at the source; selector-level overrides in
   OverridesForKendoStyles.css refine on top. */
body.kv {
    --kendo-color-app-surface: var(--kv-card);
    --kendo-color-on-app-surface: var(--kv-ink);
    --kendo-color-on-base: var(--kv-ink);
    --kendo-color-base-on-surface: var(--kv-ink);
    --kendo-color-base-on-subtle: var(--kv-ink);
    --kendo-color-base: var(--kv-field);
    --kendo-color-base-hover: var(--kv-wash);
    --kendo-color-base-active: var(--kv-border);
    --kendo-color-base-emphasis: var(--kv-border-strong);
    --kendo-color-base-subtle: var(--kv-field);
    --kendo-color-base-subtle-hover: var(--kv-wash);
    --kendo-color-base-subtle-active: var(--kv-border);
    --kendo-color-border: var(--kv-border);
    --kendo-color-border-alt: var(--kv-border-strong);
    --kendo-color-surface: var(--kv-field);
    --kendo-color-surface-alt: var(--kv-card);
    --kendo-color-subtle: var(--kv-muted);
    --kendo-color-primary: var(--kv-primary);
    --kendo-color-primary-hover: var(--kv-primary-hover);
    --kendo-color-primary-active: var(--kv-primary-hover);
    --kendo-color-primary-emphasis: var(--kv-primary);
    --kendo-color-primary-subtle: var(--kv-tint);
    --kendo-color-primary-subtle-hover: var(--kv-tint-strong);
    --kendo-color-primary-subtle-active: var(--kv-tint-strong);
    --kendo-color-primary-on-subtle: var(--kv-primary-hover);
    --kendo-color-primary-on-surface: var(--kv-primary);
}

:root {
    /* Kendo 2025 sizes itself in rem against the 16px base above. */
    --kendo-font-size: .875rem;
    --kendo-font-family: 'DM Sans', 'Segoe UI', system-ui, Arial, sans-serif;

    /* --- core surface + ink ----------------------------------------------- */
    --kv-bg: #f7f7f5;            /* cool ground */
    --kv-card: #fff;             /* flat white cards */
    --kv-card-grad: #fff;        /* Quartz cards are flat; token kept for machinery */
    --kv-field: #fafaf8;         /* input / table-head wash */
    --kv-ink: #1a1d23;
    --kv-ink-soft: #3f4654;      /* strong secondary text */
    --kv-ink-rgb: 26, 29, 35;
    --kv-muted: #5f6a80;         /* de-emphasized text — >=4.7:1 on every surface (AA) */
    --kv-faint: #9ca3af;         /* NON-TEXT ornament only (fails 4.5:1) */
    --kv-border: #ebedf2;
    --kv-border-strong: #cbd1dc;
    --kv-border-faint: #f3f4f7;  /* inner hairlines (table cells) */
    --kv-wash: #eef0f4;          /* legacy pale-blue (#d9ecf5) replacement */

    /* --- indigo primary (Quartz scheme B) ----------------------------------- */
    --kv-primary: #4338ca;
    --kv-primary-hover: #3730a3;
    --kv-primary-active: #312e81;  /* indigo-900 — pressed fill, one step past hover */
    --kv-primary-rgb: 67, 56, 202;
    --kv-on-primary: #fff;
    --kv-secondary: #3730a3;
    --kv-secondary-rgb: 55, 48, 163;
    --kv-secondary-text: #fff;
    --kv-accent-display: #4338ca;            /* display accents (employee last name…) */
    --kv-tint: rgba(67, 56, 202, .08);       /* active-state wash */
    --kv-tint-strong: rgba(67, 56, 202, .15);/* active-state border / badge bg */
    --kv-tint-border: rgba(67, 56, 202, .2);
    --kv-grad-brand: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    --kv-grad-btn: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
    /* Hover shifts BOTH stops one step down the indigo scale (800 -> 900) rather
       than flattening to a solid. Flattening to --kv-primary-hover made hover
       nearly invisible: that value IS --kv-grad-btn's end stop, so the bottom
       edge of the button did not change at all. White text stays 9.9:1 / 11.4:1. */
    --kv-grad-btn-hover: linear-gradient(180deg, #3730a3 0%, #312e81 100%);
    --kv-hairline-accent: linear-gradient(90deg, transparent, rgba(67, 56, 202, .4), transparent);

    /* --- status ------------------------------------------------------------- */
    --kv-ok: #047857;            /* success as TEXT (5.5:1 on white) */
    --kv-ok-dot: #10b981;        /* success as ornament (dots, pulses) */
    --kv-ok-wash: rgba(16, 185, 129, .12);
    --kv-warn-text: #92400e;
    --kv-warn-dot: #f59e0b;
    --kv-warn-wash: rgba(245, 158, 11, .1);
    --kv-warn-border: rgba(245, 158, 11, .25);
    --kv-danger: #b91c1c;        /* danger as TEXT (5.9:1 on white) */
    --kv-danger-strong: #991b1b;
    --kv-danger-dot: #dc2626;
    --kv-danger-wash: rgba(220, 38, 38, .08);
    --kv-danger-border: rgba(220, 38, 38, .2);

    /* Shared warning/yield glyph — ONE source for the timesheet, Workers Comp, and
       inspection-log warning icons (consumed via `content: var(--kv-warn-icon)`).
       Bright amber fill for visibility + a dark amber border & exclamation so it
       stays high-contrast on light day-headers, white cards, AND the soft-red error
       pills. Colors are baked into the data URI (a data: URI can't read a CSS var);
       retune the whole app's warning icon by editing this one line. */
    --kv-warn-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z' fill='%23fbbf24' stroke='%23b45309' stroke-width='1.5' stroke-linejoin='round'/><line x1='12' y1='9' x2='12' y2='13' stroke='%2378350f' stroke-width='2.5' stroke-linecap='round'/><line x1='12' y1='17' x2='12.01' y2='17' stroke='%2378350f' stroke-width='2.5' stroke-linecap='round'/></svg>");

    /* --- shape + chrome ------------------------------------------------------ */
    --kv-r-card: 12px;
    --kv-r-panel: 10px;
    --kv-r-ctl: 7px;
    --kv-r-chip: 4px;
    --kv-r-pill: 99px;
    --kv-shadow-card: 0 1px 0 rgba(26, 29, 35, .02), 0 4px 10px -4px rgba(26, 29, 35, .05);
    --kv-shadow-pop: 0 1px 2px rgba(26, 29, 35, .04), 0 8px 24px -4px rgba(26, 29, 35, .08), 0 32px 64px -16px rgba(26, 29, 35, .1);
    --kv-shadow-primary: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 4px 12px -2px rgba(67, 56, 202, .35);

    /* --- layout --------------------------------------------------------------- */
    --kv-side-w: 216px;          /* qz-side width, trimmed for smaller screens */
    --kv-flyout-shift: 0px;

    /* --- type ------------------------------------------------------------------ */
    --kv-font-ui: 'DM Sans', 'Segoe UI', system-ui, Arial, sans-serif;
    --kv-font-display: 'DM Sans', 'Segoe UI', system-ui, Arial, sans-serif; /* Quartz is single-family */
    --kv-font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Segoe UI Mono', monospace;
    --kv-font-num: 'DM Sans', 'Segoe UI', system-ui, Arial, sans-serif;   /* numeric DATA cells (timesheet/TDS grids + totals); was --kv-font-mono. Swap THIS one line to try a different numeric font. */

    /* --- timesheet / TDS error family -------------------------------------------
       Hue semantics preserved from legacy (red=serious, amber=warning,
       green=comp, slate=missing, teal=tds…), re-derived as cool Quartz washes.
       Every value holds >=5:1 against --kv-ink text (verified by script). */
    --kv-err-multiple: #c9ccf5;       /* legacy #ccccff  */
    --kv-err-missing: #c4cede;        /* legacy lightsteelblue */
    --kv-err-comp: #a3e3b8;           /* legacy lime */
    --kv-err-overcharge: #f4b09e;     /* legacy tomato */
    --kv-err-24h: #aed9f4;            /* legacy LightSkyBlue */
    --kv-err-incomplete: #f6c7d5;     /* legacy lightpink */
    --kv-err-mismatch: #f6c386;       /* legacy orange (TimeMismatch/Other) */
    --kv-err-tds: #a4e2de;            /* legacy aqua */
    --kv-err-warn: #f5dd90;           /* legacy yellow (abuse/lateness/payment/tardy) */
    --kv-err-holiday: #fdeef3;        /* legacy #fff0f5 */
    --kv-err-paid: #d9bdf2;           /* legacy violet (AdditionalTimePaid/PaymentOverlap) */
    --kv-err-serious: #f3a6a6;        /* legacy red (WorkersComp/MiscOvercharge) */
    --kv-err-lunch: #f8d4ae;          /* legacy #FFDAB9 */
    --kv-err-perdiem: #d3b3f0;        /* legacy #cc99ff */
    --kv-err-donated: #95dcbb;        /* legacy #18a16f */
    --kv-err-onoffsite: #ecd9a3;      /* legacy #e9c46a */

    /* --- leave-request status fills (desaturated; ink text >=5:1) ----------- */
    --kv-leave-approved: #a5e0c3;     /* legacy green */
    --kv-leave-submitted: #aed9f4;    /* legacy deepskyblue */
    --kv-leave-tentative: #f5dd90;    /* legacy yellow */
}
