/* WA Projects – Annual Leave Tracker
   Brand: the grey of the WA logo (#AAA8A9) with white type; charcoal for emphasis. */
:root {
    --brand:        #aaa8a9;
    --brand-dark:   #8f8d8e;
    --brand-light:  #e9e8e8;
    --charcoal:     #3d3c3d;
    --ink:          #1e1e1f;
    --ink-2:        #555456;
    --ink-3:        #807f81;
    --line:         #e2e1e1;
    --bg:           #f5f5f4;
    --card:         #ffffff;
    --good:         #2f7d4f;
    --good-bg:      #e7f3ec;
    --warning:      #9a6200;
    --warning-bg:   #fdf2dc;
    --critical:     #b3261e;
    --critical-bg:  #fbe9e7;
    --info-bg:      #eef0f3;
    --series-1:     #2a78d6;
    --series-2:     #eb6834;
    --series-3:     #1baf7a;
    --radius:       10px;
    --shadow:       0 1px 2px rgba(30,30,31,.06), 0 1px 8px rgba(30,30,31,.04);
    --nav-w:        236px;
    --top-h:        64px;
    --font:         'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-head:    'Jost', 'Futura', 'Century Gothic', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--font); font-size: 14px; line-height: 1.5;
    color: var(--ink); background: var(--bg);
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--charcoal); }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; color: var(--ink); margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
code { background: var(--brand-light); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ---------- Top bar */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--top-h); background: var(--brand); color: #fff;
    display: flex; align-items: center; gap: 16px; padding: 0 24px;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
    font-family: var(--font-head); font-size: 15px; letter-spacing: .14em; text-transform: uppercase;
    padding-left: 14px; border-left: 1px solid rgba(255,255,255,.6);
}
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.user-chip:hover { color: #fff; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.25);
    display: grid; place-items: center; font-weight: 600; border: 1px solid rgba(255,255,255,.5);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta small { color: rgba(255,255,255,.85); font-size: 11.5px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- Side navigation */
.sidenav {
    position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--nav-w);
    background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; overflow-y: auto; z-index: 20;
}
.sidenav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 2px;
    border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.sidenav a svg { color: var(--ink-3); flex: none; }
.sidenav a:hover { background: var(--bg); color: var(--ink); }
.sidenav a.active { background: var(--charcoal); color: #fff; }
.sidenav a.active svg { color: #fff; }

/* ---------- Main */
.content { flex: 1; padding: 28px 32px 40px; width: 100%; max-width: 1480px; }
.has-nav .content, .has-nav .site-footer { margin-left: var(--nav-w); width: auto; }
.no-nav .content { margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--ink-3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.site-footer { border-top: 1px solid var(--line); background: var(--card); color: var(--ink-3); font-size: 12.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 18px 32px; flex-wrap: wrap; }
.footer-inner strong { color: var(--ink-2); }
.footer-meta { align-self: flex-end; }

/* ---------- Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 20px; }

/* ---------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.kpi-value { font-family: var(--font-head); font-size: 30px; font-weight: 500; line-height: 1.15; margin-top: 6px; color: var(--ink); }
.kpi-value small { font-size: 14px; color: var(--ink-3); font-family: var(--font); margin-left: 4px; }
.kpi-foot { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.kpi-accent { border-top: 3px solid var(--charcoal); }
.kpi-warning { border-top: 3px solid var(--warning); }
.kpi-critical { border-top: 3px solid var(--critical); }
.kpi a { color: inherit; text-decoration: none; }
.kpi a::after { content: ''; position: absolute; inset: 0; }

/* ---------- Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; background: #fafafa; white-space: nowrap; }
.table tbody tr:hover { background: #fafafa; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: #fafafa; }
.table .neg { color: var(--critical); }
.table .pos { color: var(--good); }
.table-compact th, .table-compact td { padding: 6px 8px; }
.table .row-muted td { color: var(--ink-3); }
tr.row-xmas td { background: #f1f8f4; }
tr.row-opening td { background: var(--brand-light); font-weight: 500; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: ' ↕'; color: #c4c3c4; }
th.sort-asc::after { content: ' ↑'; color: var(--ink-2); }
th.sort-desc::after { content: ' ↓'; color: var(--ink-2); }

/* ---------- Forms */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.form-row .field { margin-bottom: 0; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=file], select, textarea {
    font: inherit; color: var(--ink); background: #fff; border: 1px solid #d3d2d2; border-radius: 8px;
    padding: 8px 11px; min-height: 38px; width: 100%; max-width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
select[multiple] { min-height: 150px; padding: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(61,60,61,.25); border-color: var(--charcoal); }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--charcoal); }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.filters .field { min-width: 150px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 4px; margin: 0 0 18px; }
legend { font-weight: 600; padding: 0 6px; color: var(--ink-2); }

/* ---------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 500;
    padding: 8px 16px; min-height: 38px; border-radius: 8px; border: 1px solid var(--charcoal);
    background: var(--charcoal); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-secondary { background: #fff; color: var(--charcoal); border-color: #cfcece; }
.btn-secondary:hover { background: var(--bg); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--charcoal); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--critical); border-color: var(--critical); }
.btn-danger:hover { background: #8e1d17; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 12.5px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--charcoal); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- Badges, status, alerts */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--brand-light); color: var(--ink-2); white-space: nowrap; }
.badge.cat-annual { background: #e3eefb; color: #1d5ba6; }
.badge.cat-extra  { background: #e2f5ee; color: #137254; }
.badge.cat-unpaid { background: #fdebe3; color: #a8431b; }
.badge.cat-public { background: #eeeef0; color: #555456; }
.badge.cat-ignore { background: #f3f3f3; color: #9a9a9a; }
.badge-active { background: var(--good-bg); color: var(--good); }
.badge-resigned { background: #efefef; color: var(--ink-3); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.status-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; color: #fff; }
.status-good { color: var(--good); }   .status-good .status-icon { background: var(--good); }
.status-warning { color: var(--warning); } .status-warning .status-icon { background: #d38b00; }
.status-critical { color: var(--critical); } .status-critical .status-icon { background: var(--critical); }
.status-muted { color: var(--ink-3); } .status-muted .status-icon { background: #b9b8b9; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--good-bg); color: #1f5c39; border-color: #cbe5d5; }
.alert-error   { background: var(--critical-bg); color: #8e1d17; border-color: #f2cbc6; }
.alert-warning { background: var(--warning-bg); color: #7a4d00; border-color: #f4dfae; }
.alert-info    { background: var(--info-bg); color: var(--ink-2); border-color: #dfe2e7; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; text-decoration: none; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--charcoal); }

/* ---------- Charts */
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 380px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* ---------- Misc */
.empty { text-align: center; padding: 28px; color: var(--ink-3); }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.big-number { font-family: var(--font-head); font-size: 44px; line-height: 1; }
.progress { height: 8px; background: var(--brand-light); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--charcoal); border-radius: 99px; }

/* ---------- Login */
.login-wrap { min-height: calc(100vh - var(--top-h) - 90px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand-block { background: var(--brand); border-radius: var(--radius) var(--radius) 0 0; margin: -20px -22px 20px; padding: 28px; text-align: center; }
.login-card .brand-block img { height: 46px; }
.login-card .brand-block div { color: #fff; font-family: var(--font-head); letter-spacing: .16em; text-transform: uppercase; margin-top: 10px; font-size: 13px; }

/* ---------- Responsive */
@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .sidenav { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.15); }
    .nav-open .sidenav { transform: none; }
    .has-nav .content, .has-nav .site-footer { margin-left: 0; }
    .content { padding: 20px 16px 32px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .user-meta, .brand-sub { display: none; }
    .topbar { padding: 0 12px; }
    .footer-inner { padding: 16px; }
}

/* ---------- Print */
@media print {
    .topbar, .sidenav, .filters, .page-actions, .site-footer, .no-print, .nav-toggle { display: none !important; }
    .has-nav .content { margin: 0; padding: 0; }
    body { background: #fff; }
    .card, .kpi { box-shadow: none; break-inside: avoid; }
    .print-header { display: flex !important; }
}
.print-header { display: none; justify-content: space-between; align-items: center; background: var(--brand); color: #fff; padding: 12px 16px; margin-bottom: 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-header img { height: 28px; }

/* ======================================================= Timesheet module */
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; padding: 16px 12px 6px; }
.sidenav .nav-section:first-child { padding-top: 4px; }
.badge-done { background: #e3eefb; color: #1d5ba6; }
.badge.bill-hourly { background: #e2f5ee; color: #137254; }
.badge.bill-lump { background: #efe9fb; color: #5a3fb3; }
.badge.bill-non { background: #f0f0f0; color: #77767a; }

/* Segmented filter */
.seg { display: inline-flex; border: 1px solid #d3d2d2; border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: 7px 14px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 13px; border-right: 1px solid #e3e2e2; }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--bg); }
.seg a.on { background: var(--charcoal); color: #fff; }

/* Header & summary */
.ts-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ts-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ts-nav .btn { min-width: 38px; }
.ts-summary { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.ts-summary .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.ts-summary strong { font-family: var(--font-head); font-size: 22px; font-weight: 500; }
.ts-lockinfo { margin-left: auto; color: var(--ink-2); font-size: 13px; text-align: right; }
.ts-lockinfo strong { font-size: 13px; font-family: var(--font); font-weight: 600; }

/* Grid */
.ts-card { padding: 0; overflow: hidden; }
.ts-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.ts-table th, .ts-table td { border-bottom: 1px solid var(--line); }
.ts-table thead th { background: var(--charcoal); color: #fff; font-weight: 500; padding: 8px 6px; font-size: 12.5px; text-align: center; }
.ts-table thead th.ts-task-h { text-align: left; padding-left: 16px; width: 30%; }
.ts-table thead th.off { background: #5a595a; }
.ts-table thead th.today { box-shadow: inset 0 -3px 0 #f2c94c; }
.ts-table thead th.err { background: var(--critical); }
.ts-day .dname { display: block; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.ts-day .dnum { display: block; font-size: 13px; }
.ts-day .dflag { display: inline-block; font-size: 10px; background: rgba(255,255,255,.2); border-radius: 4px; padding: 0 5px; margin-top: 2px; }
.ts-task { padding: 8px 10px 8px 16px; vertical-align: top; background: #fcfcfb; border-right: 1px solid var(--line); }
.ts-task-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ts-task-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ts-ot-toggle { background: none; border: 0; padding: 0; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); cursor: pointer; text-decoration: underline dotted; }
.ts-cell { padding: 5px 4px; text-align: center; }
.ts-cell.off { background: #f6f6f5; }
.ts-in { display: flex; align-items: center; gap: 2px; justify-content: center; }
.ts-table input.tsv { width: 64px; min-height: 32px; padding: 4px 6px; text-align: center; font-variant-numeric: tabular-nums; border-radius: 6px; }
.ts-table input.tsv[readonly] { background: transparent; border-color: transparent; color: var(--ink-2); }
.ts-table input.tsv.invalid { border-color: var(--critical); background: var(--critical-bg); }
.ts-table input.tsv:focus { outline: 2px solid rgba(42,120,214,.35); border-color: #2a78d6; }
.ts-table tr.ot td { border-bottom-style: dashed; }
.ts-table tr.ot input.tsv { background: #fff8f1; border-color: #f0c9a8; }
.ts-table tr.ot input.tsv::placeholder { color: #d9a77d; font-size: 11px; }
.ts-table tbody.ts-row:not(.show-ot) tr.ot { display: none; }
.ts-table tbody.ts-row:not(.show-ot) td.ts-task { border-bottom: 1px solid var(--line); }
.ts-note { border: 0; background: none; color: #c4c3c4; cursor: pointer; font-size: 13px; padding: 0 2px; width: 16px; }
.ts-note.req { color: #d38b00; }
.ts-note.has { color: #2a78d6; }
.ts-tot { text-align: right; padding: 6px 12px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; width: 80px; }
.rowtot-ot { color: #c4602a; font-size: 12px; font-weight: 500; }
.ts-x { width: 34px; text-align: center; }
.btn-x { border: 0; background: none; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.btn-x:hover { background: var(--critical-bg); color: var(--critical); }
.ts-table tfoot th { text-align: right; padding: 7px 12px; font-size: 12px; color: var(--ink-2); font-weight: 600; background: #fafafa; }
.ts-table tfoot td { text-align: center; padding: 7px 4px; font-variant-numeric: tabular-nums; background: #fafafa; font-size: 13px; }
.ts-table tfoot tr.sum-all td { font-weight: 700; border-top: 2px solid var(--line); }
.ts-table tfoot tr.sum-ot td { color: #c4602a; }
.ts-table tfoot tr.sum-status td { font-size: 12px; font-weight: 600; }
.ts-table tfoot td.ok { color: var(--good); }
.ts-table tfoot td.warn { color: var(--warning); background: var(--warning-bg); }
.ts-table tfoot td.bad { color: var(--critical); background: var(--critical-bg); }
.ts-actions { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.ts-dirty { color: var(--warning); font-weight: 600; font-size: 13px; }

/* Dialog & picker */
dialog.dlg { border: 0; border-radius: 12px; padding: 0; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 60px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dlg::backdrop { background: rgba(30,30,31,.45); }
dialog.dlg form { display: flex; flex-direction: column; max-height: calc(100vh - 60px); padding: 18px 20px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlg-head h2 { margin: 0; }
.dlg-foot { display: flex; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 12px; }
.pick-list { overflow-y: auto; min-height: 200px; max-height: 50vh; border: 1px solid var(--line); border-radius: 8px; }
.pick-group { padding: 8px 12px; background: #fafafa; border-bottom: 1px solid var(--line); position: sticky; top: 0; font-size: 13px; }
.pick-item { display: flex; gap: 10px; align-items: center; padding: 7px 12px 7px 24px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.pick-item:hover { background: #f7f9fc; }
.pick-item.is-in { color: var(--ink-3); cursor: default; }
.pick-item input { width: 16px; height: 16px; accent-color: var(--charcoal); }

/* Lock page */
.lock-hero { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.lock-hero .big-number { font-size: 32px; }
.cmp-grid td.miss { background: var(--warning-bg); color: var(--warning); font-weight: 600; }
.cmp-grid td.okc { color: var(--good); }
.cmp-grid td.offc { background: #f6f6f5; color: #b5b4b5; }
.cmp-grid th, .cmp-grid td { text-align: center; padding: 5px 6px; font-size: 12px; }
.cmp-grid td:first-child, .cmp-grid th:first-child { text-align: left; white-space: nowrap; }

/* Report builder */
.rb-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.rb-step h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 10px; font-family: var(--font); font-weight: 600; }
.staff-pick { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; gap: 4px; }
.staff-pick label { font-weight: 400; }
.table tr.grp1 td { background: #f1f1f0; font-weight: 600; }
.table tr.grp2 td:first-child { padding-left: 26px; }
.table tr.unspec td { color: var(--warning); font-style: italic; }
.ts-nav select, .ts-nav input { width: auto; }
.ts-nav input.flatpickr-input { width: 150px; }
.ts-table tr.ot input.tsv[readonly] { background: transparent; border-color: transparent; }
.ts-table tr.ot input.tsv[readonly]::placeholder { color: transparent; }
select.ovr { border-color: #2a78d6; background: #f3f8fe; font-weight: 600; }
[hidden] { display: none !important; }
input[type=search] { font: inherit; color: var(--ink); background: #fff; border: 1px solid #d3d2d2; border-radius: 8px; padding: 8px 11px; min-height: 38px; width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.grid-2-1 { align-items: start; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.pager-links { display: flex; gap: 6px; align-items: center; }
.bulkbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; }

/* ---------- Project database */
.ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; vertical-align: middle; background: var(--brand-light); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.ph-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--brand-light); color: var(--ink-2); font-size: 30px; font-weight: 500; font-family: var(--font-head); flex: none; }
img.avatar { object-fit: cover; padding: 0; }
.person-head { display: flex; gap: 18px; align-items: center; }
.kpi-details > summary { list-style: none; cursor: pointer; }
.kpi-details > summary::-webkit-details-marker { display: none; }
.kpi-details[open] { grid-column: 1 / -1; }
.kpi-details table { margin-top: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 0 10px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); margin: 0; }
.checks input { width: 16px; height: 16px; accent-color: var(--charcoal); }
.member-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.member-list label { display: flex; gap: 6px; align-items: center; font-weight: 400; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.dl-wide { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 6px 14px; margin: 0; }
.dl-wide dt { color: var(--ink-3); font-size: 13px; }
.dl-wide dd { margin: 0; white-space: pre-line; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.bar { height: 10px; background: var(--brand-light); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--charcoal); }
a.sort-link { color: inherit; text-decoration: none; }
a.sort-link:hover { text-decoration: underline; }
.inline-form { display: inline; }
.table td input[type=text], .table td input[type=email], .table td input[type=number], .table td select { min-height: 32px; padding: 4px 8px; }
@media (max-width: 640px) { .dl-wide { grid-template-columns: 1fr; } .dl-wide dd { margin-bottom: 8px; } }

/* ---------- Overtime reports (colours as in the former Excel workbook) */
.ot-wrap { max-height: 78vh; overflow: auto; }
.ot-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
.ot-table th, .ot-table td { padding: 4px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid #e7e6e6; border-right: 1px solid #f0efef; }
.ot-table thead th { position: sticky; z-index: 2; }
.ot-table .ot-h1 th { top: 0; background: #404040; color: #fff; font-weight: 600; height: 46px; vertical-align: middle; white-space: normal; min-width: 74px; }
.ot-table .ot-h2 th { top: 46px; background: #d9d9d9; color: var(--ink); font-weight: 600; }
.ot-table .ot-c1 { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 86px; }
.ot-table thead .ot-c1 { z-index: 3; }
.ot-table .ot-h1 .ot-c1 { background: #404040; }
.ot-table .ot-h2 .ot-c1 { background: #d9d9d9; }
.ot-table tbody tr.ot-we td { background: #fce4d6; color: #c65911; font-weight: 600; }
.ot-table tbody tr.ot-ph td { background: #e4dfec; color: #5b2c83; font-weight: 600; }
.ot-table td.ot-over, .ot-over { color: #c00000 !important; font-weight: 700; }
.ot-table tfoot td { background: #f2f2f2; }
.ot-table tfoot .ot-c1 { background: #f2f2f2; text-align: left; }
.ot-table tfoot tr.ot-f1 td { border-top: 2px solid #404040; font-weight: 600; }
.ot-table .ot-tot { font-weight: 600; }
.ot-legend { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.ot-legend .ot-we, .ot-legend .ot-ph { padding: 3px 10px; border-radius: 4px; }
.ot-we { background: #fce4d6; color: #c65911; }
.ot-ph { background: #e4dfec; color: #5b2c83; }
.badge.ot-we { background: #fce4d6; color: #c65911; }
.badge.ot-ph { background: #e4dfec; color: #5b2c83; }
table.table tr.ot-we td { background: #fce4d6; color: #c65911; }
table.table tr.ot-ph td { background: #e4dfec; color: #5b2c83; }
.ot-captd { position: relative; }
.ot-capbar { position: absolute; left: 0; top: 3px; bottom: 3px; background: linear-gradient(90deg, #9dc3e6, #ddebf7); border-radius: 2px; z-index: 0; }
.ot-captd span { position: relative; z-index: 1; }
.pos-bad { color: #c00000; }
.pos-good { color: #2e7d32; }
.tr-hl td { background: #fff2cc !important; font-weight: 600; }
@media print { .ot-wrap { max-height: none; overflow: visible; } .ot-table thead th, .ot-table .ot-c1 { position: static; } }
.badge.bill-mixed { background: #fff2cc; color: #8a6100; }
.badge.bill-hourly, .badge.bill-lump, .badge.bill-non { font-size: 12px; }
tr.row-bill-hourly td:first-child { box-shadow: inset 4px 0 0 #2e9e6e; }
tr.row-bill-lump_sum td:first-child { box-shadow: inset 4px 0 0 #7a5bd6; }
tr.row-bill-non_billable td:first-child { box-shadow: inset 4px 0 0 #b9b8bb; }
.bill-summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bill-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; flex: 1; min-width: 120px; }
.bill-box .n { font-family: var(--font-head); font-size: 22px; }
tr.row-bill-mixed td:first-child { box-shadow: inset 4px 0 0 #e0a800; }
.bill-box.on { border-color: currentColor; }
.bill-box.hourly { color: #137254; } .bill-box.lump_sum { color: #5a3fb3; } .bill-box.non_billable { color: #77767a; }
.bill-box small { display: block; color: var(--muted, #77767a); }
.bill-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted, #77767a); align-items: center; }
.bill-legend i { display: inline-block; width: 4px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 5px; }
button.badge-btn { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; }
button.badge-btn:hover { box-shadow: 0 0 0 2px currentColor; }
button.badge-btn.badge-active:hover::after { content: ' → disable'; }
button.badge-btn.badge-resigned:hover::after { content: ' → enable'; }
