/* ==========================================================================
   CETEMOH HR — "Control Deck" design system
   Native CSS · two themes · no build step
   Direction: geometric, high-tech, luminous — but corporate.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #edf1f8;
    --bg-grid: rgba(23, 70, 162, 0.055);
    --bg-glow: rgba(34, 211, 238, 0.1);
    --surface: #ffffff;
    --surface-2: #f6f9fd;
    --surface-3: #e8eef8;
    --surface-glass: rgba(255, 255, 255, 0.82);
    --brand-logo-ink: #1746a2;
    --brand-logo-ink-hover: #0d2f6e;

    /* Ink */
    --text: #081326;
    --text-strong: #040c19;
    --muted: #5a6b85;

    /* Lines */
    --border: #dbe3f0;
    --border-strong: #bcc9de;
    --hairline: rgba(29, 78, 216, 0.16);

    /* Brand */
    --primary: #1d4ed8;
    --primary-hover: #163ea8;
    --primary-soft: #e4ecfd;
    --primary-deep: #0b2a72;
    --on-primary: #ffffff;

    --accent: #0891b2;
    --accent-bright: #22d3ee;
    --accent-soft: #e0f7fc;
    --accent-text: #0e7490;

    --secondary: #9a6f0b;
    --secondary-soft: #fdf3d7;
    --secondary-bright: #e0b23a;
    --on-secondary: #ffffff;
    --gold: #b8891b;
    --gold-text: #8a6410;

    /* Status */
    --success: #0f7a4a;
    --success-soft: #e3f8ee;
    --warning: #96600a;
    --warning-soft: #fdf1d8;
    --danger: #b01522;
    --danger-soft: #fde9ea;
    --info: #0a6c8a;
    --info-soft: #e2f6fc;
    --on-brand: #ffffff;

    /* Depth */
    --shadow-sm: 0 1px 2px rgba(8, 19, 38, 0.05);
    --shadow: 0 14px 34px -18px rgba(8, 19, 38, 0.35);
    --shadow-lg: 0 34px 80px -30px rgba(4, 12, 25, 0.55);
    --glow-primary:
        0 0 0 1px rgba(29, 78, 216, 0.16),
        0 18px 44px -24px rgba(29, 78, 216, 0.7);
    --glow-accent: 0 0 22px -4px rgba(34, 211, 238, 0.65);

    /* Geometry */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --sidebar-w: 268px;
    --topbar-h: 64px;

    /* Type */
    --font:
        "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
        "Helvetica Neue", Arial, sans-serif;
    --mono:
        ui-monospace, "Cascadia Code", "SF Mono", "Segoe UI Mono", Consolas,
        "Liberation Mono", monospace;

    /* Motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --speed: 0.18s;
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #050b16;
    --bg-grid: rgba(90, 140, 255, 0.075);
    --bg-glow: rgba(34, 211, 238, 0.12);
    --surface: #0a1424;
    --surface-2: #0e1a2e;
    --surface-3: #152440;
    --surface-glass: rgba(10, 20, 36, 0.78);

    --text: #e9f0fb;
    --text-strong: #ffffff;
    --muted: #93a6c2;

    --border: #1b2c47;
    --border-strong: #2b4366;
    --hairline: rgba(90, 140, 255, 0.28);

    --primary: #3f6fe0;
    --primary-hover: #5c86ea;
    --primary-soft: #152b52;
    --primary-deep: #16336f;
    --on-primary: #ffffff;

    --accent: #3ddcf5;
    --accent-bright: #7cf0ff;
    --accent-soft: #0d2f3a;
    --accent-text: #7cf0ff;

    --secondary: #e6c76a;
    --secondary-soft: #2f2812;
    --secondary-bright: #f2d789;
    --on-secondary: #06101f;
    --gold: #e6c76a;
    --gold-text: #eecf74;

    --success: #58d68d;
    --success-soft: #10301f;
    --warning: #f5b74f;
    --warning-soft: #33240c;
    --danger: #ff8a80;
    --danger-soft: #351417;
    --info: #5ed0f0;
    --info-soft: #0b2a35;
    --on-brand: #06101f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 18px 42px -20px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
    --glow-primary:
        0 0 0 1px rgba(90, 141, 255, 0.28),
        0 20px 48px -26px rgba(90, 141, 255, 0.95);
    --glow-accent: 0 0 26px -4px rgba(124, 240, 255, 0.6);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
        radial-gradient(
            900px 520px at 82% -10%,
            var(--bg-glow),
            transparent 70%
        );
    background-size:
        34px 34px,
        34px 34px,
        100% 100%;
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--primary);
    color: var(--on-primary);
}

:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 2px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--speed) var(--ease);
}
a:hover {
    color: var(--primary-hover);
}
input[type="hidden"] {
    opacity: 0;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}
h1 {
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 750;
}
h2 {
    font-size: 18px;
    letter-spacing: -0.01em;
}
h3 {
    font-size: 15px;
}

.muted {
    color: var(--muted);
}
.small {
    font-size: 12px;
}
.tiny {
    font-size: 11px;
}
.strong {
    font-weight: 700;
}
.mono {
    font-variant-numeric: tabular-nums;
    font-family: var(--mono);
}
.center {
    text-align: center;
}
.nowrap {
    white-space: nowrap;
}
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Thin luminous scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--border-strong) 80%, transparent);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary) 55%, var(--border-strong));
    background-clip: content-box;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main {
    min-height: 100vh;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Sidebar keeps its own dark "control panel" tokens in both themes. */
.sidebar {
    --surface: #060e1c;
    --surface-2: #0a1526;
    --surface-3: #13233c;
    --text: #e8f0fb;
    --muted: #8ea2c0;
    --border: #16273f;
    --border-strong: #24395a;
    --primary-soft: #14284a;
    --accent-soft: #0b2b36;

    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-w), calc(100vw - 44px));
    background:
        radial-gradient(
            420px 260px at 0% 0%,
            rgba(34, 211, 238, 0.1),
            transparent 65%
        ),
        linear-gradient(180deg, #071020 0%, #050c18 100%);
    background-color: #050c18;
    border-right: 1px solid #12213a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 50;
    transform: translateX(-100%);
    transition:
        transform 0.28s var(--ease),
        box-shadow 0.28s var(--ease);
    color: var(--text);
}
.sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.2);
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(2, 8, 18, 0.56);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.28s var(--ease),
        visibility 0.28s var(--ease);
}
.sidebar-backdrop.open {
    opacity: 1;
    visibility: visible;
}
body.sidebar-open {
    overflow: hidden;
}
.sidebar > * { flex: 0 0 auto; }
.sidebar::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(34, 211, 238, 0.55),
        transparent
    );
    opacity: 0.55;
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.brand-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 50%;
    overflow: hidden;
    padding: 5px;
    color: var(--brand-logo-ink);
}
.brand-logo:hover {
    color: var(--brand-logo-ink-hover);
}
.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #04101f;
    background: linear-gradient(140deg, #8ef0ff 0%, #22d3ee 40%, #2563eb 100%);
    clip-path: polygon(
        30% 0,
        70% 0,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0 70%,
        0 30%
    );
    box-shadow: var(--glow-accent);
    flex-shrink: 0;
}
.brand-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: #f2f7ff;
}
.brand-sub {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--gold-text);
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(
        150deg,
        rgba(34, 211, 238, 0.22),
        rgba(37, 99, 235, 0.28)
    );
    color: #d9f6ff;
    border: 1px solid rgba(34, 211, 238, 0.35);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-family: var(--mono);
    flex-shrink: 0;
}
.avatar.sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 5px;
}
.avatar.lg {
    width: 64px;
    height: 64px;
    font-size: 22px;
    border-radius: 12px;
}
.side-user .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 16px;
}
.side-user-name {
    font-weight: 600;
    line-height: 1.2;
}
.side-user-role {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.nav {
    flex: 0 0 auto;
    overflow: visible;
    padding: 10px 10px 18px;
}
.nav-label {
    font-family: var(--mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: color-mix(in srgb, var(--gold-text) 82%, transparent);
    padding: 14px 11px 7px;
    font-weight: 700;
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 7px;
    color: var(--muted);
    font-weight: 500;
    font-size: 13.5px;
    margin: 8px 0;
    border: 1px solid transparent;
    transition:
        background var(--speed) var(--ease),
        color var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}
.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.9;
}
.nav-link:hover {
    background: #102a43;
    border-color: #1e4d70;
    color: #f1f7ff;
}
.nav-link.active {
    background: linear-gradient(
        90deg,
        rgba(34, 211, 238, 0.18),
        rgba(37, 99, 235, 0.16) 55%,
        transparent
    );
    border-color: rgba(34, 211, 238, 0.32);
    color: #ffffff;
    box-shadow: inset 0 0 24px -12px rgba(34, 211, 238, 0.9);
}
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #8ef0ff, #2563eb);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.9);
}
.nav-link.active svg {
    color: var(--accent-bright);
    opacity: 1;
}
.nav-link.active:hover {
    color: #ffffff;
}
.side-foot {
    padding: 12px;
    border-top: 1px solid var(--border);
    flex: 0 0 auto;
}
.side-foot .nav-link {
    color: var(--muted);
}
.side-foot .nav-link:hover {
    color: #ffd7da;
    background: #3a1620;
    border-color: #6b2c38;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--topbar-h);
    height: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 8px 16px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid var(--border);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary),
        var(--accent-bright),
        transparent
    );
    background-size: 220% 100%;
    opacity: 0.55;
    animation: topbar-trace 9s linear infinite;
}
@keyframes topbar-trace {
    from {
        background-position: 0% 0;
    }
    to {
        background-position: 200% 0;
    }
}
.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.topbar-left { flex: 0 1 auto; }
.topbar-right {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
}
.today-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 641px) and (max-width: 1100px) {
    .topbar-right { gap: 6px; }
    .quick-find-label { display: none; }
}
.today-label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    font-family: var(--mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent),
        0 0 12px var(--success);
    animation: live-pulse 2.4s ease-in-out infinite;
}
.live-clock {
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    color: var(--text);
    opacity: 0.78;
    letter-spacing: 0.08em;
}
@keyframes live-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition:
        background var(--speed) var(--ease),
        color var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}
.icon-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border);
}
.icon-btn svg {
    width: 19px;
    height: 19px;
}

.badge-dot {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 5px;
    background: var(--danger);
    color: #fff;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow:
        0 0 0 2px var(--surface),
        0 0 12px color-mix(in srgb, var(--danger) 70%, transparent);
}
[data-theme="dark"] .badge-dot {
    color: var(--on-brand);
}

.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    width: 364px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 60;
    display: none;
    overflow: hidden;
    transform-origin: top right;
}
.dropdown-menu.open {
    display: block;
    animation: pop-in 0.16s var(--ease);
}
@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.dropdown-list {
    max-height: 340px;
    overflow-y: auto;
}
.dropdown-item {
    display: block;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
    color: var(--text);
    transition:
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}
.dropdown-item:hover {
    background: var(--surface-2);
    border-left-color: var(--primary);
}
.dropdown-item.unread {
    background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
    border-left-color: var(--accent-bright);
}
.dropdown-foot {
    display: block;
    text-align: center;
    padding: 11px;
    font-weight: 600;
    border-top: 1px solid var(--border);
}
.profile-menu {
    width: 248px;
}
.profile-head {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
}
.profile-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    color: var(--text);
    border-radius: var(--radius-sm);
    margin: 6px;
}
.profile-link:hover {
    background: var(--surface-3);
}
.profile-link.danger {
    color: var(--danger);
}
.profile-link svg {
    width: 17px;
    height: 17px;
}

/* --------------------------------------------------------------------------
   Page frame
   -------------------------------------------------------------------------- */
.content {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding: 18px 12px 28px;
    flex: 1;
    min-width: 0;
}
.page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-head h1 {
    position: relative;
}
.page-head p {
    color: var(--muted);
    margin-top: 5px;
    font-size: 13px;
    max-width: 760px;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dense operational pages: compact header, stat chips, collapsible settings */
.page.page-dense {
    gap: 10px;
}
.page-head.page-head-compact {
    align-items: center;
}
.page-head-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}
.page-head.page-head-compact .page-head-title h1 {
    font-size: 24px;
    line-height: 1.1;
}
.period-tag {
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--accent-text);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.page-head-meta {
    color: var(--muted);
    font-size: 12px;
}
.compact-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.compact-stats .chip {
    padding: 4px 9px;
}
.compact-stats .chip b {
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
}
.chip.chip-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 26%, transparent);
}
.chip.chip-info {
    background: var(--info-soft);
    color: var(--info);
    border-color: color-mix(in srgb, var(--info) 26%, transparent);
}
.chip.chip-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 26%, transparent);
}
.chip.chip-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}
.chip.chip-secondary {
    background: var(--surface-3);
    color: var(--muted);
    border-color: var(--border-strong);
}
.chip-warning b,
.chip-info b,
.chip-success b,
.chip-danger b {
    color: inherit;
}

.action-more {
    position: relative;
    display: inline-flex;
}
.action-more > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.action-more > summary::-webkit-details-marker {
    display: none;
}
.action-more[open] > summary {
    border-color: var(--primary);
    color: var(--primary);
}
.action-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 205px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.action-more-menu form {
    display: flex;
}
.action-more-menu .btn {
    width: 100%;
    justify-content: flex-start;
}

.table-toolbar.toolbar-strip {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 7px 12px;
}
.toolbar-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbar-filter .select,
.toolbar-filter .input {
    width: auto;
    min-width: 96px;
    min-height: 32px;
    height: 32px;
}
.toolbar-filter .btn {
    width: auto;
}

.period-config {
    width: 100%;
}
.table-card > .period-config {
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
}
.period-config > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.period-config > summary::-webkit-details-marker {
    display: none;
}
.period-config > summary::before {
    content: "+";
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text);
    font-size: 12px;
}
.period-config[open] > summary::before {
    content: "−";
}
.period-config > form,
.period-config > .filter-form {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
}
.toolbar-strip > .period-config {
    margin-top: 6px;
}
.toolbar-strip > .period-config[open] {
    flex-basis: 100%;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 8px;
}
.kicker::before {
    content: "";
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-bright), var(--primary));
    box-shadow: 0 0 10px
        color-mix(in srgb, var(--accent-bright) 70%, transparent);
}

/* --------------------------------------------------------------------------
   Cards / stats
   -------------------------------------------------------------------------- */
.card,
.stat-card,
.table-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition:
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        transform var(--speed) var(--ease);
}
.card::before,
.stat-card::before,
.table-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--primary) 55%, transparent),
        color-mix(in srgb, var(--accent-bright) 55%, transparent),
        transparent
    );
    opacity: 0.55;
    pointer-events: none;
}
.card:hover,
.stat-card:hover,
.table-card:hover {
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
}

.card-pad {
    padding: 18px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.stat-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px;
    overflow: hidden;
    isolation: isolate;
}
/* pointer spotlight (JS sets --mx / --my) */
.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(
        320px 200px at var(--mx, 50%) var(--my, 0%),
        color-mix(in srgb, var(--primary) 12%, transparent),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    pointer-events: none;
}
.stat-card:hover::after {
    opacity: 1;
}
.stat-label {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    font-weight: 700;
}
.stat-value {
    font-family: var(--mono);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.12;
    margin-top: 6px;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
}
[data-theme="dark"] .stat-value {
    color: #ffffff;
}
.stat-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
}
.stat-value-sm {
    font-size: 20px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    clip-path: polygon(
        26% 0,
        74% 0,
        100% 26%,
        100% 74%,
        74% 100%,
        26% 100%,
        0 74%,
        0 26%
    );
    transition: transform var(--speed) var(--ease);
}
.stat-card:hover .stat-icon {
    transform: scale(1.06);
}
.stat-card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.stat-card-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.stat-card-link:hover {
    transform: translateY(-2px);
}
.stat-card-link:active {
    transform: translateY(0);
}
.stat-icon svg {
    width: 21px;
    height: 21px;
}

.tone-primary {
    background: var(--primary-soft);
    color: var(--primary);
}
.tone-success {
    background: var(--success-soft);
    color: var(--success);
}
.tone-warning {
    background: var(--warning-soft);
    color: var(--warning);
}
.tone-danger {
    background: var(--danger-soft);
    color: var(--danger);
}
.tone-info {
    background: var(--info-soft);
    color: var(--info);
}
.tone-secondary {
    background: var(--secondary-soft);
    color: var(--secondary);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition:
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        transform 0.06s var(--ease);
}
.btn:hover {
    background: var(--surface-3);
}
.btn:active {
    transform: translateY(1px);
}
.btn svg {
    width: 17px;
    height: 17px;
}
.btn-primary {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 88%, #22d3ee) 0%,
        var(--primary) 45%,
        var(--primary-deep) 100%
    );
    border-color: color-mix(in srgb, var(--primary) 70%, #0b2a72);
    color: var(--on-primary);
    box-shadow:
        0 10px 24px -14px color-mix(in srgb, var(--primary) 85%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 70%, #22d3ee) 0%,
        var(--primary-hover) 45%,
        var(--primary-deep) 100%
    );
    color: var(--on-primary);
    box-shadow:
        0 14px 30px -14px color-mix(in srgb, var(--primary) 90%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-secondary {
    background: linear-gradient(
        135deg,
        var(--secondary-bright),
        var(--secondary)
    );
    border-color: var(--secondary);
    color: var(--on-secondary);
}
.btn-secondary:hover {
    filter: brightness(1.05);
    color: var(--on-secondary);
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
[data-theme="dark"] .btn-success {
    color: #07160e;
}
.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
[data-theme="dark"] .btn-warning {
    color: #1b1204;
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
[data-theme="dark"] .btn-danger {
    color: #1c0705;
}
.btn-outline {
    background: transparent;
}
.btn-outline:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-hover);
}
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
.btn-ghost:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border);
}
.btn-sm {
    height: 32px;
    padding: 0 11px;
    font-size: 12.5px;
    border-radius: 5px;
}
.btn-xs {
    height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
    border-radius: 4px;
    gap: 5px;
}
.btn-icon {
    width: 34px;
    padding: 0;
}
.btn-block {
    width: 100%;
}
.btn[disabled],
.btn.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
}
.btn.is-loading {
    color: transparent !important;
}
.btn.is-loading svg {
    opacity: 0;
}
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    color: var(--on-primary);
    animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after {
    color: var(--text);
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ripple (JS injected) */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: currentColor;
    opacity: 0.28;
    pointer-events: none;
    animation: ripple-out 0.55s var(--ease) forwards;
}
@keyframes ripple-out {
    to {
        transform: scale(2.6);
        opacity: 0;
    }
}

.btn-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}
.label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    padding: 8px 11px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition:
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        background var(--speed) var(--ease);
}
.input:hover,
.select:hover,
.textarea:hover {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border-strong));
}
.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent),
        0 0 18px -6px color-mix(in srgb, var(--primary) 55%, transparent);
}
.input::placeholder,
.textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}
.input-sm {
    padding: 6px 9px;
    font-size: 12.5px;
}
.textarea {
    resize: vertical;
    min-height: 80px;
}

.select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6b85' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
[data-theme="dark"] .select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393a6c2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}
.form-grid .full {
    grid-column: 1 / -1;
}
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.check input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}
.inline-form {
    display: inline;
}
.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-form .field {
    margin: 0;
    min-width: 140px;
}

.attendance-import-rules {
    margin-top: 12px;
    border-top: 1px solid var(--border);
}
.attendance-import-rules > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}
.attendance-import-rules > div:last-child { border-bottom: 0; }
.attendance-import-rules span { color: var(--muted); }
.attendance-import-rules b { color: var(--accent-text); text-align: right; }

.movement-tabs { margin-bottom: 12px; }
.movement-tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.movement-tabs .tab svg {
    width: 15px;
    height: 15px;
}

.movements-page {
    --surface-3: color-mix(in srgb, var(--border) 70%, var(--surface));
}
.movements-page .card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.movements-page .card-pad { padding: 16px; }
.movements-page .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
}
.movements-page .card-head > div { min-width: 0; }
.movements-page .card-head p { margin-top: 4px; }
.movements-page .field { gap: 8px; }

.movement-form { display: grid; gap: 12px; margin-top: 14px; }
.movement-form .field { margin: 0; }
.movement-form .field .label { margin-bottom: 4px; }
.movement-form .check { margin: 0; font-size: 12px; line-height: 1.45; }
.movement-form .check input { margin-top: 2px; accent-color: var(--primary); }
.movement-early-field {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.movement-early-field .check { display: flex; gap: 8px; align-items: flex-start; }
.movement-early-field small { display: block; margin-top: 4px; }
.movement-form-actions {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}
.movement-form-actions .btn { justify-self: start; }

.movement-pending-alert { display: grid; gap: 2px; }
.movement-pending-alert span { font-size: 12px; }
.movement-pending-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.movement-pending-row { display: grid; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.movement-pending-row:first-child { border-top: 0; }
.movement-pending-agent { display: grid; gap: 2px; }
.movement-return-form { display: flex; align-items: center; gap: 8px; }
.movement-return-form .input { width: 120px; }

/* Movement entry: today's compact activity band. */
.entry-overview {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 12px;
}
.entry-overview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.entry-overview-head p { margin-top: 4px; }
.entry-overview-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
}
.entry-overview-date svg { width: 14px; height: 14px; }
.entry-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.entry-metric {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.entry-metric-primary {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    background: var(--primary-soft);
}
.entry-metric-label { color: var(--muted); font-size: 11px; }
.entry-metric-value {
    color: var(--text-strong);
    font-size: 26px;
    font-weight: 750;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.entry-metric-detail { color: var(--muted); font-size: 11px; }
.entry-progress { display: grid; gap: 6px; }
.entry-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: var(--muted);
}
.entry-progress-head strong { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.entry-progress-track {
    height: 7px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.entry-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

/* Movement report: Microsoft-style statistical reading order. */
.stats-report { display: grid; gap: 12px; }
.stats-report > *,
.stats-filter-bar > *,
.stats-hero-grid > *,
.stats-secondary-grid > *,
.stats-analysis-grid > * { min-width: 0; }
.stats-filter-bar {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.stats-filter-lead {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.stats-filter-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex: 0 0 auto;
}
.stats-filter-lead > div { display: grid; gap: 2px; min-width: 0; }
.stats-filter-lead strong { font-size: 12px; color: var(--text-strong); }
.stats-filter-lead span { font-size: 11px; color: var(--muted); }
.stats-filter-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stats-filter-fields .field { margin: 0; gap: 8px; }
.stats-filter-bar > .btn { justify-self: start; }

.stats-hero-grid { display: grid; gap: 12px; }
.stats-hero { padding: 18px; }
.stats-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.stats-hero-title { margin-top: 4px; font-size: 18px; color: var(--text-strong); }
.stats-hero-head p { margin-top: 4px; }
.stats-scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
}
.stats-scope-badge svg { width: 14px; height: 14px; }
.stats-hero-number {
    margin: 16px 0 8px;
    color: var(--text-strong);
    font-size: 52px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}
.stats-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
}
.stats-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stats-trend svg { width: 13px; height: 13px; }
.stats-trend-up { color: var(--success); }
.stats-trend-down { color: var(--danger); }
.stats-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 650;
    color: var(--text-strong);
}
.stats-column-chart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(28px, 1fr);
    gap: 6px;
    height: 132px;
    margin-top: 12px;
    overflow-x: auto;
}
.stats-column {
    display: grid;
    grid-template-rows: auto minmax(60px, 1fr) auto;
    gap: 4px;
    min-width: 28px;
    text-align: center;
}
.stats-column-value {
    color: var(--text);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.stats-column-track {
    position: relative;
    min-height: 60px;
    border-radius: 6px 6px 2px 2px;
    background: var(--surface-2);
    overflow: hidden;
}
.stats-column-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: inherit;
    background: var(--primary);
    opacity: 0.9;
}
.stats-column-label {
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.stats-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stats-mini {
    display: grid;
    gap: 3px;
    padding: 12px;
}
.stats-mini-label { color: var(--muted); font-size: 11px; }
.stats-mini-value {
    color: var(--text-strong);
    font-size: 24px;
    line-height: 1.1;
    font-weight: 730;
    font-variant-numeric: tabular-nums;
}
.stats-mini-detail { color: var(--muted); font-size: 11px; }

.stats-analysis-grid { display: grid; gap: 12px; }
.stats-status-body { display: grid; gap: 16px; margin-top: 14px; align-items: center; }
.stats-donut-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.stats-donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.stats-donut-base,
.stats-donut-segment {
    fill: none;
    stroke-width: 5.5;
}
.stats-donut-base { stroke: var(--surface-3); }
.stats-donut-returned { stroke: var(--success); }
.stats-donut-awaiting { stroke: var(--warning); }
.stats-donut-early { stroke: var(--danger); }
.stats-donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    pointer-events: none;
}
.stats-donut-center strong {
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stats-donut-center span { color: var(--muted); font-size: 11px; }
.stats-status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stats-status-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}
.stats-status-dot { width: 9px; height: 9px; border-radius: 999px; }
.stats-dot-returned { background: var(--success); }
.stats-dot-awaiting { background: var(--warning); }
.stats-dot-early { background: var(--danger); }
.stats-status-copy { display: grid; gap: 1px; min-width: 0; }
.stats-status-copy strong { font-size: 12px; color: var(--text-strong); }
.stats-status-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.stats-rank-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.stats-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name value" "team value" "track track";
    gap: 3px 8px;
    align-items: center;
}
.stats-rank-name {
    grid-area: name;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-rank-team { grid-area: team; color: var(--muted); font-size: 11px; }
.stats-rank-value {
    grid-area: value;
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stats-rank-track {
    grid-area: track;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.stats-rank-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.stats-rank-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }

.stats-table-card { scroll-margin-top: 12px; }
.stats-share { display: grid; gap: 4px; min-width: 90px; font-variant-numeric: tabular-nums; }
.stats-share-track {
    height: 5px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.stats-share-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.stats-report-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px 2px 8px;
    color: var(--muted);
    font-size: 11px;
}
.stats-report-foot span { display: inline-flex; align-items: center; gap: 6px; }
.stats-report-foot svg { width: 14px; height: 14px; }

@media (min-width: 600px) {
    .entry-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stats-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-secondary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats-status-body { grid-template-columns: 150px minmax(0, 1fr); }
    .movement-pending-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

@media (min-width: 720px) {
    .stats-filter-bar {
        grid-template-columns: minmax(180px, 0.9fr) minmax(280px, 1.4fr) auto;
        align-items: end;
    }
    .movement-form-actions { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
}

@media (min-width: 1040px) {
    .stats-hero-grid { grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr); }
    .stats-secondary-grid { grid-template-columns: minmax(0, 1fr); }
    .stats-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-card {
    overflow: hidden;
}
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.table-scroll {
    overflow: auto;
}
table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.table thead th {
    text-align: left;
    padding: 10px 14px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-weight: 700;
}
.table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    transition: background var(--speed) var(--ease);
}
.table tbody tr:last-child td {
    border-bottom: 0;
}
.table tbody tr:hover td {
    background: var(--surface-2);
}
.table tbody tr:hover td:first-child {
    background: var(--surface-2);
}
.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--mono);
    white-space: nowrap;
}
.table .actions {
    text-align: right;
    white-space: nowrap;
}

/* Dense report tables: every column of a wide workbook table stays on screen. */
table.table.dense {
    font-size: 12px;
}
.table.dense thead th {
    padding: 7px 4px;
    font-size: 9px;
    letter-spacing: 0.04em;
    white-space: normal;
    vertical-align: bottom;
}
.table.dense tbody td {
    padding: 5px 4px;
}
.table.dense .cell-user {
    gap: 5px;
    min-width: 116px;
}
.table.dense .avatar.sm {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border-radius: 4px;
}
.table.dense .cell-user-name {
    font-size: 12px;
}
.table.dense .badge {
    min-height: 21px;
    font-size: 10px;
    padding: 1px 6px;
}
.table.dense .tiny {
    font-size: 10px;
}
.table.dense tfoot td {
    padding: 7px 8px;
    border-top: 2px solid var(--border-strong);
    background: var(--surface-2);
    font-weight: 700;
}
.table tbody td.rate-under {
    color: var(--danger);
    font-weight: 700;
    background: var(--danger-soft);
}
.empty {
    padding: 44px 16px;
    text-align: center;
    color: var(--muted);
}
.empty svg {
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.payroll-table tbody td {
    padding: 7px 10px;
}
.payroll-table thead th {
    padding: 8px 10px;
}
.cell-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 188px;
}
.cell-user-name {
    font-weight: 600;
}
.cell-user-sub {
    font-size: 11.5px;
    color: var(--muted);
    font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   Badges / pills
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-transform: none;
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border-strong);
    white-space: nowrap;
}
.badge-success,
.badge-present,
.badge-approved,
.badge-signed,
.badge-paid,
.badge-issued {
    background: var(--success-soft);
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.badge-warning,
.badge-late,
.badge-pending,
.badge-requested,
.badge-draft,
.badge-on-errand,
.badge-early-out {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}
.badge-danger,
.badge-absent,
.badge-rejected {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.badge-info {
    background: var(--info-soft);
    color: var(--info);
    border-color: color-mix(in srgb, var(--info) 30%, transparent);
}
.badge-secondary {
    background: var(--secondary-soft);
    color: var(--secondary);
    border-color: color-mix(in srgb, var(--secondary) 30%, transparent);
}
.badge-role-owner {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.badge-role-hr {
    background: var(--info-soft);
    color: var(--info);
    border-color: color-mix(in srgb, var(--info) 30%, transparent);
}
.badge-role-manager {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}
.badge-role-tl {
    background: var(--success-soft);
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.badge-role-supervisor {
    background: var(--secondary-soft);
    color: var(--secondary);
    border-color: color-mix(in srgb, var(--secondary) 30%, transparent);
}
.badge-role-employee {
    background: var(--surface-3);
    color: var(--muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    transition:
        border-color var(--speed) var(--ease),
        color var(--speed) var(--ease),
        background var(--speed) var(--ease);
}
a.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 7%, transparent);
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}
.tab {
    padding: 10px 16px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
        color var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    color: var(--accent-text);
    border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Modals (native dialog)
   -------------------------------------------------------------------------- */
dialog.modal {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 60px);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
dialog.modal.wide {
    width: min(940px, calc(100vw - 32px));
}
dialog.modal[open] {
    animation: modal-in 0.22s var(--ease);
}
@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
dialog.modal::backdrop {
    background: color-mix(in srgb, #040c19 68%, transparent);
    backdrop-filter: blur(4px);
}
.modal-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.modal-head::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--accent-bright),
        var(--primary),
        transparent
    );
}
.modal-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.modal-body {
    padding: 18px;
    overflow-y: auto;
    max-height: calc(100vh - 190px);
}
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.quick-find-trigger kbd {
    margin-left: 4px;
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
    color: var(--muted);
}
dialog.quick-find {
    width: min(560px, calc(100vw - 32px));
    margin-top: 12vh;
}
dialog.quick-find .modal-body {
    padding: 14px;
}
.quick-find-results {
    margin-top: 12px;
    display: grid;
    gap: 4px;
}
.quick-find-result {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    color: var(--text);
    text-decoration: none;
}
.quick-find-result:hover,
.quick-find-result:focus-visible {
    border-color: var(--border);
    background: var(--surface-2);
    outline: none;
}
@media (max-width: 720px) {
    .quick-find-label,
    .quick-find-trigger kbd {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Alerts / toasts
   -------------------------------------------------------------------------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}
.alert-success {
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
    border-left-color: var(--success);
    color: var(--success);
}
.alert-danger {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
    border-left-color: var(--danger);
    color: var(--danger);
}
.alert-warning {
    background: var(--warning-soft);
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
    border-left-color: var(--warning);
    color: var(--warning);
}
.alert-info {
    background: var(--info-soft);
    border-color: color-mix(in srgb, var(--info) 30%, transparent);
    border-left-color: var(--info);
    color: var(--info);
}
.alert ul {
    margin: 4px 0 0 16px;
    padding: 0;
}

.toast-stack {
    position: fixed;
    right: 20px;
    top: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
}
.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--primary);
    font-size: 13px;
    overflow: hidden;
    animation: toast-in 0.28s var(--ease);
}
.toast.success {
    border-color: var(--success);
}
.toast.error {
    border-color: var(--danger);
}
.toast button {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.toast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-bright), var(--primary));
    transform-origin: left;
    animation: toast-timer 6.5s linear forwards;
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes toast-timer {
    to {
        transform: scaleX(0);
    }
}

/* --------------------------------------------------------------------------
   Misc utilities
   -------------------------------------------------------------------------- */
.divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.spacer {
    flex: 1;
}
.kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
}
.kv + .kv {
    margin-top: 8px;
}
.progress {
    height: 8px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}
.progress span {
    display: block;
    height: 100%;
}
.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}
.legend i {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}
.bar-track {
    height: 10px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-bright), var(--primary));
    border-radius: 999px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination a,
.pagination span.page {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--mono);
    transition:
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        color var(--speed) var(--ease);
}
.pagination a:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}
.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}
.pagination .disabled {
    opacity: 0.45;
}
.pagination .page-info {
    margin-left: auto;
    border: 0;
    color: var(--muted);
    font-size: 12px;
}

.sheet {
    background: #fff;
    color: #111;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 26px;
    overflow-x: auto;
}
.sheet img {
    max-width: 100%;
}

.signature-wrap {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    touch-action: none;
}
.signature-wrap canvas {
    display: block;
    width: 100%;
    height: 160px;
    cursor: crosshair;
    border-radius: var(--radius-sm);
}

.print-only {
    display: none;
}

/* --------------------------------------------------------------------------
   Work hours grid
   -------------------------------------------------------------------------- */
.table-scroll.tall {
    max-height: calc(100vh - 260px);
    min-height: 260px;
}
.table-scroll.fill {
    max-height: calc(100dvh - 200px);
    min-height: 320px;
}
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}
.table-scroll.is-scrollable {
    box-shadow: inset -14px 0 14px -14px rgba(8, 19, 38, 0.28);
}

.work-hours-grid {
    min-width: max-content;
}

.work-hours-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-2);
}
.work-hours-grid .sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface);
    min-width: 218px;
    border-right: 1px solid var(--border);
}
.work-hours-grid thead .sticky-col {
    z-index: 4;
    background: var(--surface-2);
}
.work-hours-grid tbody tr:hover .sticky-col {
    background: var(--surface-2);
}

.work-hours-grid .day-col {
    min-width: 46px;
    padding: 5px 3px;
    text-align: center;
}
.work-hours-grid .day-col div:first-child {
    font-size: 11.5px;
    color: var(--text);
    font-weight: 700;
}
.work-hours-grid .day-cell {
    padding: 3px;
    text-align: center;
}
.work-hours-grid tbody td {
    padding: 2px 4px;
}
.work-hours-grid tbody .sticky-col {
    padding: 3px 8px;
}
.work-hours-grid tbody .cell-user {
    gap: 8px;
}

.work-hours-grid tbody tr[data-team] {
    --team-bg: hsl(var(--team-hue, 210) 58% 96.5%);
}
[data-theme="dark"] .work-hours-grid tbody tr[data-team] {
    --team-bg: hsl(var(--team-hue, 210) 24% 17%);
}

/* Leads, supervisors and managers get a deeper shade over their team hue. */
.work-hours-grid tbody tr[data-team][data-role="tl"],
.work-hours-grid tbody tr[data-team][data-role="supervisor"] {
    --team-bg: color-mix(
        in srgb,
        hsl(var(--team-hue, 210) 58% 96.5%) 74%,
        #16212f 26%
    );
}
.work-hours-grid tbody tr[data-team][data-role="manager"] {
    --team-bg: color-mix(
        in srgb,
        hsl(var(--team-hue, 210) 58% 96.5%) 62%,
        #16212f 38%
    );
}
[data-theme="dark"] .work-hours-grid tbody tr[data-team][data-role="tl"],
[data-theme="dark"]
    .work-hours-grid
    tbody
    tr[data-team][data-role="supervisor"] {
    --team-bg: color-mix(
        in srgb,
        hsl(var(--team-hue, 210) 24% 17%) 72%,
        #000 28%
    );
}
[data-theme="dark"] .work-hours-grid tbody tr[data-team][data-role="manager"] {
    --team-bg: color-mix(
        in srgb,
        hsl(var(--team-hue, 210) 24% 17%) 58%,
        #000 42%
    );
}

.work-hours-grid tbody tr[data-team] td,
.work-hours-grid tbody tr[data-team] .sticky-col {
    background: var(--team-bg);
}

/* Employees without a team still get the role shade. */
.work-hours-grid tbody tr:not([data-team])[data-role="tl"],
.work-hours-grid tbody tr:not([data-team])[data-role="supervisor"] {
    --role-bg: color-mix(in srgb, var(--surface) 74%, #16212f 26%);
}
.work-hours-grid tbody tr:not([data-team])[data-role="manager"] {
    --role-bg: color-mix(in srgb, var(--surface) 62%, #16212f 38%);
}
[data-theme="dark"] .work-hours-grid tbody tr:not([data-team])[data-role="tl"],
[data-theme="dark"]
    .work-hours-grid
    tbody
    tr:not([data-team])[data-role="supervisor"] {
    --role-bg: color-mix(in srgb, var(--surface) 76%, #000 24%);
}
[data-theme="dark"]
    .work-hours-grid
    tbody
    tr:not([data-team])[data-role="manager"] {
    --role-bg: color-mix(in srgb, var(--surface) 62%, #000 38%);
}
.work-hours-grid tbody tr:not([data-team])[data-role] td,
.work-hours-grid tbody tr:not([data-team])[data-role] .sticky-col {
    background: var(--role-bg);
}

/* Role rows keep their depth on hover and on weekend cells. */
.work-hours-grid tbody tr:not([data-team])[data-role="tl"]:hover td,
.work-hours-grid tbody tr:not([data-team])[data-role="tl"]:hover .sticky-col,
.work-hours-grid tbody tr:not([data-team])[data-role="supervisor"]:hover td,
.work-hours-grid
    tbody
    tr:not([data-team])[data-role="supervisor"]:hover
    .sticky-col,
.work-hours-grid tbody tr:not([data-team])[data-role="manager"]:hover td,
.work-hours-grid
    tbody
    tr:not([data-team])[data-role="manager"]:hover
    .sticky-col {
    background: color-mix(in srgb, var(--role-bg) 88%, var(--text) 5%);
}
.work-hours-grid tbody tr:not([data-team])[data-role="tl"] td.is-weekend,
.work-hours-grid
    tbody
    tr:not([data-team])[data-role="supervisor"]
    td.is-weekend,
.work-hours-grid tbody tr:not([data-team])[data-role="manager"] td.is-weekend {
    background: color-mix(in srgb, var(--role-bg) 72%, var(--secondary-soft));
}
.work-hours-grid tbody tr[data-team] td.is-weekend {
    background: color-mix(in srgb, var(--team-bg) 72%, var(--secondary-soft));
}
.work-hours-grid tbody tr[data-team]:hover td,
.work-hours-grid tbody tr[data-team]:hover .sticky-col {
    background: color-mix(in srgb, var(--team-bg) 88%, var(--text) 5%);
}
.work-hours-grid tbody tr[data-team]:hover td.is-weekend {
    background: color-mix(in srgb, var(--team-bg) 62%, var(--secondary-soft));
}
.work-hours-grid .cell-user-name .badge-me {
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 9px;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}
.work-hours-grid td.actions .btn-group {
    flex-wrap: nowrap;
}
.work-hours-grid td.actions .btn-xs {
    height: 26px;
    min-height: 26px;
    padding: 0 6px;
    font-size: 11px;
    gap: 4px;
}
.work-hours-grid td.actions .btn-xs svg {
    width: 15px;
    height: 15px;
}
.work-hours-grid .missing-input {
    padding: 3px 6px;
    font-size: 12px;
    min-height: 26px;
    height: 26px;
}
.work-hours-grid .day-input {
    width: 44px;
    min-width: 44px;
    height: 24px;
    min-height: 24px;
    padding: 2px;
    text-align: center;
    font-family: var(--mono);
    font-size: 11.5px;
    border-radius: 4px;
    background: transparent;
    border-color: transparent;
    transition:
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        color var(--speed) var(--ease);
    /* heat tint, JS sets --heat 0..1 */
    background: color-mix(
        in srgb,
        var(--primary) calc(var(--heat, 0) * 20%),
        transparent
    );
}
.work-hours-grid .day-input:hover {
    border-color: var(--border-strong);
    background: var(--surface);
}
.work-hours-grid .day-input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent),
        0 0 16px -4px color-mix(in srgb, var(--primary) 60%, transparent);
}
.work-hours-grid .day-input.is-filled {
    color: color-mix(in srgb, var(--text) 82%, var(--primary));
    font-weight: 700;
}
.work-hours-grid .is-weekend {
    background: color-mix(in srgb, var(--secondary-soft) 45%, transparent);
}
[data-theme="dark"] .work-hours-grid .is-weekend {
    background: color-mix(in srgb, var(--secondary) 14%, transparent);
}
.work-hours-grid .is-weekend .day-input {
    background: transparent;
}
.work-hours-grid .is-weekend .day-input:hover {
    background: var(--surface);
}

.work-hours-grid .day-col.is-today,
.work-hours-grid .day-cell.is-today {
    box-shadow: inset 0 0 0 1px
        color-mix(in srgb, var(--accent-bright) 55%, transparent);
}

.work-hours-grid tbody tr.is-locked .day-input {
    opacity: 0.65;
    cursor: not-allowed;
}
.work-hours-grid [data-hours-total] {
    font-family: var(--mono);
    font-size: 13px;
}
.work-hours-grid [data-hours-total].is-bumped {
    animation: value-bump 0.32s var(--ease);
}
@keyframes value-bump {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.14);
        color: var(--accent-text);
    }
    100% {
        transform: scale(1);
    }
}

/* Month stepper */
.period-nav {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}
.period-nav a,
.period-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    color: var(--muted);
    transition:
        background var(--speed) var(--ease),
        color var(--speed) var(--ease);
}
.period-nav a:hover {
    background: var(--surface-3);
    color: var(--primary);
}
.period-nav .period-label {
    width: auto;
    padding: 0 14px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Reveal-on-scroll (JS adds .is-revealed)
   -------------------------------------------------------------------------- */
[data-reveal] {
    transition:
        opacity 0.5s var(--ease),
        transform 0.5s var(--ease);
    transition-delay: calc(var(--reveal-i, 0) * 55ms);
}
html.js [data-reveal] {
    opacity: 0;
    transform: translateY(10px);
    will-change: opacity, transform;
}
html.js [data-reveal].is-revealed,
[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: var(--bg);
}
.login-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 20px;
    display: flex;
    align-items: center;
    color: #fff;
    background:
        radial-gradient(
            700px 420px at 15% 10%,
            rgba(34, 211, 238, 0.28),
            transparent 60%
        ),
        radial-gradient(
            600px 500px at 95% 100%,
            rgba(224, 178, 58, 0.22),
            transparent 60%
        ),
        linear-gradient(140deg, #040c19 0%, #0b2a72 58%, #0a4a63 100%);
}
.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 240, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 240, 255, 0.1) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 40% 45%, #000 20%, transparent 78%);
}
.login-hero::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -220px;
    border: 1px solid rgba(124, 240, 255, 0.28);
    border-radius: 50%;
    box-shadow:
        0 0 0 60px rgba(124, 240, 255, 0.06),
        0 0 0 130px rgba(124, 240, 255, 0.045),
        0 0 0 210px rgba(124, 240, 255, 0.03);
}
.login-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 470px;
}
.login-logo {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-weight: 800;
    font-size: 19px;
    color: #04101f;
    background: linear-gradient(140deg, #8ef0ff, #22d3ee 45%, #2563eb);
    clip-path: polygon(
        30% 0,
        70% 0,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0 70%,
        0 30%
    );
    box-shadow: 0 0 34px -6px rgba(34, 211, 238, 0.85);
    margin-bottom: 26px;
}
.login-hero h1 {
    font-size: 36px;
    line-height: 1.12;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}
.login-hero p {
    color: rgba(233, 240, 251, 0.82);
    font-size: 15px;
}
.login-features {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.login-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(124, 240, 255, 0.18);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    backdrop-filter: blur(4px);
}
.login-feature i {
    width: 6px;
    height: 6px;
    transform: rotate(45deg);
    background: var(--accent-bright);
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--accent-bright);
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        repeating-linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(45deg, rgba(59, 130, 246, 0.055) 0 1px, transparent 1px 28px),
        radial-gradient(700px 420px at 15% 10%, rgba(59, 130, 246, 0.16), transparent 60%),
        radial-gradient(600px 420px at 90% 90%, rgba(14, 116, 144, 0.12), transparent 60%),
        linear-gradient(180deg, #e4eefc 0%, #d5e3f7 100%);
}
[data-theme="dark"] .login-panel {
    background:
        repeating-linear-gradient(135deg, rgba(96, 165, 250, 0.045) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(45deg, rgba(59, 130, 246, 0.035) 0 1px, transparent 1px 28px),
        radial-gradient(700px 420px at 15% 10%, rgba(37, 99, 235, 0.16), transparent 60%),
        radial-gradient(600px 420px at 90% 90%, rgba(14, 116, 144, 0.12), transparent 60%),
        linear-gradient(180deg, #0b1628 0%, #0f1d33 100%);
}
.login-card {
    width: 100%;
    max-width: 384px;
}
.login-card h2 {
    font-size: 26px;
    margin-bottom: 4px;
    letter-spacing: -0.025em;
}
.login-card .sub {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 22px;
}
.demo-box {
    margin-top: 20px;
    padding: 13px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 12px;
    color: var(--muted);
}
.demo-box b {
    color: var(--text);
}
.demo-box div + div {
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Login slideshow
   -------------------------------------------------------------------------- */
.login-shell--slideshow {
    grid-template-columns: 1.15fr 1fr;
}
.login-slideshow {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 22px;
    background:
        repeating-linear-gradient(135deg, rgba(147, 197, 253, 0.14) 0 1px, transparent 1px 32px),
        repeating-linear-gradient(45deg, rgba(96, 165, 250, 0.10) 0 1px, transparent 1px 32px),
        radial-gradient(900px 500px at 20% 15%, rgba(59, 130, 246, 0.32), transparent 55%),
        radial-gradient(700px 500px at 80% 85%, rgba(56, 189, 248, 0.20), transparent 55%),
        linear-gradient(160deg, #0a2347 0%, #123a6b 45%, #0c2d52 100%);
}
.login-slideshow__frame {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: calc(100vh - 44px);
    border-radius: 28px;
    border: 1px solid rgba(147, 197, 253, 0.14);
    box-shadow:
        0 0 0 1px rgba(96, 165, 250, 0.06),
        0 20px 50px rgba(2, 8, 23, 0.38),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    background: #06162f;
    isolation: isolate;
}
.login-slideshow__slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.login-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 900ms ease, transform 6500ms ease;
    filter: saturate(0.92) brightness(0.88);
}
.login-slide.is-active {
    opacity: 1;
    transform: scale(1);
}
.login-slide--logo {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #ffffff;
    filter: none;
}
.login-slide--empty {
    background:
        radial-gradient(700px 420px at 15% 10%, rgba(34,211,238,.28), transparent 60%),
        radial-gradient(600px 500px at 95% 100%, rgba(224,178,58,.22), transparent 60%),
        linear-gradient(140deg, #040c19 0%, #0b2a72 58%, #0a4a63 100%);
}
.login-slide.login-slide--fx-logo {
    transform: scale(1.28);
    transition: opacity 1000ms ease, transform 7000ms cubic-bezier(0.22, 1, 0.36, 1);
}
.login-slide.login-slide--fx-logo.is-active {
    transform: scale(1);
}
.login-slide.login-slide--fx-zoom-in {
    transform: scale(1);
    transition: opacity 900ms ease, transform 7500ms ease-out;
}
.login-slide.login-slide--fx-zoom-in.is-active {
    transform: scale(1.10);
}
.login-slide.login-slide--fx-zoom-out {
    transform: scale(1.12);
    transition: opacity 900ms ease, transform 7500ms ease-out;
}
.login-slide.login-slide--fx-zoom-out.is-active {
    transform: scale(1);
}
.login-slide.login-slide--fx-pan-left {
    transform: scale(1.10) translate3d(3%, 0, 0);
    transition: opacity 900ms ease, transform 7500ms ease-out;
}
.login-slide.login-slide--fx-pan-left.is-active {
    transform: scale(1.10) translate3d(-3%, 0, 0);
}
.login-slide.login-slide--fx-pan-right {
    transform: scale(1.10) translate3d(-3%, 0, 0);
    transition: opacity 900ms ease, transform 7500ms ease-out;
}
.login-slide.login-slide--fx-pan-right.is-active {
    transform: scale(1.10) translate3d(3%, 0, 0);
}
.login-slideshow__gradient {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(90deg, rgba(4,14,32,0.30) 0%, rgba(5,18,40,0.46) 32%, rgba(6,22,50,0.68) 62%, rgba(3,10,24,0.84) 100%),
        linear-gradient(180deg, rgba(8,28,62,0.34) 0%, rgba(4,14,32,0.12) 30%, rgba(2,8,22,0.46) 72%, rgba(2,8,22,0.78) 100%),
        radial-gradient(120% 85% at 50% 45%, rgba(10,36,78,0.0) 35%, rgba(5,16,36,0.28) 68%, rgba(2,8,20,0.56) 100%);
    pointer-events: none;
}
.login-slideshow__bubbles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.login-bubble {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.32) 0 4%, rgba(255,255,255,0.14) 12%, rgba(147,197,253,0.12) 28%, rgba(59,130,246,0.07) 48%, rgba(2,10,28,0.08) 72%, rgba(255,255,255,0.02) 100%);
    box-shadow:
        inset -8px -10px 18px rgba(15, 56, 120, 0.10),
        inset 6px 8px 14px rgba(255,255,255,0.14),
        0 0 0 1px rgba(191,219,254,0.08);
    opacity: 0.34;
    mix-blend-mode: screen;
    will-change: transform;
}
.login-bubble.b1 { width: 72px; height: 72px; left: 8%; top: 12%; animation: bubble-float-a 18s ease-in-out infinite; }
.login-bubble.b2 { width: 108px; height: 108px; left: 72%; top: 8%; animation: bubble-float-b 23s ease-in-out infinite -4s; }
.login-bubble.b3 { width: 128px; height: 128px; left: 18%; top: 64%; animation: bubble-float-c 26s ease-in-out infinite -7s; }
.login-bubble.b4 { width: 84px; height: 84px; left: 62%; top: 58%; animation: bubble-float-d 20s ease-in-out infinite -2s; }
.login-bubble.b5 { width: 156px; height: 156px; left: 78%; top: 68%; animation: bubble-float-a 29s ease-in-out infinite -11s; }
.login-bubble.b6 { width: 56px; height: 56px; left: 42%; top: 28%; animation: bubble-float-b 16s ease-in-out infinite -5s; }
.login-bubble.b7 { width: 64px; height: 64px; left: 54%; top: 78%; animation: bubble-float-c 19s ease-in-out infinite -9s; }
.login-bubble.b8 { width: 96px; height: 96px; left: 3%; top: 46%; animation: bubble-float-d 24s ease-in-out infinite -13s; }
@keyframes bubble-float-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    25% { transform: translate3d(18px, -24px, 0) scale(1.03); }
    50% { transform: translate3d(-12px, -42px, 0) scale(0.98); }
    75% { transform: translate3d(22px, -16px, 0) scale(1.02); }
}
@keyframes bubble-float-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    20% { transform: translate3d(-20px, 18px, 0) scale(1.02); }
    45% { transform: translate3d(16px, -20px, 0) scale(0.97); }
    70% { transform: translate3d(-14px, -34px, 0) scale(1.04); }
    90% { transform: translate3d(10px, -8px, 0) scale(0.99); }
}
@keyframes bubble-float-c {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    30% { transform: translate3d(26px, -14px, 0) scale(1.03); }
    55% { transform: translate3d(8px, -38px, 0) scale(0.96); }
    80% { transform: translate3d(-18px, -20px, 0) scale(1.02); }
}
@keyframes bubble-float-d {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    20% { transform: translate3d(14px, 20px, 0) scale(0.98); }
    40% { transform: translate3d(-22px, -8px, 0) scale(1.03); }
    65% { transform: translate3d(10px, -30px, 0) scale(1.01); }
    85% { transform: translate3d(-16px, -12px, 0) scale(0.99); }
}
.login-slideshow__vignette {
    position: absolute;
    inset: 0;
    z-index: 3;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.05), inset 0 0 70px rgba(15, 56, 120, 0.22), inset 0 0 140px rgba(2, 10, 28, 0.34);
    background:
        radial-gradient(120% 100% at 50% 50%, rgba(30, 64, 175, 0.0) 52%, rgba(20, 58, 130, 0.10) 74%, rgba(4, 14, 34, 0.30) 100%),
        linear-gradient(90deg, rgba(59, 130, 246, 0.10) 0%, rgba(59, 130, 246, 0.0) 20%, rgba(59, 130, 246, 0.0) 80%, rgba(30, 64, 175, 0.12) 100%),
        linear-gradient(180deg, rgba(96, 165, 250, 0.06) 0%, rgba(96, 165, 250, 0.0) 22%, rgba(2, 8, 23, 0.0) 76%, rgba(15, 23, 42, 0.16) 100%);
    pointer-events: none;
}
.login-slideshow__frame:has(.login-slide--logo.is-active) .login-slideshow__gradient {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.0) 40%, rgba(6,22,47,0.08) 100%),
        radial-gradient(120% 90% at 50% 50%, rgba(255,255,255,0.0) 55%, rgba(15,40,80,0.08) 100%);
}
.login-slideshow__frame:has(.login-slide--logo.is-active) .login-slideshow__vignette {
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.06), inset 0 0 40px rgba(15, 56, 120, 0.08);
    background: radial-gradient(120% 100% at 50% 50%, rgba(255,255,255,0.0) 60%, rgba(15,40,80,0.06) 100%);
}
.login-slideshow__frame:has(.login-slide--logo.is-active) .login-slideshow__bubbles {
    opacity: 0.2;
}
.login-slideshow__content {
    position: relative;
    z-index: 4;
    height: 100%;
    min-height: calc(100vh - 44px);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 34px;
}
.login-slideshow__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    background: linear-gradient(135deg, rgba(8, 30, 66, 0.62), rgba(4, 14, 34, 0.48));
    border: 1px solid rgba(96, 165, 250, 0.28);
    backdrop-filter: blur(12px);
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(2, 8, 23, 0.35);
}
.login-slideshow__logo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(147, 197, 253, 0.3);
}
.login-slideshow__title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login-slideshow__sub {
    font-size: 13px;
    color: rgba(191, 219, 254, 0.84);
}

/* --------------------------------------------------------------------------
   Daily reports
   -------------------------------------------------------------------------- */
.report-section {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}
.report-section:first-of-type {
    border-top: 0;
    padding-top: 4px;
}
.report-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.report-section-title {
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.report-line {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: start;
    margin-bottom: 7px;
}
.report-line.no-time {
    grid-template-columns: minmax(0, 1fr) 30px;
}
.report-line .report-time {
    text-align: center;
    font-family: var(--mono);
}
.report-line .report-body {
    min-height: 38px;
    padding: 7px 10px;
}
.report-remove {
    align-self: start;
}
.report-add-section {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.presence-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.presence-row + .presence-row {
    margin-top: 6px;
}
.presence-row .btn {
    margin-left: auto;
}

.report-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
    flex-wrap: wrap;
}
.report-sheet-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.report-sheet-sub {
    font-size: 11.5px;
    color: #555;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.report-sheet-meta {
    font-size: 12.5px;
    line-height: 1.7;
    text-align: right;
}
.report-sheet-meta span {
    color: #666;
}
.report-sheet-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}
.report-sheet-kpis > div {
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    padding: 7px 9px;
}
.report-sheet-kpis span {
    display: block;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}
.report-sheet-kpis strong {
    display: block;
    font-size: 14px;
    margin-top: 2px;
}
.report-sheet-kpis em {
    display: block;
    font-size: 10.5px;
    font-style: normal;
    color: #555;
    margin-top: 2px;
}
.report-sheet-section {
    padding: 12px 0 4px;
    border-bottom: 1px solid #e6e6e6;
}
.report-sheet-section h2 {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    color: #222;
}
.report-sheet-line {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 4px 0;
    font-size: 13px;
}
.report-sheet-line:not(:has(.report-sheet-time)) {
    grid-template-columns: minmax(0, 1fr);
}
.report-sheet-time {
    font-family: var(--mono);
    font-size: 12px;
    color: #333;
    padding-top: 1px;
}
.report-sheet-body {
    white-space: normal;
    line-height: 1.5;
}
.report-sheet-label {
    display: inline-block;
    margin-right: 6px;
}
.report-sheet-foot {
    padding-top: 10px;
    font-size: 10.5px;
    color: #666;
    text-align: right;
}

@media (max-width: 900px) {
    .report-sheet-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .report-sheet-meta {
        text-align: left;
    }
    .report-line,
    .report-line.no-time {
        grid-template-columns: minmax(0, 1fr) 30px;
    }
    .report-line .report-time {
        grid-column: 1 / -1;
        max-width: 130px;
    }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
    .sidebar,
    .topbar,
    .no-print,
    .toast-stack,
    .pagination,
    .sidebar-backdrop {
        display: none !important;
    }
    .app-shell,
    .main {
        display: block;
        margin: 0;
    }
    .content {
        padding: 0;
    }
    body {
        background: #fff;
        color: #000;
    }
    .card,
    .table-card,
    .sheet {
        box-shadow: none;
        border: 0;
    }
    .card::before,
    .stat-card::before,
    .table-card::before {
        display: none;
    }
    .sheet {
        padding: 0;
    }
    .print-only {
        display: block;
    }
    a {
        color: #000;
        text-decoration: none;
    }
}

/* --------------------------------------------------------------------------
   Responsive

   Base styles are the phone layout. Wider layouts are layered on with
   min-width queries; max-width queries below are narrow refinements only.
   -------------------------------------------------------------------------- */
@media (min-width: 901px) {
    .main {
        margin-left: var(--sidebar-w);
    }
    .sidebar {
        width: var(--sidebar-w);
        transform: translateX(0);
        box-shadow: none;
    }
    .sidebar-backdrop {
        display: none;
    }
    body.sidebar-open {
        overflow: auto;
    }
    .content {
        width: 100%;
        max-width: calc(var(--content-max) + 2 * clamp(20px, 3vw, 40px));
        padding: 30px clamp(20px, 3vw, 40px);
    }
    .page {
        gap: 24px;
    }
    .login-shell {
        grid-template-columns: 1.05fr 1fr;
    }
    .login-hero {
        display: flex;
        padding: 56px;
    }
}
@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .content {
        padding: 18px;
    }
    .topbar {
        padding: 0 14px;
    }
    .login-hero {
        display: none;
    }
    .login-shell--slideshow .login-slideshow {
        min-height: 320px;
        order: 1;
        padding: 14px;
    }
    .login-slideshow__frame,
    .login-slideshow__content {
        min-height: 292px;
    }
    .login-slideshow__content {
        padding: 20px;
    }
    .login-slideshow__frame {
        border-radius: 20px;
    }
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    h1 {
        font-size: 21px;
    }
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .stat-card {
        padding: 13px;
    }
    .stat-value {
        font-size: 21px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .content {
        padding: 14px;
    }
    .page-actions {
        width: 100%;
    }
}

/* Theme icon switch */
.icon-sun {
    display: none;
}
[data-theme="dark"] .icon-moon {
    display: none;
}
[data-theme="dark"] .icon-sun {
    display: inline-block;
}

/* Smooth theme swap */
html.theme-switching,
html.theme-switching * {
    transition:
        background-color 0.25s var(--ease),
        border-color 0.25s var(--ease),
        color 0.25s var(--ease) !important;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    [data-reveal],
    html.js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* Enterprise presentation: restrained palette, clear data hierarchy, no glass or glow. */
:root {
    --bg: #f3f5f7;
    --bg-grid: transparent;
    --bg-glow: transparent;
    --surface: #fff;
    --surface-2: #f7f8fa;
    --surface-3: #eef1f4;
    --surface-glass: #fff;
    --text: #243247;
    --text-strong: #172438;
    --muted: #647184;
    --border: #dce2e8;
    --border-strong: #c5ced8;
    --primary: #24558a;
    --primary-hover: #1b426d;
    --primary-soft: #eaf0f6;
    --primary-deep: #1b426d;
    --accent: #39749a;
    --accent-bright: #39749a;
    --accent-soft: #eaf1f5;
    --accent-text: #285d7c;
    --secondary: #806b3e;
    --secondary-soft: #f3f0e8;
    --secondary-bright: #a58a50;
    --gold: #a58a50;
    --gold-text: #806b3e;
    --shadow-sm: 0 1px 2px rgba(23, 36, 56, 0.04);
    --shadow: 0 4px 14px rgba(23, 36, 56, 0.07);
    --shadow-lg: 0 14px 36px rgba(23, 36, 56, 0.14);
    --glow-primary: none;
    --glow-accent: none;
    --radius: 8px;
    --radius-lg: 10px;
    --font: "Segoe UI", Arial, sans-serif;
    --mono: "Segoe UI", Arial, sans-serif;
}
[data-theme="dark"] {
    --bg: #171d25;
    --bg-grid: transparent;
    --bg-glow: transparent;
    --surface: #202833;
    --surface-2: #252f3b;
    --surface-3: #303c4a;
    --surface-glass: #202833;
    --text: #e6ebf1;
    --text-strong: #f5f7fa;
    --muted: #a4b0be;
    --border: #35414e;
    --border-strong: #465565;
    --primary: #8eafd0;
    --primary-hover: #abc4dd;
    --primary-soft: #2a3a4b;
    --primary-deep: #23394f;
    --accent: #86b5ca;
    --accent-bright: #86b5ca;
    --accent-soft: #263b45;
    --accent-text: #a5c9d9;
    --secondary: #d0bd8a;
    --secondary-soft: #383528;
    --secondary-bright: #d0bd8a;
    --gold: #d0bd8a;
    --gold-text: #d0bd8a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.3);
    --glow-primary: none;
    --glow-accent: none;
}
body {
    background: var(--bg);
    font-family: var(--font);
    text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
.card-title,
.table thead th,
.kicker,
.today-label,
.stat-label,
.stat-value,
.badge,
.dropdown-head,
.pagination a,
.pagination span.page,
.login-logo {
    font-family: var(--font);
}
h1 {
    font-weight: 650;
    letter-spacing: -0.02em;
}
.sidebar {
    background: #202d3b;
    border-right: 1px solid #344353;
}
.sidebar::after,
.topbar::after,
.card::before,
.stat-card::before,
.table-card::before,
.modal-head::before,
.toast::after,
.kicker::before,
.nav-link.active::before,
.stat-card::after,
.login-hero::before,
.login-hero::after {
    display: none;
}
.brand-mark,
.login-logo {
    clip-path: none;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    box-shadow: none;
}
.avatar {
    background: var(--primary-soft);
    color: var(--primary-deep);
    box-shadow: none;
}
.nav-link.active {
    background: #34485c;
    border-color: #455c72;
    color: #fff;
    box-shadow: none;
}
.nav-link.active svg {
    color: #c2d5e7;
}
.topbar {
    background: var(--surface);
    backdrop-filter: none;
}
.today-label {
    text-transform: none;
    letter-spacing: 0;
}
.live-dot {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent);
    animation: none;
}
.card,
.stat-card,
.table-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card:hover,
.stat-card:hover,
.table-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}
.card-title,
.table thead th,
.stat-label,
.badge,
.dropdown-head,
.pagination a,
.pagination span.page {
    letter-spacing: 0.04em;
}
.badge {
    letter-spacing: 0.01em;
}
/* Free-text fields keep their sentence visible instead of hiding it in a one-line scroll. */
textarea.input-expanding {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    max-height: 132px;
    line-height: 1.45;
    resize: vertical;
    field-sizing: content;
}
.table.dense textarea.input-expanding {
    min-height: 30px;
    max-height: 96px;
    line-height: 1.35;
}
form.inline-expanding {
    display: grid;
    gap: 4px;
    width: 26ch;
    max-width: 100%;
}
textarea.notification-action-field {
    width: 26ch;
    max-width: 100%;
}
textarea.input-datalist {
    width: 100%;
    min-width: 24ch;
}
.stat-value,
[data-theme="dark"] .stat-value {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}
.stat-icon {
    clip-path: none;
    border-radius: 7px;
}
.btn-primary,
.btn-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: none;
}
.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--on-secondary);
}
.input:focus,
.select:focus,
.textarea:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.progress span,
.bar-fill {
    background: var(--primary);
}
.login-hero {
    background: #263b50;
}
.login-feature {
    backdrop-filter: none;
}

/* Higher contrast and fewer nested boxes; metrics read as one grouped section. */
:root {
    --bg: #e9edf2;
    --surface: #fff;
    --surface-2: #f1f4f7;
    --surface-3: #dfe5ed;
    --text: #1c2939;
    --text-strong: #142235;
    --muted: #536174;
    --border: #d5dde6;
    --border-strong: #b7c3d0;
    --primary: #1d4f7b;
    --primary-hover: #173f63;
    --primary-soft: #e1eaf2;
    --accent: #28658a;
    --accent-bright: #28658a;
    --accent-text: #205574;
    --shadow-sm: none;
    --shadow: 0 3px 10px rgba(23, 36, 56, 0.08);
}
[data-theme="dark"] {
    --bg: #151c25;
    --surface: #202a36;
    --surface-2: #283442;
    --surface-3: #344252;
    --text: #edf1f5;
    --text-strong: #fff;
    --muted: #b1bdca;
    --border: #344252;
    --border-strong: #4b5d70;
    --primary: #9dbbd7;
    --primary-hover: #b8cde0;
    --primary-soft: #2a3b4c;
    --accent: #9bc4d7;
    --accent-bright: #9bc4d7;
    --accent-text: #b6d5e3;
}
.content {
    padding: 18px 12px 28px;
}
.page {
    gap: 14px;
}
.page-head {
    align-items: center;
    margin-bottom: 2px;
}
.page-head h1 {
    font-size: 28px;
}
.page-head p {
    color: var(--muted);
    font-size: 14px;
}
.stat-grid {
    gap: 0;
    padding: 8px 0;
    border-radius: var(--radius);
    background: var(--surface);
}
.stat-card {
    min-width: 0;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}
.stat-card:hover {
    border-color: transparent;
    box-shadow: none;
}
.stat-label {
    color: var(--muted);
}
.stat-value,
[data-theme="dark"] .stat-value {
    color: var(--text-strong);
}
.card {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.card:hover {
    border-color: transparent;
    box-shadow: none;
}
.card-head {
    padding: 0 0 12px;
    border-bottom: 0;
}
.card-title {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
}
.card-pad {
    padding: 0;
}
.table-card {
    border: 0;
    box-shadow: none;
    background: var(--surface);
}
.table-card:hover {
    border-color: transparent;
    box-shadow: none;
}
.table thead th {
    background: var(--surface-2);
    color: var(--text);
}
.grid-2,
.grid-3,
.grid-4 {
    gap: 24px;
}
.nav-link.active {
    background: #344e67;
}

/* Professional interaction and responsive usability refinements. */
:root {
    --focus-ring: #155f9a;
    --content-max: 1600px;
    --control-height: 42px;
}
[data-theme="dark"] {
    --focus-ring: #a7c7e5;
}
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}
.icon-btn {
    width: 44px;
    height: 44px;
}
.btn,
.btn-sm {
    min-height: 40px;
}
.input,
.select {
    min-height: var(--control-height);
}
.content {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.page-head h1 {
    text-wrap: balance;
}
.page-head p,
.muted {
    color: var(--muted);
}
.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.stat-card + .stat-card {
    border-left: 1px solid var(--border);
}
.stat-icon {
    width: 40px;
    height: 40px;
}
.nav-link {
    min-height: 42px;
}
.nav-link:focus-visible,
.icon-btn:focus-visible,
.btn:focus-visible {
    outline-color: #b7d2eb;
    outline-offset: 1px;
}
.dropdown-menu {
    max-height: min(70vh, 520px);
    overflow-y: auto;
}
.table-scroll {
    max-width: 100%;
    overscroll-behavior-inline: contain;
}
.table {
    min-width: 620px;
}
.toast {
    line-height: 1.5;
}
.toast [data-toast-close] {
    min-width: 36px;
    min-height: 36px;
}
.btn:active,
.icon-btn:active,
.nav-link:active {
    transform: none;
    filter: brightness(0.94);
}
#main-content:focus {
    outline: none;
}
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 11px 16px;
    transform: translateY(-160%);
    background: #fff;
    color: #172438;
    border: 2px solid var(--focus-ring);
    border-radius: 5px;
    font-weight: 650;
    box-shadow: var(--shadow);
}
.skip-link:focus {
    transform: translateY(0);
}
.grid-2 > .card,
.grid-3 > .card,
.grid-4 > .card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
}
@media (max-width: 900px) {
    .grid-2 > .card,
    .grid-3 > .card,
    .grid-4 > .card {
        padding: 16px;
    }
}
@media (max-width: 640px) {
    .grid-2 > .card,
    .grid-3 > .card,
    .grid-4 > .card {
        padding: 14px;
    }
}
html {
    scroll-padding-top: calc(var(--topbar-h) + 12px);
}
@media (max-width: 900px) {
    .content {
        max-width: 100%;
    }
    .sidebar-backdrop {
        backdrop-filter: none;
    }
}
@media (max-width: 640px) {
    :root {
        --topbar-h: 58px;
    }
    .content {
        padding: 18px 16px 28px;
    }
    .page {
        gap: 20px;
    }
    .page-head {
        align-items: flex-start;
    }
    .page-head h1 {
        font-size: 24px;
    }
    .page-actions {
        gap: 8px;
    }
    .page-actions > * {
        max-width: 100%;
    }
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stat-card {
        padding: 15px 12px;
    }
    .stat-card + .stat-card {
        border-left: 0;
    }
    .stat-card:nth-child(even) {
        border-left: 1px solid var(--border);
    }
    .grid-2,
    .grid-3,
    .grid-4 {
        gap: 20px;
    }
    .filter-form {
        align-items: stretch;
    }
    .filter-form .field {
        flex: 1 1 145px;
        min-width: 0;
    }
    .filter-form .btn,
    .filter-form button {
        min-height: 44px;
    }
    .form-grid {
        gap: 0 12px;
    }
    .input,
    .select,
    .textarea {
        font-size: 16px;
    }
    .topbar {
        gap: 8px;
    }
    .topbar-left,
    .topbar-right {
        gap: 8px;
    }
    .today-label {
        max-width: min(46vw, 240px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
    }
    .live-clock {
        display: none;
    }
    .topbar-right > .dropdown:last-child > [data-dropdown-trigger] {
        max-width: 44px;
        min-width: 44px;
        overflow: hidden;
        padding: 0;
        justify-content: center;
    }
    .topbar-right > .dropdown:last-child > [data-dropdown-trigger] .nowrap {
        display: none;
    }
    .dropdown-menu {
        position: fixed;
        left: 12px;
        right: 12px;
        top: calc(var(--topbar-h) + 8px);
        width: auto;
        max-width: none;
        max-height: calc(100dvh - var(--topbar-h) - 24px);
    }
    .dropdown-menu.open {
        display: flex;
        flex-direction: column;
    }
    .dropdown-list {
        min-height: 0;
    }
    .profile-menu {
        left: auto;
        width: min(280px, calc(100vw - 24px));
    }
    .table-card {
        max-width: 100%;
    }
    .table thead th,
    .table tbody td {
        padding: 10px 12px;
    }
    .toast-stack {
        left: 12px;
        right: 12px;
        top: calc(var(--topbar-h) + 8px);
        max-width: none;
    }
}
@media (max-width: 380px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .stat-card:nth-child(even) {
        border-left: 0;
    }
    .stat-card + .stat-card {
        border-top: 1px solid var(--border);
    }
    .today-label {
        max-width: calc(100vw - 156px);
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Match the CETEMOH landing-page brand: institutional blue, gold, and red. */
:root {
    --primary: #1746a2;
    --primary-hover: #0d2f6e;
    --primary-deep: #0a1e3c;
    --primary-soft: #e7edf8;
    --accent: #c1121f;
    --accent-bright: #c1121f;
    --accent-soft: #f9e9eb;
    --accent-text: #9e0e18;
    --secondary: #806315;
    --secondary-soft: #f5f0df;
    --secondary-bright: #c9a227;
    --gold: #c9a227;
    --gold-text: #70580d;
    --info: #1746a2;
    --info-soft: #e7edf8;
    --focus-ring: #1746a2;
}
[data-theme="dark"] {
    --primary: #9bb6ec;
    --on-primary: #0a1e3c;
    --primary-hover: #bfd0f1;
    --primary-deep: #17376e;
    --primary-soft: #293852;
    --accent: #f08a91;
    --accent-bright: #f08a91;
    --accent-soft: #432a32;
    --accent-text: #ffadb2;
    --secondary: #e6c76a;
    --secondary-soft: #3b3421;
    --secondary-bright: #e6c76a;
    --gold: #e6c76a;
    --gold-text: #e6c76a;
    --info: #9bb6ec;
    --info-soft: #293852;
    --focus-ring: #b4cbf5;
}
/* One dashboard palette across every role: same brand blue, same surfaces. */
:root {
    --dash-primary: #1746a2;
    --dash-primary-hover: #0d2f6e;
    --dash-primary-soft: #e7edf8;
    --dash-primary-deep: #0a1e3c;
}
html[data-theme="dark"] {
    --dash-primary: #9bb6ec;
    --dash-primary-hover: #bfd0f1;
    --dash-primary-soft: #293852;
    --dash-primary-deep: #9bb6ec;
}
.nav-link.active {
    background: #193a66;
    color: #fff;
}
.nav-link.active svg {
    color: #e6c76a;
}
[data-theme="dark"] .nav-link.active {
    background: #304766;
}
.tone-info,
.badge-info,
.badge-role-hr {
    color: var(--primary);
}
.tone-info,
.badge-info {
    background: var(--primary-soft);
}
[data-theme="dark"] .tone-info,
[data-theme="dark"] .badge-info {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Dashboard layout inspired by Kapella's responsive admin widgets. */
.dashboard-page {
    gap: 24px;
}
/* TL/manager tone - shell only, the dashboard uses one shared palette. */
.role-tone-mid {
    --primary: #0369a1;
    --primary-hover: #075985;
    --primary-soft: #e0f2fe;
    --primary-deep: #0c4a6e;
}
[data-theme="dark"] .role-tone-mid {
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-soft: #082f49;
    --primary-deep: #0c4a6e;
}
.role-tone-mid .sidebar {
    --primary-soft: #163a5a;
    --accent-soft: #0b3045;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(56, 189, 248, 0.12), transparent 65%),
        linear-gradient(180deg, #071625 0%, #05111d 100%);
    background-color: #05111d;
    border-right-color: #16314a;
}
.role-tone-mid .sidebar::after {
    background: linear-gradient(180deg, transparent, rgba(56, 189, 248, 0.55), transparent);
}
.role-tone-mid .brand-mark {
    background: linear-gradient(140deg, #bae6fd 0%, #38bdf8 40%, #0369a1 100%);
}

/* Agent/supervisor tone - shell only, the dashboard uses one shared palette. */
.role-tone-light {
    --primary: #3185b3;
    --primary-hover: #2877a3;
    --primary-soft: #edf7fc;
    --primary-deep: #1f6490;
}
[data-theme="dark"] .role-tone-light {
    --primary: #67b8d8;
    --primary-hover: #85c9e3;
    --primary-soft: #102c3a;
    --primary-deep: #4aa3c8;
}
.role-tone-light .sidebar {
    --primary-soft: #2a5a72;
    --accent-soft: #245368;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(184, 220, 237, 0.14), transparent 65%),
        linear-gradient(180deg, #123247 0%, #0e2a3c 100%);
    background-color: #0e2a3c;
    border-right-color: #2a5e78;
}
.role-tone-light .sidebar::after {
    background: linear-gradient(180deg, transparent, rgba(184, 220, 237, 0.45), transparent);
}
.role-tone-light .brand-mark {
    background: linear-gradient(140deg, #edf8fc 0%, #cfeaf6 40%, #b8dced 100%);
}
.dashboard-head {
    align-items: center;
    padding: 4px 0 2px;
}
.dashboard-head .kicker {
    margin-bottom: 8px;
}
.dashboard-head h1 {
    font-size: clamp(2.25rem, 2.4vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}
.dashboard-head p {
    margin-top: 6px;
}
.dashboard-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-clock-chip {
    min-height: 40px;
    padding: 7px 12px;
    background: var(--surface);
    color: var(--text);
}
.dashboard-clock-chip svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}
.dashboard-clock-chip strong {
    font-variant-numeric: tabular-nums;
}
.dashboard-clock-divider {
    color: var(--gold-text);
}
.dashboard-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    background: transparent;
}
.dashboard-stat-grid .stat-card {
    min-height: 122px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.dashboard-stat-grid .stat-card:hover {
    border-color: var(--primary);
}
.dashboard-stat-grid .stat-label {
    font-size: 11px;
    letter-spacing: 0.055em;
}
.dashboard-stat-grid .stat-value {
    font-size: 29px;
}
.dashboard-stat-grid .stat-sub {
    font-size: 12px;
}
.dashboard-stat-grid .stat-icon {
    width: 40px;
    height: 40px;
}
.dashboard-overview-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: stretch;
    gap: 24px;
}
.dashboard-panel {
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.dashboard-panel:hover {
    border-color: var(--border-strong);
}
.dashboard-panel .card-head {
    min-height: 34px;
    padding: 0 0 14px;
    align-items: center;
}
.dashboard-section-title {
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 650;
}
.dashboard-panel-meta {
    color: var(--muted);
    font-size: 12px;
}
.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
}
.dashboard-action {
    min-width: 0;
    min-height: 48px;
    padding: 9px 11px;
    justify-content: flex-start;
    gap: 9px;
    color: var(--text);
    background: var(--surface-2);
    border-color: transparent;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.dashboard-action svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--primary);
}
.dashboard-action span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.dashboard-action:hover {
    background: var(--primary-soft);
    border-color: transparent;
    color: var(--primary);
}
.dashboard-actions-toggle {
    display: none;
}
.dashboard-actions-toggle[hidden] {
    display: none !important;
}
.dashboard-panel .kv {
    min-height: 42px;
    margin-top: 0;
    padding: 9px 2px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
}
.dashboard-panel .kv:last-child {
    border-bottom: 0;
}
.dashboard-warning-text {
    color: var(--warning);
}
.dashboard-note-value {
    max-width: 65%;
    text-align: right;
    overflow-wrap: anywhere;
}
.dashboard-activity {
    padding-bottom: 8px;
}
.dashboard-activity-table {
    min-width: 0;
}
.dashboard-activity-table td:first-child {
    width: 44px;
}
.dashboard-notification-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
}
.dashboard-activity-table .tiny {
    font-size: 12px;
}
.dashboard-activity-table td:last-child {
    width: 120px;
}
.dashboard-notification-title-cell {
    min-width: 0;
}
.dashboard-notification-title {
    display: block;
    max-width: 52ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-panel .empty {
    padding: 28px 16px;
}
@media (max-width: 1100px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-overview-grid {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
    }
    .dashboard-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .dashboard-page {
        gap: 18px;
    }
    .dashboard-head {
        gap: 12px;
    }
    .dashboard-head h1 {
        font-size: 25px;
    }
    .dashboard-head .kicker {
        font-size: 10px;
        letter-spacing: 0.08em;
    }
    .dashboard-head-actions {
        width: 100%;
    }
    .dashboard-overview-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .dashboard-panel {
        padding: 16px;
    }
    .dashboard-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .dashboard-actions-grid .dashboard-action:nth-child(n + 5) {
        display: none;
    }
    .dashboard-actions-grid.is-expanded .dashboard-action:nth-child(n + 5) {
        display: inline-flex;
    }
    .dashboard-actions-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 44px;
        margin-top: 10px;
        border: 0;
        border-top: 1px solid var(--border);
        background: transparent;
        color: var(--primary);
        font: inherit;
        font-size: 13px;
        font-weight: 650;
        cursor: pointer;
    }
    .dashboard-actions-toggle svg {
        width: 16px;
        height: 16px;
        transition: transform 0.18s ease;
    }
    .dashboard-actions-toggle[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
    .dashboard-activity-table td:last-child {
        width: auto;
    }
    .dashboard-activity-table .num {
        white-space: normal;
        text-align: right;
    }
}
@media (max-width: 380px) {
    .dashboard-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .dashboard-stat-grid .stat-card {
        min-height: 108px;
        padding: 12px 10px;
    }
    .dashboard-stat-grid .stat-value {
        font-size: 24px;
    }
    .dashboard-stat-grid .stat-icon {
        width: 34px;
        height: 34px;
    }
    .dashboard-actions-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard-actions-toggle svg {
        transition: none;
    }
}

/* Journées non prises — CETEMOH-style pending-call list inside the CDC dashboard. */
.pending-days-panel {
    border: 1px solid var(--border);
}
.pending-days-panel .card-head {
    border-bottom: 1px solid var(--border);
}
.pending-days-panel .card-head p {
    margin: 4px 0 0;
}
.presence-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    padding: 2px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.presence-state.is-empty {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}
.presence-state.is-partial {
    border-color: var(--warning);
    background: var(--warning-soft);
    color: var(--warning);
}
.pending-days-list {
    display: grid;
    gap: 5px;
    padding-top: 8px;
}
.pending-date {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 70px 12px;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pending-date:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.pending-date[data-state="missing"] { border-color: var(--danger); }
.pending-date[data-state="partial"] { border-color: var(--warning); }
.pending-date > svg {
    width: 12px;
    height: 12px;
    color: var(--primary);
}
.pending-date-when {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.pending-date-when strong {
    flex: 0 1 auto;
    color: var(--text-strong);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.2;
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-date-when small {
    flex: 0 1 auto;
    color: var(--muted);
    font-size: 10.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-date-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}
.pending-date-progress .pending-progress {
    display: inline-block;
    flex: 0 0 26px;
    width: 26px;
}
.pending-progress {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.pending-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}
@media (max-width: 760px) {
    .pending-date {
        grid-template-columns: minmax(0, 1fr) auto 12px;
        gap: 6px;
        padding: 5px 8px;
        min-height: 32px;
    }
    .pending-date-progress { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pending-date { transition: none; }
}

/* Password fields with visibility toggle (progressively added by app.js) */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-field > .input {
    padding-right: 40px;
}
.password-toggle {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.password-toggle:hover {
    background: var(--surface-3);
    color: var(--text);
}
.password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.badge-role-direction {
    background: var(--info-soft);
    color: var(--info);
}

/* Dense day-by-day attendance sheet */
.table-dense thead th,
.table-dense tbody td {
    padding: 5px 8px;
    font-size: 12.5px;
    line-height: 1.25;
    vertical-align: middle;
}
.table-dense tbody td .input-sm,
.table-dense tbody td .select {
    padding: 4px 6px;
    font-size: 12.5px;
}
.table-dense tbody tr:hover td {
    background: var(--surface-2);
}

/* Birthday banner: flat, token-driven, consistent with every dashboard card. */
.birthday-banner {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: var(--warning-soft);
    box-shadow: none;
}
.birthday-banner.is-today {
    border-color: var(--warning);
    background: var(--warning-soft);
    box-shadow: none;
}
.birthday-banner::after { display: none; }
.birthday-banner-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.birthday-banner-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.birthday-banner-icon,
.birthday-banner-cake {
    display: inline-flex;
    align-items: center;
    color: var(--warning);
    line-height: 1;
}
.birthday-banner-icon svg { width: 1.75rem; height: 1.75rem; }
.birthday-banner-cake svg { width: 1.25rem; height: 1.25rem; }
.birthday-banner-kicker {
    font-size: var(--dash-font-label);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warning);
}
.birthday-banner-heading {
    font-size: var(--dash-font-title);
    font-weight: 700;
    color: var(--text-strong);
    line-height: var(--dash-line-tight);
}
.birthday-banner-link {
    white-space: nowrap;
}
.birthday-banner-list {
    display: grid;
    gap: 8px;
}
.birthday-banner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.birthday-banner-item.is-today { border-color: var(--warning); }
.birthday-banner-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.birthday-banner-name {
    font-weight: 700;
    color: var(--text-strong);
}
.birthday-banner-meta {
    font-size: var(--dash-font-meta);
    color: var(--muted);
}
.birthday-banner-when {
    flex-shrink: 0;
}
@media (max-width: 720px) {
    .birthday-banner-head,
    .birthday-banner-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .birthday-banner-link {
        width: 100%;
        justify-content: center;
    }
}
@media (prefers-reduced-motion: no-preference) {
    .birthday-banner.is-today .birthday-banner-icon {
        animation: birthday-bounce 1.8s ease-in-out infinite;
    }
}
@keyframes birthday-bounce {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    30% {
        transform: translateY(-4px) rotate(-6deg);
    }
    60% {
        transform: translateY(1px) rotate(5deg);
    }
}

.report-metric {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    line-height: 1.35;
}
.report-metric .muted {
    font-size: 11px;
}

.agent-load {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
}
.agent-load--ok {
    background: color-mix(in srgb, var(--success) 18%, transparent);
    color: var(--success);
}
.agent-load--warn {
    background: color-mix(in srgb, var(--warning) 22%, transparent);
    color: var(--warning);
}
.agent-load--danger {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: var(--danger);
}
.agent-load--neutral {
    background: var(--surface-2);
    color: var(--muted);
}

/* load indicators moved to agent-load pill; no side-tab stripes */

.record-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
.record-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.record-card:hover {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.record-card__top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.record-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.record-card__date {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.45;
}
.record-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}
.record-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 14px;
}
.record-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--surface-alt, var(--bg)) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    border-radius: 10px;
}
.record-field span {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.record-field strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-line;
}
.record-field--wide {
    grid-column: span 2;
}
@media (max-width: 700px) {
    .record-card { padding: 16px; }
    .record-card__top { flex-direction: column; align-items: stretch; }
    .record-card__actions { justify-content: flex-start; }
    .record-field--wide { grid-column: span 1; }
}
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text);
    white-space: pre-wrap;
}
.record-card__empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.record-card.load-ok {
    background: color-mix(in srgb, var(--success) 8%, var(--surface));
}
.record-card.load-warn {
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}
.record-card.load-danger {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.record-card.load-neutral {
    background: var(--surface);
}

.record-card__note {
    text-align: center;
}
.stat-card {
    border: 1px solid var(--border-strong);
}
.annual-section {
    margin-top: 14px;
}
.annual-section .card-pad {
    padding-bottom: 6px;
}

.report-tabs {
    display: flex;
    gap: 6px;
    margin: 8px 0 12px;
}
.report-tab {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
}
.report-tab:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.report-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.infirmary-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.infirmary-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.infirmary-hero__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(88px, 1fr));
    gap: 6px 14px;
    font-size: 12px;
}
.infirmary-hero__meta div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.infirmary-hero__meta span {
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.infirmary-hero__meta strong {
    font-weight: 600;
}
.infirmary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.infirmary-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
}
.infirmary-section h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 10px;
}
@media (max-width: 760px) {
    .infirmary-grid {
        grid-template-columns: 1fr;
    }
    .infirmary-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

.infirmary-accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.infirmary-accordion__summary { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; }
.infirmary-accordion__summary::marker { display: none; }
.infirmary-accordion__title { flex: 1; min-width: 0; }
.infirmary-accordion__icon { flex-shrink: 0; color: var(--muted); transition: transform var(--speed-fast) var(--ease); }
.infirmary-accordion:open .infirmary-accordion__icon { transform: rotate(180deg); }
.infirmary-accordion__body { padding: 6px 16px 14px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; align-items: start; }
.kv { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kv span { font-size: 11.5px; color: var(--muted); }
.kv strong { font-size: 13px; font-weight: 500; text-align: right; word-break: break-word; }
@media (max-width: 760px) { .infirmary-accordion__body { grid-template-columns: 1fr; } }


.infirmary-patient-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .infirmary-patient-grid { grid-template-columns: 1fr; } }
.infirmary-patient-info-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.infirmary-patient-info-grid .kv strong { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .infirmary-patient-info-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Attendance overview — dashboard, topbar and dedicated pages
   ========================================================================== */

.dashboard-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dashboard-clock-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}
.dashboard-clock-chip svg { width: 14px; height: 14px; color: var(--primary); }
.dashboard-clock-chip strong { color: var(--text); font-weight: 650; }
.dashboard-clock-divider { color: var(--border-strong); }

.dashboard-priority-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
.dashboard-priority-grid > .dashboard-panel {
    display: flex;
    flex-direction: column;
    height: 234px;
}
.dashboard-priority-grid > .dashboard-panel .card-head,
.dashboard-priority-grid > .dashboard-panel .dashboard-panel-foot { flex-shrink: 0; }
.dashboard-priority-grid > .dashboard-panel .dashboard-panel-foot { margin-top: auto; }
.dashboard-priority-grid .pending-days-list,
.dashboard-priority-grid .dashboard-leaves-body { min-height: 0; overflow: auto; }
.dashboard-panel { min-width: 0; }
.dashboard-section-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.dashboard-panel-meta {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--muted);
}
.dashboard-panel-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.dashboard-panel-icon svg { width: 17px; height: 17px; }
.dashboard-panel-icon.is-info {
    color: var(--info);
    background: var(--info-soft);
}
.dashboard-panel-icon.is-success {
    color: var(--success);
    background: var(--success-soft);
}
.dashboard-panel-foot {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.dashboard-panel-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.dashboard-panel-foot a:hover { color: var(--primary-hover); }
.dashboard-panel-foot svg { width: 13px; height: 13px; }
.dashboard-all-clear {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
}

.dashboard-leaves-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.dashboard-leaves-panel { padding: 18px 22px; }
.dashboard-leaves-panel .card-head { padding-bottom: 10px; }
.dashboard-leaves-panel .dashboard-subhead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
@media (min-width: 1400px) {
    .dashboard-leaves-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
.dashboard-leaves-column { min-width: 0; }
.dashboard-subhead {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.dashboard-leave-list,
.pending-days-list,
.attendance-pending-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dashboard-leave-list,
.pending-days-list { gap: 5px; }
.attendance-pending-list { gap: 8px; }
.pending-days-list { padding-top: 8px; }
.dashboard-leave-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.dashboard-leave-item.is-upcoming { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.dashboard-leave-item .avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.dashboard-leave-item .badge { padding: 2px 7px; font-size: 11px; }
.dashboard-leave-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dashboard-leave-main strong {
    flex: 0 1 auto;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.2;
}
.dashboard-leave-main small { flex: 0 1 auto; font-size: 10.5px; }
.dashboard-leave-dates,
.dashboard-leave-countdown {
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
}
.pending-progress {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.dashboard-leave-progress {
    display: inline-block;
    flex: 0 0 26px;
    width: 26px;
    height: 4px;
    margin: 0;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.dashboard-leave-progress i,
.pending-progress i {
    display: block;
    height: 100%;
    width: var(--progress, 0%);
    border-radius: inherit;
    background: var(--primary);
}
.dashboard-empty-line {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
}
.dashboard-leaves-panel .card-head { gap: 8px; }
.dashboard-leaves-panel .card-head > div { min-width: 0; }
.dashboard-leave-main strong,
.dashboard-leave-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .dashboard-leaves-panel .card-head { align-items: flex-start; }
    .dashboard-panel[aria-labelledby="dashboard-team-leaves-title"] { padding: 14px; }
    .dashboard-leave-item {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px;
        min-height: 32px;
        padding: 4px 8px;
    }
    .dashboard-leave-dates,
    .dashboard-leave-main small { display: none; }
    .dashboard-leave-progress { flex-basis: 22px; width: 22px; }
    .dashboard-leave-countdown { font-size: 10px; }
}

.pending-date[data-state="missing"] { border-color: var(--danger); }
.pending-date[data-state="partial"] { border-color: var(--warning); }
.presence-state {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.presence-state.is-empty {
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
    color: var(--danger);
    background: var(--danger-soft);
}
.presence-state.is-partial {
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
    color: var(--warning);
    background: var(--warning-soft);
}

.dashboard-actions-primary {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.dashboard-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.dashboard-action svg { width: 15px; height: 15px; color: var(--muted); }
.dashboard-action:hover { border-color: var(--primary); background: var(--primary-soft); }
.dashboard-action.is-primary { border-color: var(--primary-soft); background: var(--primary-soft); color: var(--primary-deep); }
.dashboard-action.is-primary svg { color: var(--primary); }
.dashboard-actions-more {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.dashboard-actions-more > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.dashboard-actions-more > summary::-webkit-details-marker { display: none; }
.dashboard-actions-more > summary svg { width: 14px; height: 14px; }
.dashboard-actions-more[open] > summary svg { transform: rotate(180deg); }
.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.dashboard-warning-text { color: var(--warning); }
.dashboard-note-value { text-align: right; font-size: 12.5px; }
.dashboard-notification-type { width: 40px; }
.dashboard-notification-icon { width: 30px; height: 30px; }

/* Topbar shortcut: one entry per actionable date, available to leads and managers. */
.attendance-pending-trigger { position: relative; }
.attendance-pending-menu { min-width: 300px; max-width: 360px; }
.attendance-pending-total { color: var(--muted); font-size: 11px; }
.attendance-pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    color: inherit;
    text-decoration: none;
}
.attendance-pending-item:hover { background: var(--primary-soft); }
.attendance-pending-item-main { display: grid; gap: 2px; min-width: 0; }
.attendance-pending-item-main strong { font-size: 12px; font-weight: 650; }
.attendance-pending-item-main small { color: var(--muted); font-size: 10.5px; }

.attendance-pending-range { display: flex; gap: 6px; flex-wrap: wrap; }
.attendance-pending-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 1fr) minmax(180px, 1.4fr) auto;
    align-items: center;
    gap: 16px;
}
.attendance-pending-row[data-state="missing"] { border-left: 3px solid var(--danger); }
.attendance-pending-row[data-state="partial"] { border-left: 3px solid var(--warning); }
.attendance-pending-row-date { display: grid; gap: 3px; }
.attendance-pending-row-date strong { font-size: 13px; font-weight: 650; }
.attendance-pending-row-state { display: grid; gap: 6px; justify-items: start; }
.attendance-pending-row-state .pending-progress { width: 100%; }
.attendance-pending-row-detail { display: grid; gap: 4px; justify-items: start; }
.attendance-pending-row-detail .badge { font-size: 10px; }
.attendance-pending-row-action { display: flex; justify-content: flex-end; }

.calendar-weekday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 14px;
}
.calendar-weekday {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.calendar-weekday:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-deep);
}
.attendance-calendar-form { display: grid; gap: 14px; max-width: 860px; }
.attendance-calendar-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .attendance-pending-row { grid-template-columns: minmax(140px, 1fr) minmax(130px, 1fr) auto; }
    .attendance-pending-row-detail { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .dashboard-priority-grid,
    .dashboard-leaves-body { grid-template-columns: 1fr; }
    .attendance-pending-item { padding: 7px 10px; }
}
@media (max-width: 640px) {
    .pending-date { grid-template-columns: minmax(0, 1fr) auto 14px; }
    .pending-date-progress { display: none; }
    .dashboard-actions-grid { grid-template-columns: 1fr; }
    .attendance-pending-row { grid-template-columns: 1fr; }
    .attendance-pending-row-action { justify-content: flex-start; }
    .attendance-pending-menu { min-width: min(320px, calc(100vw - 24px)); }
}

/* ==========================================================================
   Movements — autocomplete, filters and workbook import
   ========================================================================== */

.movements-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}
.movement-agent-field { padding-bottom: 12px; }
.movement-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 10px);
    z-index: 30;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.movement-suggestion {
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}
.movement-suggestion:hover,
.movement-suggestion.is-active { background: var(--primary-soft); color: var(--primary-deep); }
.movement-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin: 14px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.movement-filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.field-error { margin-top: 4px; color: var(--danger); font-size: 11.5px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.movement-import-form { max-width: 480px; margin-top: 14px; display: grid; gap: 12px; }
.movement-import-preview { margin-top: 16px; }
.movement-import-table { min-width: 1000px; }
.movement-import-table td { vertical-align: top; }
.movement-import-table tr.has-issue { background: color-mix(in srgb, var(--warning) 6%, var(--surface)); }
.movement-import-table .select,
.movement-import-table .att-select { min-width: 210px; }
.movement-import-reason { max-width: 260px; overflow-wrap: anywhere; }
.movement-import-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

@media (min-width: 640px) {
    .field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
    .movement-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .movement-filter-actions { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
    .movements-grid { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
    .movement-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .movement-filter-actions { grid-column: auto; }
}

/* ==========================================================================
   Dashboard — single command card: metric rail + actions + day status
   ========================================================================== */

.dashboard-command {
    display: flex;
    flex-direction: column;
    min-height: 234px;
    padding: 14px 18px;
}
.dashboard-command .card-head {
    min-height: 0;
    padding-bottom: 8px;
}
.dashboard-command .dashboard-metric-rail,
.dashboard-command .dashboard-command-actions { flex: 0 0 auto; }
.dashboard-command .dashboard-day-strip { margin-top: auto; }
.dashboard-command .dashboard-panel-meta {
    margin: 2px 0 0;
}
.dashboard-command-notice {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--warning-soft);
    border-radius: var(--radius-sm);
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 11.5px;
}

.dashboard-metric-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(96px, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow-x: auto;
    scrollbar-width: thin;
}
.dashboard-metric {
    position: relative;
    min-width: 0;
    min-height: 72px;
    padding: 6px 10px;
    border-right: 1px solid var(--border);
    background: transparent;
    color: inherit;
}
.dashboard-metric:last-child { border-right: 0; }
.dashboard-metric.is-lead { background: var(--surface); }
.dashboard-metric-link {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-right: 16px;
    color: inherit;
    text-decoration: none;
}
.dashboard-metric-link:hover .dashboard-metric-label { color: var(--primary); }
.dashboard-metric-label,
.dashboard-metric-value,
.dashboard-metric-sub {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-metric-label {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}
.dashboard-metric-value {
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.dashboard-metric-sub {
    color: var(--muted);
    font-size: 9.5px;
}
.dashboard-metric.is-lead .dashboard-metric-label { color: var(--text); }
.dashboard-metric.is-lead .dashboard-metric-value {
    font-size: 1.5rem;
    line-height: 1.1;
}
.dashboard-metric-icon {
    position: absolute;
    top: 6px;
    right: 7px;
    display: inline-flex;
    opacity: 0.6;
}
.dashboard-metric-icon svg { width: 13px; height: 13px; }
.dashboard-metric[class*="tone-"] .dashboard-metric-icon { color: var(--muted); }
.dashboard-metric.tone-warning .dashboard-metric-icon { color: var(--warning); }
.dashboard-metric.tone-danger .dashboard-metric-icon { color: var(--danger); }
.dashboard-metric-pay {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 5px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}
.dashboard-metric-pay:hover { color: var(--primary); }
.dashboard-metric-pay svg { width: 12px; height: 12px; }

.dashboard-command-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.dashboard-command-actions .dashboard-action {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 4px 8px;
    gap: 6px;
    border-color: var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 600;
}
.dashboard-command-actions .dashboard-action svg {
    width: 13px;
    height: 13px;
    color: var(--muted);
}
.dashboard-command-actions .dashboard-action:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}
.dashboard-command-actions .dashboard-action.is-primary {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-weight: 700;
}
.dashboard-command-actions .dashboard-action.is-primary:hover {
    border-color: var(--primary-hover);
    background: var(--primary-soft);
    color: var(--primary-deep);
}
.dashboard-command-actions .dashboard-action.is-primary svg { color: var(--primary-deep); }
.dashboard-metric-link:focus-visible,
.dashboard-command-actions .dashboard-action:focus-visible,
.dashboard-metric-pay:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.dashboard-command-actions .dashboard-action.is-icon {
    width: 28px;
    padding: 4px 0;
    justify-content: center;
}
.dashboard-command-actions .dashboard-action.is-icon span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.dashboard-day-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11.5px;
}
.dashboard-day-label {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.dashboard-day-facts {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}
.dashboard-day-facts strong {
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}
.dashboard-day-note strong { font-variant-numeric: normal; }
.dashboard-day-empty { color: var(--text); }
.dashboard-day-hint { font-size: 10.5px; }

/* Notifications stay the compact reference row across the dashboard. */
.dashboard-activity .card-head { padding-bottom: 8px; }
.dashboard-activity-table td:first-child { width: 34px; }
.dashboard-activity-table tbody tr { height: 34px; }
.dashboard-activity-table tbody td { padding: 5px 8px; }
.dashboard-activity-table .dashboard-notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}
.dashboard-activity-table .tiny { font-size: 11px; }
.dashboard-activity-table .dashboard-notification-title { max-width: none; }

@media (max-width: 760px) {
    .dashboard-command { padding: 14px; }
    .dashboard-metric-rail { grid-auto-columns: minmax(132px, 45%); }
    .dashboard-command-actions { flex-wrap: wrap; overflow: visible; }
    .dashboard-day-strip { align-items: flex-start; }
}
@media (max-width: 380px) {
    .dashboard-metric-rail { grid-auto-columns: minmax(126px, 70%); }
}

/* ==========================================================================
   Dashboard — one type scale, one palette, one card rhythm
   ========================================================================== */
.dashboard-page {
    --dash-font-display: clamp(2.25rem, 2.4vw, 2.5rem);
    --dash-font-title: 1rem;
    --dash-font-body: 0.875rem;
    --dash-font-meta: 0.75rem;
    --dash-font-label: 0.6875rem;
    --dash-font-value: 1.125rem;
    --dash-font-lead: 1.5rem;
    --dash-line-tight: 1.2;
    --dash-line-body: 1.5;
    --dash-gap: 24px;
    --dash-gap-sm: 12px;
    --dash-card-padding: 18px 22px;
    --dash-card-height: 234px;

    --primary: var(--dash-primary);
    --primary-hover: var(--dash-primary-hover);
    --primary-soft: var(--dash-primary-soft);
    --primary-deep: var(--dash-primary-deep);

    gap: var(--dash-gap);
    color: var(--text);
    font-size: var(--dash-font-body);
    line-height: var(--dash-line-body);
}

.dashboard-page .card:not(.birthday-banner),
.dashboard-page .dashboard-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.dashboard-page .card:not(.birthday-banner):hover,
.dashboard-page .dashboard-panel:hover {
    border-color: var(--border-strong);
}
.dashboard-page .dashboard-panel,
.dashboard-page .dashboard-all-clear {
    padding: var(--dash-card-padding);
}
.dashboard-page .dashboard-priority-grid > .dashboard-panel {
    height: var(--dash-card-height);
}
.dashboard-page .dashboard-command {
    min-height: var(--dash-card-height);
    padding: var(--dash-card-padding);
}

.dashboard-page .kicker,
.dashboard-page .dashboard-subhead,
.dashboard-page .dashboard-metric-label,
.dashboard-page .dashboard-day-label {
    color: var(--muted);
    font-size: var(--dash-font-label);
    font-weight: 700;
    line-height: var(--dash-line-tight);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.dashboard-page .dashboard-head h1 {
    color: var(--text-strong);
    font-size: var(--dash-font-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.dashboard-page .dashboard-head p,
.dashboard-page .dashboard-panel-meta {
    color: var(--muted);
    font-size: var(--dash-font-meta);
    line-height: 1.4;
}
.dashboard-page .dashboard-section-title,
.dashboard-page .birthday-banner-heading {
    color: var(--text-strong);
    font-size: var(--dash-font-title);
    font-weight: 700;
    line-height: var(--dash-line-tight);
    letter-spacing: -0.01em;
}

.dashboard-page .dashboard-metric-value {
    color: var(--text-strong);
    font-size: var(--dash-font-value);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.dashboard-page .dashboard-metric.is-lead .dashboard-metric-value {
    font-size: var(--dash-font-lead);
    line-height: 1.1;
}
.dashboard-page .dashboard-metric-sub,
.dashboard-page .dashboard-day-hint,
.dashboard-page .dashboard-leave-dates,
.dashboard-page .dashboard-leave-countdown,
.dashboard-page .pending-date-when small,
.dashboard-page .dashboard-leave-main small {
    color: var(--muted);
    font-size: var(--dash-font-meta);
}
.dashboard-page .dashboard-leave-main strong,
.dashboard-page .pending-date-when strong {
    color: var(--text-strong);
    font-size: var(--dash-font-body);
    font-weight: 650;
    line-height: var(--dash-line-tight);
}
.dashboard-page .dashboard-notification-title {
    color: var(--text-strong);
    font-size: var(--dash-font-meta);
}
.dashboard-page .presence-state,
.dashboard-page .dashboard-leave-item .badge {
    font-size: var(--dash-font-label);
    padding: 3px 8px;
}

.dashboard-page .dashboard-priority-grid {
    gap: var(--dash-gap-sm);
    margin-bottom: 0;
    align-items: stretch;
}
.dashboard-page .dashboard-leaves-body,
.dashboard-page .pending-days-list {
    gap: var(--dash-gap-sm);
    margin-top: var(--dash-gap-sm);
    padding-top: 0;
}
.dashboard-page .dashboard-panel-foot {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.dashboard-page .dashboard-command .card-head {
    padding-bottom: 4px;
}
.dashboard-page .dashboard-command-actions {
    gap: 6px;
    margin-top: 8px;
}
.dashboard-page .dashboard-command-actions .dashboard-action {
    font-size: var(--dash-font-meta);
}
.dashboard-page .dashboard-day-strip {
    margin-top: auto;
    padding-top: 8px;
}
.dashboard-page .dashboard-panel-icon.is-info {
    color: var(--info);
    background: var(--info-soft);
}
.dashboard-page .dashboard-panel-icon.is-success {
    color: var(--success);
    background: var(--success-soft);
}
.dashboard-page .dashboard-warning-text {
    color: var(--warning);
}

@media (max-width: 760px) {
    .dashboard-page {
        --dash-gap: 18px;
        --dash-card-padding: 16px;
    }
    .dashboard-page .dashboard-priority-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Phone layout is the base above; only wider screens get the single-row bar. */
@media (min-width: 721px) {
    .topbar {
        height: var(--topbar-h);
        min-height: 0;
        flex-wrap: nowrap;
        gap: 16px;
        padding: 0 24px;
    }
    .topbar-left,
    .topbar-right {
        gap: 10px;
    }
    .topbar-right {
        flex-wrap: nowrap;
    }
}

