/* ==================================================================
   Timesheet & Holiday Manager — "Presence" design system
   Indigo app-shell · Space Grotesk + Inter · mobile-first
================================================================== */

:root {
    --ink: #13152B;
    --ink-2: #474C66;
    --muted: #888EA6;
    --line: #E7E8F1;
    --line-2: #F1F2F8;
    --canvas: #F3F4F9;
    --surface: #FFFFFF;
    --surface-2: #F8F9FC;

    --brand: #4B45D1;
    --brand-600: #3F39C0;
    --brand-700: #332E9E;
    --brand-tint: #ECEBFB;

    --ok: #0F9268;        --ok-tint: #E4F4EE;
    --warn: #C2780F;      --warn-tint: #FAF0DC;
    --danger: #D14444;    --danger-tint: #FBEAEA;
    --ot: #2563C9;        --ot-tint: #E7EFFB;

    --sidebar-1: #221F47;
    --sidebar-2: #16142E;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(20,22,43,.06), 0 1px 3px rgba(20,22,43,.05);
    --shadow-md: 0 6px 22px rgba(20,22,43,.08);
    --shadow-lg: 0 18px 50px rgba(20,22,43,.16);

    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--canvas);
    line-height: 1.55;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
h2 { font-size: 1.15rem; margin: 0 0 .2rem; }
h3 { font-size: 1rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.status-ok { color: var(--ok); }
.status-bad { color: var(--danger); }

/* tabular figures everywhere numbers matter */
.data-table, .ts-totals, .clock-today, .clock-since, .detail strong, .cal-date, .stat { font-variant-numeric: tabular-nums; }

/* ---------- Brand mark ---------- */
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: linear-gradient(150deg, #6C63FF, #3F39C0);
    position: relative;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark::after {
    content: "";
    position: absolute; inset: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.85);
    border-top-color: transparent;
}
.brand-word { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

/* ==================================================================
   App shell
================================================================== */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-1), var(--sidebar-2));
    color: #C9CBE3;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 50;
    overflow-y: auto;
}
.sidebar::before {
    /* faint aurora glow at the top */
    content: "";
    position: absolute; top: -60px; left: -40px; right: -40px; height: 180px;
    background: radial-gradient(60% 100% at 30% 0%, rgba(108,99,255,.45), transparent 70%);
    pointer-events: none;
}
.sidebar-brand, .topbar-brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; text-decoration: none;
    font-size: 1.05rem;
    padding: 6px 8px 16px;
}
.sidebar-brand:hover, .topbar-brand:hover { text-decoration: none; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group {
    margin: 16px 10px 6px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6F72A0;
    font-weight: 600;
}
.nav-group:first-child { margin-top: 4px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #BFC2DE;
    font-weight: 500;
    font-size: .92rem;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link .icon { opacity: .8; }
.nav-link.is-active { background: rgba(255,255,255,.10); color: #fff; }
.nav-link.is-active .icon { opacity: 1; color: #9d97ff; }
.nav-link--button { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-meta strong { color: #fff; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: #8A8DBA; font-size: .75rem; text-transform: capitalize; }

.avatar {
    width: 36px; height: 36px; flex: 0 0 auto;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(150deg, #6C63FF, #3F39C0);
    color: #fff; font-weight: 600; font-size: .82rem;
    font-family: var(--font-display);
}
.avatar--sm { width: 32px; height: 32px; font-size: .76rem; }

.scrim { display: none; }

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar { display: none; }

.content {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 28px 40px;
    animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.app-footer { text-align: center; color: var(--muted); padding: 16px; font-size: .8rem; }

/* Auth (login) shell */
.app--auth { background:
    radial-gradient(80% 60% at 50% -10%, #2a2658 0%, transparent 60%),
    linear-gradient(180deg, #1a1838, #13152B);
    min-height: 100vh; }
.auth-shell {
    max-width: 420px; margin: 0 auto;
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 28px 20px 40px; gap: 14px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; justify-content: center; margin-bottom: 6px; font-size: 1.15rem; }

/* ==================================================================
   Cards
================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }
.card-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h1, .card-head h2 { margin: 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ==================================================================
   Buttons
================================================================== */
.btn {
    --b: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--b);
    color: #fff;
    font-family: var(--font-body);
    font-size: .95rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.btn:hover { background: var(--brand-600); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brand-tint); outline-offset: 1px; }

.btn-link {
    background: transparent; color: var(--ink-2); box-shadow: none;
    border-color: var(--line); min-height: 40px;
}
.btn-link:hover { background: var(--surface-2); color: var(--ink); transform: none; box-shadow: none; }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b83838; }
.btn-danger-link { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; font-weight: 600; padding: 4px; }
.btn-danger-link:hover { text-decoration: underline; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; border-radius: 10px;
    color: var(--ink); cursor: pointer; background: transparent; border: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon { display: inline-block; vertical-align: -0.18em; }

/* ==================================================================
   Forms
================================================================== */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink); }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .95rem; font-family: inherit; color: var(--ink);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}
.form-group { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--font-body); font-weight: 700; margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.form-actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: .82rem; }
.form-aside { margin-top: 14px; text-align: center; }

/* ==================================================================
   Alerts
================================================================== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid transparent; font-size: .92rem; font-weight: 500; }
.alert-success { background: var(--ok-tint); border-color: #BCE6D5; color: #0B5F45; }
.alert-error { background: var(--danger-tint); border-color: #F1C9C9; color: #972929; }
.app--auth .alert { box-shadow: var(--shadow-md); }

/* ==================================================================
   Badges (presence language: a leading dot)
================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px 3px 9px;
    border-radius: 999px;
    font-size: .75rem; font-weight: 600;
    text-transform: capitalize;
    background: var(--line-2); color: var(--ink-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-late { background: var(--danger-tint); color: var(--danger); }
.badge-ot { background: var(--ot-tint); color: var(--ot); }
.badge-lg { font-size: .9rem; padding: 6px 14px 6px 12px; }
.badge-lg::before { width: 9px; height: 9px; }

/* ==================================================================
   Tables
================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.data-table thead th { background: var(--surface-2); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; position: sticky; top: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table input[type="checkbox"] { width: auto; min-height: 0; margin: 0; accent-color: var(--brand); }
.row-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ==================================================================
   Filter bars
================================================================== */
.filter-bar, .report-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filter-bar input, .filter-bar select, .report-filters input, .report-filters select { width: auto; }
.report-filters .form-group { margin-bottom: 0; }
.form-group-actions { align-self: flex-end; }

/* ==================================================================
   Stat strip (totals / today)
================================================================== */
.ts-totals, .clock-today {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.ts-totals > div, .clock-today > div {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.ts-totals span, .clock-today span { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.ts-totals strong, .clock-today strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }

/* ==================================================================
   Detail grid (profile)
================================================================== */
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.profile-name { margin: 0 0 4px; }
.photo-lg { width: 92px; height: 92px; border-radius: 20px; object-fit: cover; border: 1px solid var(--line); }
.photo-placeholder { display: grid; place-items: center; background: linear-gradient(150deg, #6C63FF, #3F39C0); color: #fff; font-family: var(--font-display); font-size: 2rem; font-weight: 600; }
.photo-thumb { width: 84px; height: 84px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }
.detail { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.detail span { color: var(--muted); font-size: .9rem; }
.detail strong { text-align: right; font-weight: 600; }

.danger-zone { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Working-day checkboxes */
.day-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.day-check { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .9rem; margin: 0; user-select: none; }
.day-check label { margin: 0; }
.day-check input { width: auto; min-height: 0; margin: 0; accent-color: var(--brand); }
.day-check:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-700); }

/* Placeholder / quick-link tiles */
.placeholder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 4px; }
.placeholder-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; font-weight: 600; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .12s; }
a.placeholder-tile:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.placeholder-tile small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); }

/* ==================================================================
   Clock widget — hero presence card
================================================================== */
.clock-widget { text-align: center; padding: 8px 0 4px; }
.clock-status { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.clock-since { color: var(--muted); margin: 4px 0 18px; font-size: .95rem; }
.clock-since [data-since] { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

.clock-today { max-width: 360px; margin: 0 auto 22px; }
.clock-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.clock-actions form { margin: 0; }
.clock-hint { width: 100%; margin: 4px 0 0; }

.btn-clock { min-height: 56px; font-size: 1.05rem; padding: 0 26px; min-width: 160px; border-radius: 14px; }
.btn-clock-in { --b: var(--ok); }
.btn-clock-in:hover { background: #0c7d59; }
.btn-clock-out { --b: var(--danger); }
.btn-clock-out:hover { background: #b83838; }
.btn-break { --b: var(--warn); }
.btn-break:hover { background: #a8680c; }
.btn-break-end { --b: var(--ok); }
.btn-break-end:hover { background: #0c7d59; }

/* the one animated moment: the user's live "working" pulse */
.clock-widget .badge-ok::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15,146,104,.45); }
    50% { box-shadow: 0 0 0 5px rgba(15,146,104,0); }
}

/* ==================================================================
   Team roster (dashboard)
================================================================== */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.status-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.status-card h3 { margin: 0 0 10px; font-size: .95rem; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-body); font-weight: 700; }
.status-card .count { background: var(--brand-tint); color: var(--brand-700); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 700; }
.status-people { list-style: none; margin: 0; padding: 0; }
.status-people li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.status-people li:last-child { border-bottom: 0; }

/* ==================================================================
   Timesheet
================================================================== */
.ts-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ts-periods { display: flex; gap: 6px; }
.ts-custom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ts-custom input { width: auto; }
.ts-custom span { color: var(--muted); }
.ts-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.ts-label { font-family: var(--font-display); font-size: 1.05rem; }
.ts-table td { vertical-align: top; white-space: normal; }
.ts-nonwork { background: var(--surface-2); }
.ts-nonwork td:first-child { color: var(--muted); }
.ts-shift { padding: 2px 0; }
.ts-edit { font-size: .76rem; margin-left: 6px; }
.ts-table .badge { margin: 0 3px 3px 0; }

/* Approvals inline form */
.approve-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.approve-form input[type="text"] { width: auto; flex: 1 1 150px; min-width: 130px; min-height: 36px; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.bulk-bar input[type="text"] { width: auto; min-height: 36px; flex: 1 1 160px; }

.rule { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ==================================================================
   Calendar
================================================================== */
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; font-size: .82rem; color: var(--muted); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-chip { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.cal-chip.cal-approved { background: var(--ok); }
.cal-chip.cal-pending { background: var(--warn); }
.cal-holiday-chip { background: #FCE9B6; border: 1px solid var(--warn); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); overflow: hidden; }
.cal-empty { background: transparent; border: none; }
.cal-weekend { background: var(--surface-2); }
.cal-holiday { background: #FFFBEF; border-color: #F6E3B0; }
.cal-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-date { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.cal-holiday-name { font-size: .66rem; color: var(--warn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-person { font-size: .72rem; color: #fff; border-radius: 5px; padding: 2px 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-person.cal-approved { background: var(--ok); }
.cal-person.cal-pending { background: var(--warn); }

/* ==================================================================
   Responsive — sidebar -> off-canvas drawer + topbar
================================================================== */
@media (max-width: 960px) {
    .app-main { margin-left: 0; }

    .sidebar {
        width: 282px;
        transform: translateX(-100%);
        transition: transform .26s cubic-bezier(.4,0,.2,1);
        box-shadow: var(--shadow-lg);
    }
    .nav-toggle:checked ~ .sidebar { transform: none; }
    .nav-toggle:checked ~ .scrim {
        display: block;
        position: fixed; inset: 0;
        background: rgba(19,21,43,.5);
        z-index: 40;
        animation: fade .2s ease;
    }
    @keyframes fade { from { opacity: 0; } to { opacity: 1; } }

    .topbar {
        display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 30;
        background: rgba(255,255,255,.86);
        backdrop-filter: saturate(160%) blur(10px);
        border-bottom: 1px solid var(--line);
        padding: 8px 12px;
        padding-top: calc(8px + env(safe-area-inset-top));
    }
    .topbar-brand { color: var(--ink); padding: 0; font-size: 1rem; flex: 1; }
    .topbar .avatar--sm { margin-left: auto; }

    .content { padding: 18px 16px 32px; }
    h1 { font-size: 1.35rem; }
    .card { padding: 18px; }
}

@media (max-width: 520px) {
    .card-head { align-items: flex-start; }
    .btn { width: 100%; }
    .head-actions .btn, .form-actions .btn { width: auto; }
    .clock-actions .btn-clock { flex: 1 1 100%; }
    .ts-totals strong, .clock-today strong { font-size: 1.25rem; }
    .cal-cell { min-height: 58px; padding: 3px; border-radius: 7px; }
    .cal-person, .cal-holiday-name { font-size: .58rem; padding: 1px 3px; }
    .cal-grid { gap: 3px; }
}

/* ==================================================================
   Audit log
================================================================== */
.audit-changes { white-space: normal; max-width: 420px; }
.audit-changes .kv {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 7px;
    margin: 0 3px 3px 0;
    font-size: .8rem;
}
.audit-changes .kv b { color: var(--muted); font-weight: 600; margin-right: 3px; }
.audit-old { opacity: .6; }
.audit-arrow { color: var(--muted); margin: 0 4px; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
}

/* Entitlement suggestion */
.entitlement-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    font-size: .9rem;
}
.entitlement-hint:empty { display: none; }
.suggest-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--brand-tint);
    border: 1px solid #d9d7f6;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
}
.suggest-box form { margin: 0; }
.suggest-box .muted { display: block; font-size: .82rem; }
.suggest-equiv { margin-top: 2px; opacity: .9; }
.suggest-hint { margin: -6px 0 16px; font-size: .85rem; }

/* ==================================================================
   Kiosk (QR clock) + QR badge
================================================================== */
.kiosk {
    background: radial-gradient(80% 60% at 50% -10%, #2a2658 0%, transparent 60%),
                linear-gradient(180deg, #1a1838, #13152B);
    min-height: 100vh;
}
.kiosk-shell {
    max-width: 460px; margin: 0 auto; min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); gap: 14px;
}
.kiosk-brand { display: flex; align-items: center; gap: 10px; color: #fff; justify-content: center; font-size: 1.05rem; margin-bottom: 4px; }
.kiosk-card { text-align: center; padding: 26px 22px; }
.kiosk-greeting { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0 0 2px; }
.kiosk-date { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }
.kiosk-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.kiosk .clock-actions .btn-clock { flex: 1 1 100%; min-height: 64px; font-size: 1.2rem; }

/* QR badge */
.qr-badge { text-align: center; padding: 8px 0; }
.qr-box { width: 220px; height: 220px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.qr-box img, .qr-box canvas, .qr-box table { margin: 0 auto; }
.qr-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 0; }
.qr-code { margin: 2px 0 0; letter-spacing: .04em; }
.qr-instructions { margin: 10px auto 0; max-width: 280px; font-size: .9rem; }
.qr-url { margin-top: 16px; word-break: break-all; font-size: .85rem; }
.qr-url code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

@media print {
    .qr-badge { padding: 24px 0; }
    .qr-url, .danger-zone { display: none !important; }
}

/* ==================================================================
   Responsive tables -> stacked cards on phones
================================================================== */
@media (max-width: 640px) {
    .table-wrap { border: none; border-radius: 0; overflow: visible; }

    .data-table { font-size: .92rem; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }

    .data-table tr {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        padding: 4px 14px;
    }
    .data-table tr:hover { background: var(--surface); }

    .data-table td {
        padding: 8px 0;
        border-bottom: 1px solid var(--line-2);
        white-space: normal;
        text-align: left;
    }
    .data-table tr td:last-child { border-bottom: none; }
    .data-table td:empty { display: none; }

    /* Label sits above its value, like a field in a card */
    .data-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-weight: 600;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        margin-bottom: 3px;
    }
    .data-table td:not([data-label])::before { content: none; }

    .row-actions { justify-content: flex-start; }
    .approve-form input[type="text"] { flex-basis: 100%; }
    .ai-assist-row { flex-direction: column; }
}

/* ==================================================================
   AI assist (natural-language leave) & AI report summary
================================================================== */
.ai-assist {
    border: 1px dashed var(--brand);
    background: var(--brand-tint);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 22px;
}
.ai-assist-label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 8px; color: var(--brand-700); }
.ai-assist-row { display: flex; gap: 8px; align-items: stretch; }
.ai-assist-row input[type="text"] { flex: 1 1 auto; background: var(--surface); }
.ai-assist-row .btn { white-space: nowrap; }
.ai-assist > small { display: block; margin-top: 8px; }
.ai-assist-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; }
.ai-assist-ok { background: var(--ok-tint); color: #0B5F45; }
.ai-assist-err { background: var(--danger-tint); color: #972929; }

.ai-summary {
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 4px 0 20px;
}
.ai-summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-summary-list { margin: 0; padding-left: 20px; }
.ai-summary-list li { margin: 4px 0; }
.ai-summary-foot { margin: 10px 0 0; font-size: .82rem; }
.inline-form { display: inline; }

.report-email {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0 8px;
    font-size: .9rem;
}
.report-email label { color: var(--muted); font-weight: 600; }
.report-email input[type="email"] { width: auto; min-width: 220px; flex: 0 1 260px; }

.reset-email-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.over-allowance-note {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--warn-tint);
    border: 1px solid #F0D9A8;
    color: #8A5A00;
    font-size: .9rem;
    font-weight: 500;
}

/* ==================================================================
   Print
================================================================== */
@media print {
    .sidebar, .topbar, .scrim, .app-footer, .no-print { display: none !important; }
    .app-main { margin: 0; }
    .content { max-width: none; padding: 0; animation: none; }
    .card { box-shadow: none; border: none; padding: 0; margin-bottom: 14px; }
    body { background: #fff; }
    .cal-cell { min-height: 70px; }
}

/* ==================================================================
   Reduced motion
================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
