/* ============================================================================
   Cascadia Code — SHIPPED webfont (2026-06-11, AppDevGuidance §19.2/§49).
   Previously the font stack relied on locally-installed Cascadia; machines
   without it fell back to Courier New — the "oldschool" look. Variable font
   covers weights 200-700 in one file; cached offline by the service worker.
   ========================================================================== */
@font-face {
    font-family: 'Cascadia Code';
    src: url('fonts/CascadiaCode.woff2') format('woff2');
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================================================
   NM design tokens (2026-06-11, AppDevGuidance §49). Components consume these
   variables — never hex/px literals. Hard floors: no text below 0.7rem
   (--nm-font-small), no interactive target below 24px (--nm-control-h).
   ========================================================================== */
:root {
    /* palette */
    --nm-red: #ED1C24;          /* NACOS red — errors/flags */
    --nm-amber: #f59e0b;        /* soft attention — "did you forget?", non-blocking (vs red errors) */
    --nm-blue: #0d4f8a;         /* primary action blue */
    /* Stage 5 (2026-06-11): grid header + line colors moved from the Excel
       blue-grey pastiche to the Tailwind kit's zinc neutrals so the grids
       match the chrome. ONE-LINE REVERT if the blue is missed:
       --nm-hdr-bg: #D6E4F0;  --nm-border: #b4c6d8; */
    --nm-hdr-bg: #f4f4f5;       /* grid header (was Excel-blue #D6E4F0) */
    --nm-calc-bg: #fafafa;      /* calculated/read-only cells — zinc-50
                                   (tan #EEECE1 retired; revert by setting
                                   #EEECE1 here) */
    --nm-border: #d4d4d8;       /* grid lines, zinc-300 (was blue-grey #b4c6d8) */
    /* typography
       Data surfaces use the kit's sans too — same
       family everywhere; digit alignment is preserved because every data
       surface declares font-variant-numeric: tabular-nums (equal-width
       digits), which Segoe UI supports. The shipped Cascadia Code stays
       available via --nm-font-truemono if real monospace is ever wanted.
       ONE-LINE REVERT: --nm-font-mono: var(--nm-font-truemono); */
    --nm-font-truemono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --nm-font-mono: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --nm-font-grid: 0.8rem;     /* grid body text */
    --nm-font-ui: 0.85rem;      /* chrome: buttons, inputs, pickers */
    --nm-font-small: 0.7rem;    /* FLOOR — badges, sub-labels; nothing smaller */
    /* metrics */
    --nm-control-h: 24px;       /* FLOOR — min height of any interactive target */
    --nm-radius: 4px;
    --nm-sp-1: 2px;
    --nm-sp-2: 4px;
    --nm-sp-3: 8px;

    /* ── Chrome layer (Stage 2, 2026-06-11) — extracted from the licensed
       Tailwind Plus Catalyst kit: zinc neutral scale, hairline rings,
       8/12px radii, soft shadows, sans chrome around the mono grid. */
    --nm-z50: #fafafa;  --nm-z100: #f4f4f5; --nm-z200: #e4e4e7; --nm-z300: #d4d4d8;
    --nm-z400: #a1a1aa; --nm-z500: #71717a; --nm-z600: #52525b; --nm-z700: #3f3f46;
    --nm-z900: #18181b; --nm-z950: #09090b;
    --nm-font-sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --nm-ring: rgba(9, 9, 11, 0.10);          /* Catalyst border-zinc-950/10 */
    --nm-ring-strong: rgba(9, 9, 11, 0.15);
    --nm-radius-lg: 8px;
    --nm-radius-xl: 12px;
    --nm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --nm-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Soft attention pill — a working weekday (Mon–Fri, non-holiday) with zero
   hours entered. Amber, not --nm-red: "did you forget?", not an error, never
   blocks Submit. Used in the per-day date cell of the time-entry forms only
   (autnav/hourly/exempt-times); grid templates legitimately charge zero-work
   days to PTO/holiday columns so they don't carry this. */
.nm-daywarn {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    background: var(--nm-amber);
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Small muted footnote — the single-timezone-per-day assumption, shown above the
   clock-time grids. Quieter than the interim banner. */
.nm-tz-note {
    margin: 0 4px 4px;
    font-size: var(--nm-font-small);
    color: var(--nm-z500);
    font-style: italic;
}

/* Interim banner above the time-entry area (SAP-retirement prefill gap). Amber
   attention, not a red error — informational. */
.nm-interim-note {
    margin: 4px 4px 6px 4px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    color: #1a1a1a;
    background: #fff7ed;            /* amber-50 */
    border: 1px solid var(--nm-amber);
    border-left-width: 4px;
    border-radius: var(--nm-radius);
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--nm-z100);
}

/* Rounded table card (Stage 4, 2026-06-11): HTML tables can't round their own
   corners under border-collapse, so each grid is wrapped in this clipping
   shell — inline-block shrink-wraps to the table's content width (the
   pan-don't-squish philosophy stays), overflow:hidden rounds the corners of
   the table's own outer borders, shadow-sm gives the card depth. */
.nm-tablecard {
    display: inline-block;
    border: 1px solid var(--nm-z200);  /* anchors header to body on white pages */
    border-radius: var(--nm-radius-lg);
    overflow: hidden;
    box-shadow: var(--nm-shadow-sm);
    vertical-align: top;
    /* No max-width: the wrapper shrink-wraps and may exceed the viewport —
       the user pans the page (the documented content-width philosophy). */
}
.nm-tablecard > table { margin: 0 !important; }

/* Entry-grid variant: overflow stays VISIBLE because OrderAutocomplete's
   suggestion dropdown is an absolutely-positioned descendant — overflow:hidden
   would clip it at the card edge (z-index cannot escape clipping). Corners are
   rounded on the corner CELLS instead; bottom corners stay square (white rows,
   not noticeable) to avoid per-section :last-child artifacts. */
.nm-tablecard-open { overflow: visible; }
.nm-tablecard-open > table > thead > tr:first-child > *:first-child,
.nm-tablecard-open > table > tbody:first-child > tr:first-child > *:first-child { border-top-left-radius: var(--nm-radius-lg); }
.nm-tablecard-open > table > thead > tr:first-child > *:last-child,
.nm-tablecard-open > table > tbody:first-child > tr:first-child > *:last-child { border-top-right-radius: var(--nm-radius-lg); }

/* Centered card-header band for display tables ("Time Entries" etc.) —
   lives INSIDE the .nm-tablecard so the title is attached to (and exactly
   as wide as) its table. */
.nm-tablehdr {
    display: block;
    text-align: center;
    background: var(--nm-z50);
    padding: 4px 10px;
    font-family: var(--nm-font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--nm-z950);
    border-bottom: 1px solid var(--nm-z300);
}

/* Circular soft icon buttons (Stage 5, 2026-06-11) — the kit's
   circular-button pattern in its soft tints, sized for dense grid rows.
   Used for the per-day add (+) and remove (x) row actions. */
.nm-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* relative so the drawn +/x bars (absolute, below) anchor to this circle. */
    position: relative;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    /* Keep the inline-flex button centered in its table cell regardless of that row's
       height (rowspan day cell, .ts-err rows) — default baseline alignment shifted it. */
    vertical-align: middle;
    cursor: pointer;
    padding: 0;
    font-family: var(--nm-font-sans);
}
.nm-iconbtn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.nm-iconbtn-add { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.nm-iconbtn-add:hover { background: rgba(59, 130, 246, 0.25); }
.nm-iconbtn-del { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.nm-iconbtn-del:hover { background: rgba(239, 68, 68, 0.22); }

/* Draw the + and × as CSS shapes instead of the ✚/✕ dingbat glyphs — the glyphs sat
   off-center in the circles, worse on some rows. Font glyphs are placed by the font's
   baseline/ascent metrics, which no amount of line-height fully centers and which the
   fallback symbol font renders inconsistently. Two absolutely-positioned bars,
   translate(-50%,-50%)-centered, are font-independent and pixel-perfect on every row.
   The text glyph is hidden via font-size:0 on add/del; the swap button keeps its glyph. */
.nm-iconbtn-add, .nm-iconbtn-del { font-size: 0; }
.nm-iconbtn-add::before, .nm-iconbtn-add::after,
.nm-iconbtn-del::before, .nm-iconbtn-del::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    border-radius: 1px;
}
.nm-iconbtn-add::before { width: 10px; height: 2px;  transform: translate(-50%, -50%); }
.nm-iconbtn-add::after  { width: 2px;  height: 10px; transform: translate(-50%, -50%); }
.nm-iconbtn-del::before { width: 11px; height: 2px;  transform: translate(-50%, -50%) rotate(45deg); }
.nm-iconbtn-del::after  { width: 11px; height: 2px;  transform: translate(-50%, -50%) rotate(-45deg); }
/* Mode-swap (hours ⇄ times) — soft indigo so it reads as "transform", not add/delete. */
.nm-iconbtn-swap { background: rgba(99, 102, 241, 0.15); color: #4338ca; }
.nm-iconbtn-swap:hover { background: rgba(99, 102, 241, 0.25); }

/* Page surface: zinc background with the app content on a white card
   (MainLayout's <main>/<article>). min-width:fit-content lets the dense
   content-width grids widen the card instead of overflowing it. */
main.nm-main { padding: 10px 12px 28px; }
article.nm-article {
    background: #fff;
    border: 1px solid var(--nm-ring);
    border-radius: var(--nm-radius-xl);
    box-shadow: var(--nm-shadow-card);
    padding: 0 10px 14px;
    min-width: fit-content;
}

a, .btn-link {
    color: #006bb7;
}

/* Primary action — Catalyst solid dark/zinc button (Stage 2, 2026-06-11):
   zinc-900 body, near-black border, inner top highlight, 8px radius. */
.btn-primary {
    color: #fff;
    background-color: var(--nm-z900);
    border-color: rgba(9, 9, 11, 0.9);
    border-radius: var(--nm-radius-lg);
    font-family: var(--nm-font-sans);
    font-weight: 600;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.15), var(--nm-shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background-color: #2c2c30; /* zinc-900 + white/10 overlay */
    border-color: rgba(9, 9, 11, 0.9);
}

.btn-primary:disabled {
    /* Catalyst disabled = 50% opacity of the solid button — visually distinct
       from active without inventing a new hue. */
    background-color: var(--nm-z900);
    border-color: rgba(9, 9, 11, 0.9);
    color: #fff;
    opacity: 0.5;
    box-shadow: none;
}

/* Secondary action — the per-form Save button (only consumer of .btn-outline-primary
   in this app). SAME zinc palette as the solid .btn-primary above, just outlined:
   white body, zinc-900 text + border. Submit (solid) and Save (outline) now read as
   one color family — primary↔secondary — instead of grey-vs-blue. Bootstrap's default
   .btn-outline-primary is blue, which is why Save clashed before this override. */
.btn-outline-primary {
    color: var(--nm-z900);
    background-color: #fff;
    border-color: var(--nm-z900);
    border-radius: var(--nm-radius-lg);
    font-family: var(--nm-font-sans);
    font-weight: 600;
    box-shadow: var(--nm-shadow-sm);
}

.btn-outline-primary:hover:not(:disabled) {
    color: #fff;
    background-color: var(--nm-z900);
    border-color: var(--nm-z900);
}

.btn-outline-primary:disabled {
    color: var(--nm-z900);
    background-color: #fff;
    border-color: var(--nm-z900);
    opacity: 0.5;
    box-shadow: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODM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NGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
