/* ==========================================================================
   SIAP design system.
   Idea: the working day is the visual signature — a 24-hour "day ribbon" (shift,
   lunch, punches, now) carries the heroes; everything around it stays quiet.
   Type: Bahnschrift (DIN, the face of time clocks and signage) for titles, figures
   and time; Segoe UI for reading. Palette: ink, navy, steel, mist, white and one
   amber "clock" accent used only for "now" and what needs attention.
   Light/dark is one attribute on <html> (data-theme, mirrored to Bootstrap's
   data-bs-theme); the collapsed menu is data-nav="collapsed"; the mobile drawer is
   data-nav-open. All set by js/theme.js and js/app-shell.js.
   ========================================================================== */

:root {
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: Bahnschrift, "DIN Alternate", "DIN Next", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

    /* Palette */
    --ink: #16202e;
    --navy: #1f3b5c;
    --steel: #5b6b7f;
    --mist: #eef1f5;
    --amber: #e0a526;

    --bg: var(--mist);
    --surface: #ffffff;
    --surface-2: #f6f8fa;
    --surface-hover: #f1f4f8;
    --text: var(--ink);
    --text-2: #354253;
    --muted: #5a6576;          /* ≥ 4.5:1 on --bg and --surface */
    --border: #d8dde4;
    --border-soft: #e7ebf0;

    --primary: var(--navy);
    --primary-hover: #182f4a;
    --on-primary: #ffffff;
    --accent: #234a73;
    --on-accent: #ffffff;
    --accent-bg: #e7edf5;
    --focus: rgba(31, 59, 92, .22);
    --highlight: var(--amber);
    --highlight-ink: #7a4f00;  /* amber as text: ≥ 4.5:1 on white */

    --danger: #b42318;
    --danger-bg: #fdf1f0;
    --danger-border: #f1c6c1;
    --success: #1b7043;
    --success-bg: #edf7f1;
    --success-border: #bfe0cc;
    --on-success: #ffffff;
    --warning: #7a4f00;
    --warning-bg: #fdf6e3;
    --warning-border: #efd9a2;
    --purple: #5b4b8a;

    --sidebar-bg: var(--ink);
    --sidebar-text: #c6cdd7;
    --sidebar-muted: #8a95a4;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-active: rgba(255, 255, 255, .09);
    --topbar: rgba(255, 255, 255, .82);

    --hero-bg: #1c3552;
    --hero-text: #ffffff;
    --hero-muted: #b9c7d8;

    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 1px 3px rgba(16, 32, 56, .04);
    --shadow-md: 0 1px 2px rgba(16, 32, 56, .05), 0 8px 20px -6px rgba(16, 32, 56, .14);
    --shadow-lg: 0 2px 6px rgba(16, 32, 56, .08), 0 22px 44px -14px rgba(16, 32, 56, .32);

    /* Motion and layering tokens (one rhythm for every transition; one z-index scale). */
    --dur-fast: 120ms;
    --dur: 180ms;
    --dur-slow: 240ms;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --z-topbar: 20;
    --z-scrim: 25;
    --z-sidebar: 30;
    --z-toast: 2000;

    --nav-w: 264px;
    --nav-rail: 76px;
    --topbar-h: 60px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0e131a;
    --surface: #151b24;
    --surface-2: #19212b;
    --surface-hover: #1e2733;
    --text: #e6eaf0;
    --text-2: #c7ced8;
    --muted: #9aa5b4;
    --border: #283241;
    --border-soft: #212a36;

    --primary: #3d6694;
    --primary-hover: #4a74a3;
    --on-primary: #ffffff;
    --accent: #9fbde0;
    --on-accent: #0e131a;
    --accent-bg: #1b2a3c;
    --focus: rgba(159, 189, 224, .28);
    --highlight-ink: #f0c060;

    --danger: #f08a80;
    --danger-bg: #2c1a1a;
    --danger-border: #5a2d2a;
    --success: #72cf98;
    --success-bg: #152619;
    --success-border: #28503a;
    --on-success: #0b1a10;
    --warning: #e8bf62;
    --warning-bg: #2a2314;
    --warning-border: #55461f;
    --purple: #b3a4e0;

    --sidebar-bg: #0a0f15;
    --sidebar-text: #bcc4cf;
    --sidebar-muted: #717c8a;
    --topbar: rgba(21, 27, 36, .82);

    --hero-bg: #16283d;
    --hero-muted: #a6b6c9;

    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 22px 44px -14px rgba(0, 0, 0, .65);
    color-scheme: dark;
}

/* ---------- Base ---------- */
html { font-size: 15px; }
html, body {
    font-family: var(--font);
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body { min-height: 100vh; min-height: 100dvh; }
button, a, [role=button], input, select, textarea, label { touch-action: manipulation; }

h1, h2, h3, .display { font-family: var(--font-display); color: var(--text); font-weight: 600; letter-spacing: -.005em; font-stretch: 95%; text-wrap: balance; }
h1 { font-size: 1.95rem; line-height: 1.15; margin: 0 0 .35rem; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 2rem 0 .8rem; }
h3 { font-size: 1.02rem; line-height: 1.3; margin: 1.25rem 0 .5rem; }
h1:focus { outline: none; }
p { margin: 0 0 .75rem; }

a, .btn-link { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code, .mono { font-family: var(--font-mono); font-size: .85em; }
.num, td.num, th.num, .tabular { font-variant-numeric: tabular-nums; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ==========================================================================
   Shell: sidebar (collapsible rail / mobile drawer) + top bar + content
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; transition: grid-template-columns var(--dur-slow) var(--ease-out); }
:root[data-nav="collapsed"] .shell { grid-template-columns: var(--nav-rail) minmax(0, 1fr); }
.main-col { min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: var(--z-sidebar);
    display: flex; flex-direction: column;
    background: var(--sidebar-bg); color: var(--sidebar-text);
    box-shadow: 1px 0 0 rgba(0, 0, 0, .2), 6px 0 24px -12px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.nav-scrim { display: none; }

.brand { height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem 0 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand-link { display: flex; align-items: center; gap: .75rem; text-decoration: none !important; min-width: 0; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--amber); color: var(--ink); box-shadow: 0 4px 14px -4px rgba(224, 165, 38, .55); }
.brand-mark .ico { width: 22px; height: 22px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-family: var(--font-display); color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; }
.brand-sub { color: var(--sidebar-muted); font-size: .8rem; white-space: nowrap; }
.sidebar .nav-collapse { width: 34px; height: 34px; }
/* The top-bar toggle is only needed when the sidebar's own button is not there: drawer or rail. */
.topbar .nav-toggle { display: none; }
:root[data-nav="collapsed"] .topbar .nav-toggle { display: inline-flex; }
:root[data-nav="collapsed"] .sidebar .nav-collapse { display: none; }

.nav-menu { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .5rem .7rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nav-section { color: var(--sidebar-muted); font-size: .8rem; font-weight: 600; padding: 1.1rem .7rem .35rem; white-space: nowrap; }
.nav-menu .nav-link {
    position: relative; display: flex; align-items: center; gap: .8rem;
    min-height: 38px; padding: .4rem .7rem; margin: 1px 0; border-radius: 9px;
    color: var(--sidebar-text); font-size: .9rem; text-decoration: none; white-space: nowrap;
    transition: background .14s, color .14s;
}
.nav-menu .nav-link .ico { width: 19px; height: 19px; opacity: .85; }
.nav-menu .nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-menu .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-menu .nav-link.active::before { content: ""; position: absolute; left: -.7rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav-menu .nav-link.active .ico { opacity: 1; color: var(--amber); }
.nav-text { overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }

.nav-footer { flex-shrink: 0; display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .1); color: #fff; font: 700 .78rem var(--font-display); letter-spacing: .04em; }
.nav-user { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.nav-user-name { color: #fff; font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.nav-user-role { color: var(--sidebar-muted); font-size: .8rem; }
.sidebar .icon-btn { color: var(--sidebar-text); border-color: rgba(255, 255, 255, .12); background: transparent; }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Collapsed rail (desktop) */
:root[data-nav="collapsed"] .sidebar .nav-text { opacity: 0; width: 0; pointer-events: none; }
:root[data-nav="collapsed"] .brand { justify-content: center; padding: 0; }
:root[data-nav="collapsed"] .nav-menu { padding: .5rem .6rem 1rem; }
:root[data-nav="collapsed"] .nav-section { padding: .6rem 0; height: 1px; margin: .55rem .5rem; background: rgba(255, 255, 255, .08); }
:root[data-nav="collapsed"] .nav-menu .nav-link { justify-content: center; padding: .4rem 0; gap: 0; }
:root[data-nav="collapsed"] .nav-menu .nav-link.active::before { left: -.6rem; }
:root[data-nav="collapsed"] .nav-footer { flex-direction: column; padding: .75rem .5rem; gap: .5rem; }
:root[data-nav="collapsed"] .nav-user { display: none; }

/* Top bar */
.topbar {
    position: sticky; top: 0; z-index: var(--z-topbar); height: var(--topbar-h);
    display: flex; align-items: center; gap: .9rem; padding: 0 2rem 0 1.25rem;
    background: var(--topbar); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); cursor: pointer;
    transition: background .14s, color .14s, box-shadow .14s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn .ico { width: 19px; height: 19px; }
.user-chip { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--navy); color: #fff; font: 700 .8rem var(--font-display); letter-spacing: .04em; box-shadow: var(--shadow); }
.bell { position: relative; }
.bell .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--danger); color: #fff; font: 700 .75rem/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface); }

/* Content */
.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.75rem 2rem 3.5rem; }
.content > h1 + .hint, .content > h1 + .subtitle, .content > h1 + p { color: var(--muted); margin-bottom: 1.5rem; max-width: 72ch; }

/* Narrow screens: the sidebar becomes a drawer */
@media (max-width: 960px) {
    .shell, :root[data-nav="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100%; transform: translateX(-102%);
        transition: transform .24s ease; box-shadow: var(--shadow-lg); }
    :root[data-nav-open] .sidebar { transform: none; }
    :root[data-nav="collapsed"] .sidebar .nav-text { opacity: 1; width: auto; pointer-events: auto; }
    :root[data-nav="collapsed"] .brand { justify-content: space-between; padding: 0 1rem 0 1.1rem; }
    :root[data-nav="collapsed"] .nav-section { height: auto; margin: 0; background: none; padding: 1.1rem .7rem .35rem; }
    :root[data-nav="collapsed"] .nav-menu .nav-link { justify-content: flex-start; padding: .4rem .7rem; gap: .8rem; }
    :root[data-nav="collapsed"] .nav-footer { flex-direction: row; padding: .85rem 1rem; }
    :root[data-nav="collapsed"] .nav-user { display: flex; }
    .topbar .nav-toggle, :root[data-nav="collapsed"] .sidebar .nav-collapse { display: inline-flex; }
    .nav-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 16, 24, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
    :root[data-nav-open] .nav-scrim { opacity: 1; pointer-events: auto; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.25rem 1rem 2.5rem; }
}
@media (max-width: 640px) {
    .topbar .breadcrumbs { display: none; }
    h1 { font-size: 1.6rem; }
}

/* ---------- Page structure ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { margin-bottom: .2rem; }
.page-header .subtitle { margin: 0; }
.subtitle { color: var(--muted); }
.hint { color: var(--muted); font-size: .92rem; max-width: 78ch; }
.code { color: var(--muted); font-family: var(--font-mono); font-size: .8rem; font-weight: 400; }
.empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }

/* ---------- Cards ---------- */
.card, .content form:not(.bare), .table-wrap, .kpi-card, .chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card { padding: 1.4rem 1.5rem; margin-bottom: 1.25rem; min-width: 0; }
.card > h2:first-child, .card > h3:first-child, .card > .card-title:first-child { margin-top: 0; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.card.raised, a.card:hover { box-shadow: var(--shadow-md); }
.content form:not(.bare) { padding: 1.4rem 1.5rem; margin: 0 0 1.25rem; min-width: 0; }
/* EditForm renders a hidden antiforgery input first, so the heading is not :first-child. */
.content form:not(.bare) > h2:first-child, .content form:not(.bare) > input[type=hidden]:first-child + h2,
.content form:not(.bare) > h3:first-child, .content form:not(.bare) > input[type=hidden]:first-child + h3 { margin-top: 0; }
.card form:not(.bare), .login-card form { border: none; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }

/* ---------- KPIs ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1rem 0 1.75rem; }
.kpi-card { position: relative; padding: 1rem 1.15rem 1.05rem; min-width: 0; overflow: hidden; }
.kpi-title { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; margin-top: .2rem; line-height: 1.1; color: var(--text);
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-subtext { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.kpi-card.attention { border-color: var(--warning-border); }
.kpi-card.attention::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--amber); }

/* ---------- Buttons ---------- */
.btn, .content button.primary {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 38px; padding: 0 1rem;
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    background: var(--primary); color: var(--on-primary);
    font: 600 .9rem/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 32, 56, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); text-decoration: none; box-shadow: var(--shadow-md); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn .ico { width: 18px; height: 18px; }
/* Bootstrap's .btn:disabled resets background/border; keep each variant's own colors, just faded. */
.btn:disabled { opacity: .5; cursor: not-allowed; background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn.secondary:disabled, .btn.reject:disabled, .btn.danger:disabled { background: var(--surface); }
.btn.secondary:disabled { color: var(--text); border-color: var(--border); }
.btn.reject:disabled, .btn.danger:disabled { color: var(--danger); border-color: var(--danger-border); }
.btn.approve:disabled { background: var(--success); border-color: var(--success); color: var(--on-success); }
.btn + .btn { margin-left: .5rem; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.btn.approve { background: var(--success); border-color: var(--success); color: var(--on-success); }
.btn.approve:hover:not(:disabled) { filter: brightness(.94); background: var(--success); border-color: var(--success); color: var(--on-success); }
.btn.reject, .btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-border); box-shadow: var(--shadow); }
.btn.reject:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn.small { min-height: 30px; padding: 0 .7rem; font-size: .82rem; }
.btn.large { min-height: 50px; padding: 0 1.4rem; font-size: 1rem; border-radius: 10px; }
.link { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); margin-left: .75rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions .btn + .btn { margin-left: 0; }

/* ---------- Forms ---------- */
.content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
.content select, .content textarea {
    min-height: 40px; padding: .45rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; max-width: 100%;
    box-shadow: inset 0 1px 1px rgba(16, 32, 56, .04);
    transition: border-color .15s, box-shadow .15s;
}
.content textarea { min-height: 84px; width: 100%; resize: vertical; }
.content input:hover:not(:disabled), .content select:hover:not(:disabled), .content textarea:hover:not(:disabled) { border-color: #b9c2ce; }
.content input:focus, .content select:focus, .content textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.content input::placeholder, .content textarea::placeholder { color: var(--muted); opacity: .75; }
.content input:disabled, .content select:disabled { background: var(--surface-2); color: var(--muted); }
.content input[type=checkbox], .content input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.content input[type=file] { font-size: .88rem; color: var(--text-2); }
.content input[type=file]::file-selector-button { margin-right: .75rem; min-height: 34px; padding: 0 .85rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 600 .85rem var(--font); cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.25rem; margin-bottom: 1.1rem; }
.form-grid label { display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; font-weight: 600; color: var(--text-2); min-width: 0; }
.form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select, .form-grid textarea { width: 100%; font-weight: 400; }
.form-grid .wide { grid-column: span 2; }
.form-grid small { color: var(--muted); font-size: .8rem; font-weight: 400; }
.form-grid .checkbox, .checkbox { flex-direction: row !important; align-items: center; gap: .55rem; font-weight: 500; }
.form-grid .checkbox { align-self: end; min-height: 40px; }
.reason-label { display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; font-weight: 600; color: var(--text-2); margin: .5rem 0 1rem; }
.reason-label textarea { font-weight: 400; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: 1.1rem; }
.toolbar label, .range label { display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.range { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.validation-message { color: var(--danger); font-size: .8rem; }
.valid.modified:not([type=checkbox]) { border-color: var(--success) !important; }
.invalid { border-color: var(--danger) !important; }

/* ---------- Alerts ---------- */
.error, .ok, .notice, .warning-box {
    display: block; padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .92rem; margin: 0 0 1rem;
}
.error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.ok { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.notice { color: var(--text-2); background: var(--accent-bg); border-color: var(--border); }
.warning-box { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }

/* ---------- Tabs (segmented) ---------- */
.tabs { display: flex; gap: .25rem; padding: .25rem; margin: 1.25rem 0; width: fit-content; max-width: 100%;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; scrollbar-width: thin; }
.tab { background: none; border: none; padding: .5rem .95rem; border-radius: 8px;
    color: var(--muted); font: 600 .88rem var(--font); cursor: pointer; white-space: nowrap; transition: background .14s, color .14s, box-shadow .14s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-md); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; max-width: 100%; }
.content table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; background: var(--surface); color: var(--text); }
.content th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--text-2);
    background: var(--surface-2); padding: .7rem .95rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.content td { padding: .7rem .95rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.content tbody tr:last-child td { border-bottom: none; }
.content tbody tr { transition: background .1s; }
.content tbody tr:hover td { background: var(--surface-hover); }
.table-wrap table { margin: 0; }
.table-wrap th:first-child { border-top-left-radius: var(--radius); }
.table-wrap th:last-child { border-top-right-radius: var(--radius); }
.num, td.num, th.num { text-align: right; }
/* An amount reads as one unit: "B/. 540.00" never breaks across lines (tables scroll instead). */
td.num { white-space: nowrap; }

/* ---------- Badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem .15rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent); white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }

/* ---------- Toasts ---------- */
.toaster { position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .5rem; z-index: var(--z-toast); width: min(380px, calc(100vw - 2.5rem)); }
.toast-item { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 10px; padding: .8rem 1rem; box-shadow: var(--shadow-lg); display: flex; gap: .75rem; align-items: flex-start; font-size: .9rem;
    animation: toast-in .22s ease-out; }
.toast-item.success { border-left-color: var(--success); }
.toast-item.error { border-left-color: var(--danger); }
.toast-item button { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Breadcrumbs (in the top bar) ---------- */
.breadcrumbs { font-size: .86rem; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }
.breadcrumbs .sep { margin: 0 .45rem; }

/* ==========================================================================
   Hero + day ribbon (the signature element)
   ========================================================================== */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.5rem 2.5rem; align-items: end;
    padding: 2rem 2.25rem 2.1rem; margin: 0 0 1.75rem;
    background: var(--hero-bg); color: var(--hero-text);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
/* Hour ticks along the bottom edge: the day, as structure rather than decoration. */
.hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; z-index: -1;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px calc(100% / 24));
}
.hero.single { grid-template-columns: minmax(0, 1fr); }
.hero-kicker { color: var(--hero-muted); font-size: .92rem; margin: 0 0 .35rem; }
.hero h1, .hero-title { color: #fff; font-family: var(--font-display); font-size: 2.45rem; line-height: 1.05; font-weight: 600; margin: 0 0 .5rem; font-stretch: 92%; }
.hero-lead { color: var(--hero-muted); font-size: 1rem; max-width: 52ch; margin: 0 0 1.25rem; }
.hero-figure { font-family: var(--font-display); font-weight: 300; font-size: 4.4rem; line-height: .95; letter-spacing: -.02em; color: #fff;
    font-variant-numeric: tabular-nums; }
.hero-figure small { font-size: max(.32em, .85rem); font-weight: 500; letter-spacing: .02em; margin-left: .35rem; color: var(--hero-muted); }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-top: 1rem; }
.hero-fact { display: flex; flex-direction: column; min-width: 0; }
.hero-fact span { color: var(--hero-muted); font-size: .8rem; }
.hero-fact strong { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: #fff; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-actions .btn + .btn, .page-header .btn + .btn { margin-left: 0; }
.hero .btn { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
.btn.on-dark { background: #fff; border-color: #fff; color: var(--navy); }
.btn.on-dark:hover:not(:disabled) { background: #f0f3f7; border-color: #f0f3f7; color: var(--navy); }
.btn.ghost-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.btn.ghost-dark:hover:not(:disabled) { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.amber:hover:not(:disabled) { background: #eab13a; border-color: #eab13a; color: var(--ink); }
.hero-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
    background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .16); }
.hero-pill.warn { background: rgba(224, 165, 38, .16); border-color: rgba(224, 165, 38, .45); color: #ffd98a; }
.hero-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Layout: punch times and "Ahora" above the bar, the hour scale below it. */
.ribbon { position: relative; height: 76px; min-width: 0; }
.ribbon-track { position: absolute; left: 0; right: 0; top: 24px; height: 16px; border-radius: 999px; background: rgba(255, 255, 255, .09);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.ribbon-seg { position: absolute; top: 24px; height: 16px; border-radius: 999px; }
.ribbon-seg.shift { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.ribbon-seg.break { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 3px, transparent 3px 7px); border-radius: 0; }
.ribbon-seg.worked { background: linear-gradient(180deg, #d8e7f7, #a9c6e6); box-shadow: 0 2px 8px -2px rgba(169, 198, 230, .6); }
.ribbon-mark { position: absolute; top: 19px; width: 2px; height: 26px; margin-left: -1px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(16, 32, 56, .35); }
.ribbon-mark span { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); font: 600 .8rem var(--font); color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ribbon-now { position: absolute; top: 18px; height: 28px; width: 2px; margin-left: -1px; background: var(--amber); border-radius: 2px; }
.ribbon-now::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
    background: var(--amber); box-shadow: 0 0 0 4px rgba(224, 165, 38, .25); }
.ribbon-now span { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); font: 700 .8rem var(--font); color: var(--amber); white-space: nowrap; }
.ribbon-scale { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; }
.ribbon-scale span { position: absolute; transform: translateX(-50%); font-size: .8rem; color: var(--hero-muted); font-variant-numeric: tabular-nums; }
.ribbon-scale span:first-child { transform: none; }
.ribbon-scale span:last-child { transform: translateX(-100%); }
.ribbon-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .6rem; font-size: .8rem; color: var(--hero-muted); }
.ribbon-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 999px; margin-right: .4rem; vertical-align: 1px; }
.ribbon-legend .l-shift { background: rgba(255, 255, 255, .25); }
.ribbon-legend .l-worked { background: #bcd4ee; }
.ribbon-legend .l-break { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .45) 0 2px, transparent 2px 5px); }
.ribbon-legend .l-now { background: var(--amber); width: 8px; }

/* Composition bar (how the workforce is split today) */
.split-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .09); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.split-bar i { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: .8rem; }
.split-legend span { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--hero-muted); }
.split-legend b { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 1rem; }
.split-legend i { width: 9px; height: 9px; border-radius: 3px; }

@media (max-width: 960px) {
    .hero { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1.35rem 1.7rem; }
    .hero h1, .hero-title { font-size: 2rem; }
    .hero-figure { font-size: 3.4rem; }
}

/* ---------- Quick links (under heroes) ---------- */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; margin: 0 0 1.75rem; }
.quick-link { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: box-shadow .15s, border-color .15s; }
.quick-link:hover { box-shadow: var(--shadow-md); border-color: #c3cbd6; }
.quick-link .ico { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--accent-bg); color: var(--accent); }
.quick-link strong { display: block; font-weight: 600; font-size: .92rem; }
.quick-link small { display: block; color: var(--muted); font-size: .8rem; }

/* ---------- Bootstrap bits still used by the template ---------- */
.btn-primary { color: var(--on-primary); background-color: var(--primary); border-color: var(--primary); }
.blazor-error-boundary {
    background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger);
    border-radius: var(--radius-sm); padding: 1rem;
}
.blazor-error-boundary::after { content: "Ocurrió un error al mostrar esta sección."; }

#blazor-error-ui {
    color-scheme: light only; background: #fdf6e3; color: #354253; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 640px) {
    /* 16px base on phones: readable body text and no iOS auto-zoom when an input gets focus. */
    html { font-size: 16px; }
    .form-grid .wide { grid-column: auto; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .kpi-value { font-size: 1.55rem; }
    .card, .content form:not(.bare) { padding: 1.1rem 1.1rem; }
}

/* ==========================================================================
   UX quality floor (ui-ux-pro-max checklist: accessibility, touch, feedback)
   ========================================================================== */

/* Skip link: first stop for keyboard users, visible only when focused. */
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 3000; padding: .6rem 1rem; border-radius: var(--radius-sm);
    background: var(--amber); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-lg); transition: top var(--dur) var(--ease-out); }
.skip-link:focus { top: .75rem; text-decoration: none; outline: 2px solid var(--ink); outline-offset: 2px; }

/* Keyboard focus that stays visible on dark surfaces too. */
.sidebar a:focus-visible, .sidebar button:focus-visible, .hero a:focus-visible, .hero button:focus-visible {
    outline: 2px solid var(--amber); outline-offset: 2px; box-shadow: none; }
/* Sticky top bar must never cover the focused control or a jumped-to heading. */
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
.content h1:focus { outline: none; }

/* Touch screens: every target at least 44×44 px, with room between them. */
@media (pointer: coarse) {
    .btn, .content button.primary, .icon-btn, .user-chip { min-height: 44px; }
    .icon-btn, .user-chip { width: 44px; height: 44px; }
    .btn.small { min-height: 40px; padding: 0 .85rem; }
    .nav-menu .nav-link { min-height: 44px; }
    .tab { min-height: 44px; }
    .content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .content select { min-height: 44px; }
    .content input[type=checkbox], .content input[type=radio] { width: 20px; height: 20px; }
    .link { min-height: 32px; display: inline-flex; align-items: center; }
}

/* Phones installed as an app: keep bars clear of the notch and the gesture area. */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
@media (max-width: 960px) {
    .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .nav-scrim { z-index: var(--z-scrim); }
    .content { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
}

/* Long IDs, e-mails and URLs wrap instead of pushing the layout wider. */
.notice, .error, .ok, .warning-box, .hint, .kpi-subtext, .nav-user-name { overflow-wrap: anywhere; }

/* Loading: skeletons that keep the page's shape instead of a bare "Cargando…". */
.skeleton { display: grid; gap: .75rem; margin: .5rem 0 1.5rem; }
.skeleton-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.skeleton .bone { height: 88px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-soft); position: relative; overflow: hidden; }
.skeleton .bone.line { height: 14px; border-radius: 7px; max-width: 420px; }
.skeleton .bone.line.short { max-width: 220px; }
.skeleton .bone.block { height: 180px; }
.skeleton .bone::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
    animation: shimmer 1.3s var(--ease-out) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Empty states: say what's missing and what to do next. */
.empty, .empty-row { color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 2.25rem 1rem; color: var(--muted); }
.empty-state .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--steel); }
.empty-state strong { color: var(--text); font-weight: 600; }

/* Inline icons that replaced emoji: sized to the text they sit in. */
.with-photo, .holiday-mark, .lock { display: inline-flex; align-items: center; margin-left: .35rem; color: var(--muted); vertical-align: -3px; }
.with-photo .ico, .holiday-mark .ico, .lock .ico { width: 16px; height: 16px; }
.holiday-mark { color: var(--warning); }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.back-link .ico { width: 18px; height: 18px; }
.toast-item button .ico { width: 16px; height: 16px; }
#blazor-error-ui .dismiss { background: none; border: 1px solid currentColor; border-radius: 6px; padding: .1rem .55rem; font: inherit; }

/* Signed-in user's registered photo (top bar, menu footer, heroes). */
.avatar-img { object-fit: cover; display: inline-block; }
.user-chip.avatar-img { padding: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.nav-avatar.avatar-img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); }
.user-chip-wrap { display: inline-flex; }
.hero-avatar { width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); color: #fff; font: 700 1.1rem var(--font-display); border: 2px solid rgba(255, 255, 255, .25);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6); }
.hero-avatar.avatar-img { object-fit: cover; }
.hero-hello { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.hero-hello h1 { margin: 0; }

/* Virtual ID card dialog */
.card-scrim { position: fixed; inset: 0; z-index: 2400; background: rgba(10, 16, 24, .55); backdrop-filter: blur(3px); animation: fade-in var(--dur) var(--ease-out); }
.card-dialog { position: fixed; z-index: 2500; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.25rem; border-radius: var(--radius-lg); background: var(--bg);
    box-shadow: var(--shadow-lg); animation: pop-in var(--dur-slow) var(--ease-out); outline: none; }
.card-dialog-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }

.id-card { position: relative; overflow: hidden; border-radius: 18px; background: #fff; color: #16202e; box-shadow: var(--shadow-md);
    border: 1px solid #d8dde4; }
.id-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
    background: repeating-linear-gradient(90deg, #1c3552 0 1px, transparent 1px calc(100% / 24)); opacity: .35; }
.id-card-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.2rem; background: #1c3552; color: #fff; }
.id-card-head .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.id-card-head .brand-mark .ico { width: 18px; height: 18px; }
.id-card-company { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.id-card-kind { font-size: .8rem; color: #b9c7d8; white-space: nowrap; }
.id-card-body { display: grid; grid-template-columns: 112px minmax(0, 1fr) 120px; gap: 1.1rem; align-items: start; padding: 1.2rem 1.2rem 1rem; }
.id-card-photo { width: 112px; height: 140px; border-radius: 12px; overflow: hidden; background: #e7edf5; display: flex; align-items: center; justify-content: center;
    font: 700 2rem var(--font-display); color: #1c3552; border: 1px solid #d8dde4; }
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card-data h2 { margin: 0 0 .15rem; font-size: 1.35rem; color: #16202e; }
.id-card-role { margin: 0 0 .6rem; color: #354253; font-weight: 600; }
.id-card-data dl { margin: 0; display: grid; gap: .35rem; }
.id-card-data dl div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: .75rem; font-size: .88rem; }
.id-card-data dt { color: #5a6576; }
.id-card-data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.id-card-qr { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.id-card-qr svg { width: 120px; height: 120px; display: block; }
.id-card-qr small { font-family: var(--font-mono); font-size: .8rem; color: #354253; }
.qr-help { display: none; margin: 0; font-size: .84rem; color: #5a6576; max-width: 30ch; }
.id-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .75rem 1.2rem 1.2rem;
    border-top: 1px dashed #d8dde4; font-size: .8rem; color: #5a6576; }
/* Laid out by the card's own width (dialog, phone, UI kit), not the viewport's. */
.id-card { container-type: inline-size; }
@container (max-width: 600px) {
    .id-card-body { grid-template-columns: 104px minmax(0, 1fr); gap: 1rem; }
    .id-card-photo { width: 104px; height: 130px; }
    .id-card-data dl div { grid-template-columns: 110px minmax(0, 1fr); }
    .id-card-qr { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 1.25rem; padding-top: .9rem; border-top: 1px dashed #d8dde4; }
    .id-card-qr svg { width: 132px; height: 132px; }
    .id-card-qr small { font-size: .9rem; }
    .qr-help { display: block; }
    .id-card-kind { display: none; }
}
@container (max-width: 380px) {
    .id-card-body { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .id-card-data dl div { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .id-card-qr { flex-direction: column; }
    .qr-help { text-align: center; }
}

/* While a reloaded page restores its session (SessionGate): the page background, nothing else. */
.session-boot { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.hero h1.punch-hello { font-family: var(--font); font-size: 1.05rem; line-height: 1.4; margin: 0 0 .35rem; color: #fff; font-weight: 600; }

/* Lists on narrow screens: each row becomes a card of "label: value" lines, so the row's
   actions (approve, reject, open) are always in view instead of off to the right. */
@media (max-width: 760px) {
    .table-wrap:has(> table.data-grid) { overflow: visible; background: none; border: 0; box-shadow: none; border-radius: 0; }
    .content table.data-grid, .content table.data-grid tbody, .content table.data-grid tr, .content table.data-grid td { display: block; width: 100%; background: none; }
    .content table.data-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .content table.data-grid tbody tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
        margin: 0 0 .75rem; padding: .4rem 0; }
    .content table.data-grid tbody tr:hover td { background: none; }
    .content table.data-grid td { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); column-gap: .75rem; row-gap: .15rem; align-items: baseline;
        border: 0; padding: .4rem 1rem; overflow-wrap: anywhere; }
    .content table.data-grid td::before { content: attr(data-label); font-size: .8rem; font-weight: 600; color: var(--muted); }
    /* Everything in a cell (text, sub-lines, badges, links) stays in the value column, at its own width. */
    .content table.data-grid td > * { grid-column: 2; justify-self: start; }
    /* Cells without a column title (actions) and the empty state span the whole card. */
    .content table.data-grid td[data-label=""], .content table.data-grid td.empty-row { display: block; }
    .content table.data-grid td[data-label=""]::before, .content table.data-grid td.empty-row::before { display: none; }
    .content table.data-grid td.actions, .content table.data-grid td[data-label=""] { padding-top: .6rem; border-top: 1px solid var(--border-soft); margin-top: .25rem; }
    .content table.data-grid td.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
    .content table.data-grid td.actions .btn + .btn, .content table.data-grid td.actions .confirm-inline { margin-left: 0; }
    .content table.data-grid td.actions .btn { flex: 1 1 auto; }
    .content table.data-grid tbody tr:has(td.empty-row) { box-shadow: none; }
}

/* Inline two-step confirmation (ConfirmButton). */
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: .5rem; }
.confirm-inline .btn + .btn { margin-left: 0; }
.confirm-q { font-size: .85rem; font-weight: 600; color: var(--danger); }

/* One motion rhythm for interactive state changes. */
.btn, .icon-btn, .tab, .quick-link, .nav-menu .nav-link, .content input, .content select, .content textarea {
    transition-duration: var(--dur-fast); transition-timing-function: var(--ease-out); }

/* Print: only the document (pay slips and reports), no navigation or toolbars. */
@media print {
    .sidebar, .topbar, .breadcrumbs, .no-print, .toaster, .skip-link, #blazor-error-ui { display: none !important; }
    .shell, .main-col, .content { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { box-shadow: none !important; border-color: #bbb !important; }
    a { color: inherit; text-decoration: none; }
}

/* Secondary lines under a cell's main text, and small labels: never below 12px (base is 15px). */
small.sub, .sub { font-size: .85rem; }

