/* Backoffice console design system.
   Copied from hrmis-system/frontend/hrmis_console.html (tokens, shell, components, auth)
   with prototype-only screens removed; additions for existing backoffice screens at the end. */

:root{
  --ink:#17202B; --ink-soft:#4C5566; --muted:#8B8F98;
  --paper:#F3F2ED; --surface:#FFFFFF; --surface-2:#EAE7DE; --line:#DEDAD0;
  --accent:#24407A; --accent-soft:#E7ECF6;
  --flag:#B23A42; --flag-soft:#F7E9EA;
  --good:#0ca30c; --good-soft:#E6F6E6;
  --warning:#a06b00; --warning-soft:#FBF0D9;
  --critical:#d03b3b; --critical-soft:#FBE7E7;
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ink:#EDEBE3; --ink-soft:#C6C3B9; --muted:#93968F;
    --paper:#15181D; --surface:#1C2027; --surface-2:#22262E; --line:#2C313A;
    --accent:#8CADF0; --accent-soft:rgba(140,173,240,0.14);
    --flag:#E4818A; --flag-soft:rgba(228,129,138,0.12);
    --good:#3fc23f; --good-soft:rgba(63,194,63,0.14);
    --warning:#e0ac2e; --warning-soft:rgba(224,172,46,0.14);
    --critical:#e66767; --critical-soft:rgba(230,103,103,0.14);
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --ink:#EDEBE3; --ink-soft:#C6C3B9; --muted:#93968F;
  --paper:#15181D; --surface:#1C2027; --surface-2:#22262E; --line:#2C313A;
  --accent:#8CADF0; --accent-soft:rgba(140,173,240,0.14);
  --flag:#E4818A; --flag-soft:rgba(228,129,138,0.12);
  --good:#3fc23f; --good-soft:rgba(63,194,63,0.14);
  --warning:#e0ac2e; --warning-soft:rgba(224,172,46,0.14);
  --critical:#e66767; --critical-soft:rgba(230,103,103,0.14);
  --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
  color-scheme: dark;
}

*{box-sizing:border-box;}
[hidden]{display:none !important;} /* beats any element's own display:flex/grid class (e.g. .field) */
body{
  background:var(--paper); color:var(--ink);
  font-family:"IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size:14.5px; line-height:1.55;
  padding-inline:16px; padding-block:0;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1120px; margin:0 auto;}
h1,h2,h3{font-family:"Newsreader", Georgia, serif; font-weight:600; color:var(--ink); margin:0;}
p{margin:0; color:var(--ink-soft);}
code, .mono{font-family:"IBM Plex Mono", monospace;}
button{font-family:inherit; cursor:pointer;}
input, select{font-family:inherit; font-size:13.6px;}
::selection{background:var(--accent-soft);}

/* ---------- top bar ---------- */
.topbar{position:sticky; top:env(safe-area-inset-top,0px); z-index:20; background:var(--paper); padding-block:16px 0; border-bottom:1px solid var(--line); margin-bottom:22px;}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-bottom:14px;}
.wordmark{display:flex; align-items:center; gap:9px; min-width:0;}
.wordmark .mark{width:10px; height:10px; border-radius:3px; background:var(--accent); display:inline-block; flex:0 0 auto;}
.wordmark .logo-img{width:22px; height:22px; border-radius:5px; object-fit:cover; flex:0 0 auto;}
.wordmark span{font-family:"IBM Plex Mono", monospace; font-weight:600; font-size:12.5px; letter-spacing:.03em; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.topbar-right{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.status-pill{display:inline-flex; align-items:center; gap:6px; font-family:"IBM Plex Mono",monospace; font-size:11px; padding:4px 9px; border-radius:100px; border:1px solid var(--line); color:var(--muted); white-space:nowrap;}
.status-pill .dot{width:6px; height:6px; border-radius:50%; background:var(--muted);}
.status-pill.live{color:var(--good); border-color:color-mix(in srgb, var(--good) 35%, transparent); background:var(--good-soft);}
.status-pill.live .dot{background:var(--good);}
.status-pill.local{color:var(--warning); border-color:color-mix(in srgb, var(--warning) 35%, transparent); background:var(--warning-soft);}
.status-pill.local .dot{background:var(--warning);}

.seg{display:inline-flex; border:1px solid var(--line); border-radius:100px; overflow:hidden; flex:0 0 auto;}
.seg button{font-family:"IBM Plex Mono",monospace; font-size:10.5px; padding:5px 11px; background:none; border:none; color:var(--muted);}
.seg button.active{background:var(--accent); color:#fff;}
.seg button:disabled{opacity:.45; cursor:not-allowed;}

.tabs{display:flex; gap:4px; overflow-x:auto; padding-bottom:0;}
.tab{font-family:"IBM Plex Mono",monospace; font-size:12.5px; padding:9px 14px; border:none; background:none; color:var(--muted); border-bottom:2px solid transparent; white-space:nowrap;}
.tab.active{color:var(--accent); border-bottom-color:var(--accent); font-weight:600;}
.tab:hover:not(.active){color:var(--ink);}

main{padding-bottom:60px;}
.view{display:none; flex-direction:column; gap:22px;}
.view.active{display:flex;}

.view-head{display:flex; justify-content:space-between; align-items:flex-end; gap:14px; flex-wrap:wrap;}
.view-head h2{font-size:21px;}
.view-head p{font-size:13px; max-width:56ch; margin-top:4px;}

.card{background:var(--surface); border:1px solid var(--line); border-radius:12px;}
.card-pad{padding:20px;}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:500;
  padding:9px 15px; border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--ink);
}
.btn:hover{border-color:var(--accent);}
.btn-primary{background:var(--accent); border-color:var(--accent); color:#fff;}
.btn-primary:hover{opacity:.92; border-color:var(--accent);}
.btn-ghost{border-color:transparent; background:none; color:var(--ink-soft);}
.btn-ghost:hover{color:var(--flag); background:var(--flag-soft); border-color:transparent;}
.btn-sm{padding:6px 11px; font-size:12px; border-radius:6px;}
.btn:disabled{opacity:.5; cursor:not-allowed;}

/* ---------- forms ---------- */
.field{display:flex; flex-direction:column; gap:5px; min-width:0;}
.field label{font-family:"IBM Plex Mono",monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);}
.field .hint{font-size:11px; color:var(--muted); margin-top:2px;}
.field input, .field select, .field textarea{
  padding:9px 10px; border-radius:7px; border:1px solid var(--line); background:var(--paper); color:var(--ink); font-size:13.6px; width:100%; min-width:0; box-sizing:border-box;
}
.field textarea{font-family:inherit; resize:vertical; min-height:56px;}
.field input:focus, .field select:focus, .field textarea:focus{outline:2px solid var(--accent); outline-offset:1px;}
.field input[type="file"]{padding:6px 8px; font-size:12px;}
.form-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:14px;}
.form-grid.cols-2{grid-template-columns:repeat(2,1fr);}
.form-grid.cols-4{grid-template-columns:repeat(4,1fr);}
@media (max-width:760px){ .form-grid, .form-grid.cols-2, .form-grid.cols-4{grid-template-columns:1fr 1fr;} }
@media (max-width:480px){ .form-grid, .form-grid.cols-2, .form-grid.cols-4{grid-template-columns:1fr;} }
.checkbox-row{display:flex; align-items:center; gap:8px; padding-top:22px; min-width:0;}
.checkbox-row input{width:16px; height:16px;}
.checkbox-row label{font-size:12.8px; color:var(--ink-soft);}
.form-actions{display:flex; gap:10px; justify-content:flex-end; margin-top:4px;}

/* ---------- empty state ---------- */
.empty{display:flex; flex-direction:column; align-items:flex-start; gap:12px; padding:34px 24px;}
.empty svg{width:30px; height:30px; color:var(--muted);}
.empty h3{font-size:16.5px;}
.empty p{font-size:13px; max-width:44ch;}
.empty .empty-actions{display:flex; gap:10px; margin-top:4px; flex-wrap:wrap;}

/* ---------- tables ---------- */
.table-scroll{overflow-x:auto; border:1px solid var(--line); border-radius:12px;}
table{width:100%; border-collapse:collapse; font-size:13px; min-width:680px;}
table.narrow{min-width:0;}
th{position:sticky; top:0; background:var(--surface-2); text-align:left; font-family:"IBM Plex Mono",monospace; font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:500; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap;}
th.num, td.num{text-align:right;}
td{padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:var(--surface-2);}
td.num, .tabular{font-variant-numeric:tabular-nums;}
.emp-name{font-weight:500;}
.emp-sub{font-size:11px; color:var(--muted);}
tfoot td{font-weight:600; border-top:1.5px solid var(--ink); padding:11px 12px;}
.row-actions{display:flex; gap:6px; flex-wrap:wrap;}

.avatar{width:28px; height:28px; border-radius:50%; background:var(--surface-2); display:inline-flex; align-items:center; justify-content:center; font-family:"IBM Plex Mono",monospace; font-size:10.5px; color:var(--ink-soft); overflow:hidden; flex:0 0 auto; vertical-align:middle; margin-right:8px;}
.avatar img{width:100%; height:100%; object-fit:cover;}

.pill{display:inline-flex; align-items:center; gap:5px; font-family:"IBM Plex Mono",monospace; font-size:10.5px; padding:3px 8px; border-radius:100px; white-space:nowrap;}
.pill-good{color:var(--good); background:var(--good-soft);}
.pill-warning{color:var(--warning); background:var(--warning-soft);}
.pill-critical{color:var(--critical); background:var(--critical-soft);}
.pill-muted{color:var(--muted); background:var(--surface-2);}
.example-badge{font-family:"IBM Plex Mono",monospace; font-size:9.5px; padding:2px 6px; border-radius:100px; border:1px dashed var(--muted); color:var(--muted); margin-left:6px;}

/* ---------- stat tiles ---------- */
.stat-row{display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:12px; overflow:hidden;}
.stat-row.cols-5{grid-template-columns:repeat(5,1fr);}
.stat{background:var(--surface); padding:15px 16px;}
.stat .lbl{font-family:"IBM Plex Mono",monospace; font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px;}
.stat .val{font-family:"Newsreader",serif; font-weight:600; font-size:20px; font-variant-numeric:tabular-nums;}
.stat .sub{font-size:10.5px; color:var(--muted); margin-top:3px;}
@media (max-width:700px){ .stat-row, .stat-row.cols-5{grid-template-columns:1fr 1fr;} }

.section-divider{display:flex; align-items:center; gap:10px; margin:2px 0;}
.section-divider span{font-family:"IBM Plex Mono",monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); white-space:nowrap;}
.section-divider::after{content:""; flex:1; height:1px; background:var(--line);}

.callout{display:flex; gap:10px; padding:13px 15px; border-radius:10px; background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 25%, transparent);}
.callout svg{flex:0 0 16px; width:16px; height:16px; color:var(--accent); margin-top:1px;}
.callout p{font-size:12.4px; color:var(--ink);}
.callout.warn{background:var(--warning-soft); border-color:color-mix(in srgb, var(--warning) 30%, transparent);}
.callout.warn svg{color:var(--warning);}

.hist-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 4px; border-bottom:1px solid var(--line); font-size:12.6px;}
.hist-row:last-child{border-bottom:none;}
.hist-row .tag{font-family:"IBM Plex Mono",monospace; font-size:10px; color:var(--muted);}
/* ---------- auth: login / logout / forgot / change password ----------
   A distinct visual treatment for the sign-in gate, matching the
   navy-on-cream, condensed-headline look used across this workspace's
   tools (Oswald headlines, mono badges) rather than the app's own
   serif/sans pairing — intentionally a little different so a sign-in
   screen never gets mistaken for a page already inside the app. */
:root{
  --auth-navy:#1e3a5f; --auth-navy-ink:#f7f4ee;
  --auth-card:#fffdf9; --auth-card-border:#e4dfd3; --auth-input-border:#d9d3c7;
  --auth-ink:#1a1a1a; --auth-muted:#6b6459; --auth-faint:#9a9284;
  --auth-danger:#b5432f; --auth-danger-bg:#f8e9e5;
  --auth-good:#2f7a4f; --auth-good-bg:#e8f3ec;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --auth-navy:#7fa3d6; --auth-navy-ink:#10151d;
    --auth-card:#1c2027; --auth-card-border:#2c313a; --auth-input-border:#363c47;
    --auth-ink:#EDEBE3; --auth-muted:#a9a89f; --auth-faint:#83807a;
    --auth-danger:#e4818a; --auth-danger-bg:rgba(228,129,138,.12);
    --auth-good:#5cc487; --auth-good-bg:rgba(92,196,135,.12);
  }
}
:root[data-theme="dark"]{
  --auth-navy:#7fa3d6; --auth-navy-ink:#10151d;
  --auth-card:#1c2027; --auth-card-border:#2c313a; --auth-input-border:#363c47;
  --auth-ink:#EDEBE3; --auth-muted:#a9a89f; --auth-faint:#83807a;
  --auth-danger:#e4818a; --auth-danger-bg:rgba(228,129,138,.12);
  --auth-good:#5cc487; --auth-good-bg:rgba(92,196,135,.12);
}
#auth-screen{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 16px; }
#app-shell[hidden], #auth-screen[hidden]{ display:none !important; }
.auth-card{ width:100%; max-width:404px; background:var(--auth-card); border:1px solid var(--auth-card-border); border-radius:14px; padding:32px 30px; box-shadow:0 18px 44px rgba(20,15,5,.10); }
.auth-brand-row{ display:flex; align-items:center; gap:9px; margin-bottom:22px; }
.auth-brand-row .mark{ width:11px; height:11px; border-radius:3px; background:var(--auth-navy); flex:0 0 auto; }
.auth-brand-row span{ font-family:"IBM Plex Mono",monospace; font-weight:600; font-size:12.5px; letter-spacing:.04em; color:var(--auth-muted); }
.auth-badge{ display:inline-flex; align-items:center; font-family:"IBM Plex Mono",monospace; font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--auth-navy); background:color-mix(in srgb, var(--auth-navy) 10%, transparent); border:1px solid color-mix(in srgb, var(--auth-navy) 30%, transparent); padding:4px 10px; border-radius:100px; margin-bottom:14px; }
.auth-title{ font-family:"Oswald", sans-serif; font-weight:600; font-size:23px; letter-spacing:.01em; color:var(--auth-ink); text-transform:uppercase; margin:0;}
.auth-sub{ font-size:12.6px; color:var(--auth-muted); margin-top:7px; line-height:1.55;}
.auth-field{ display:flex; flex-direction:column; gap:5px; margin-top:15px; }
.auth-field label{ font-family:"IBM Plex Mono",monospace; font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:var(--auth-muted); }
.auth-field input{ padding:10px 12px; border-radius:8px; border:1px solid var(--auth-input-border); background:var(--surface); color:var(--auth-ink); font-size:13.8px; width:100%; box-sizing:border-box; }
.auth-field input:focus{ outline:none; border-color:var(--auth-navy); box-shadow:0 0 0 3px color-mix(in srgb, var(--auth-navy) 18%, transparent); }
.auth-btn{ width:100%; margin-top:20px; padding:11px 16px; border-radius:8px; border:1px solid var(--auth-navy); background:var(--auth-navy); color:var(--auth-navy-ink); font-weight:600; font-size:13.6px; letter-spacing:.02em; display:flex; align-items:center; justify-content:center; gap:8px; transition:transform .12s ease, box-shadow .12s ease; }
.auth-btn:hover{ transform:translateY(-1px); box-shadow:0 8px 18px rgba(30,58,95,.22); }
.auth-btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }
.auth-links{ display:flex; justify-content:space-between; align-items:center; margin-top:14px; flex-wrap:wrap; gap:8px; }
.auth-link{ color:var(--auth-navy); font-weight:500; cursor:pointer; background:none; border:none; padding:0; font-size:12.2px; font-family:inherit; }
.auth-link:hover{ text-decoration:underline; }
.auth-error{ display:flex; gap:8px; align-items:flex-start; font-size:12px; color:var(--auth-danger); background:var(--auth-danger-bg); border:1px solid color-mix(in srgb, var(--auth-danger) 30%, transparent); border-radius:8px; padding:9px 11px; margin-top:15px; }
.auth-note{ display:flex; gap:8px; align-items:flex-start; font-size:12px; color:var(--auth-good); background:var(--auth-good-bg); border:1px solid color-mix(in srgb, var(--auth-good) 30%, transparent); border-radius:8px; padding:9px 11px; margin-top:15px; }
.auth-error svg, .auth-note svg{ width:14px; height:14px; flex:0 0 auto; margin-top:1px; }
.auth-code-display{ font-family:"IBM Plex Mono",monospace; font-size:24px; font-weight:600; letter-spacing:.14em; text-align:center; color:var(--auth-navy); background:color-mix(in srgb, var(--auth-navy) 8%, transparent); border:1px dashed color-mix(in srgb, var(--auth-navy) 45%, transparent); border-radius:8px; padding:12px; margin-top:6px; }
.auth-foot{ text-align:center; font-size:11.3px; color:var(--auth-faint); margin-top:22px; line-height:1.5; }

.identity-pill{ display:inline-flex; align-items:center; gap:9px; font-size:12px; padding:5px 6px 5px 12px; border-radius:100px; border:1px solid var(--line); background:var(--surface); flex:0 0 auto; }
.identity-pill .who{ font-weight:500; color:var(--ink); white-space:nowrap; }
.identity-pill .role-tag{ font-family:"IBM Plex Mono",monospace; font-size:9.5px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.identity-pill button{ font-family:"IBM Plex Mono",monospace; font-size:10px; padding:4px 9px; border-radius:100px; border:1px solid var(--line); background:var(--paper); color:var(--ink-soft); white-space:nowrap; }
.identity-pill button:hover{ border-color:var(--accent); color:var(--accent); }

/* ---------- additions for the Django backoffice ---------- */
body{margin:0;}
a{color:var(--accent);}
h1{font-size:26px;}
.view-head h1{font-size:24px;}
.view-head .eyebrow{font-family:"IBM Plex Mono",monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:4px;}
.view-head .eyebrow a{color:inherit;}
.view-head-actions{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
.wrap > main{display:flex; flex-direction:column; gap:22px;}
.card h2{font-size:17px; margin-bottom:14px;}
.card h3{font-size:14.5px; margin:18px 0 8px;}
.card-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px;}
.card-link{display:block; padding:18px 20px; color:var(--ink); text-decoration:none; transition:border-color .15s ease;}
.card-link:hover{border-color:var(--accent);}
.card-link strong{display:block; font-family:"Newsreader",serif; font-size:16px;}
.card-link span{display:block; margin-top:4px; font-size:12.5px; color:var(--muted);}
.stat .val a{color:inherit; text-decoration:none;}
.stat .sub a{color:var(--accent); text-decoration:none;}
.stat-row.cols-3{grid-template-columns:repeat(3,1fr);}
.btn{text-decoration:none; line-height:1.2;}
.btn-primary{color:#fff;}
.link-button{border:none; background:none; padding:0; color:var(--accent); font:inherit; cursor:pointer;}
.link-button:hover{text-decoration:underline;}
.pill-accent{color:var(--accent); background:var(--accent-soft);}
.field-error{font-size:11px; color:var(--critical);}
.field.has-error input, .field.has-error select, .field.has-error textarea{border-color:var(--critical);}
.form-actions a{align-self:center; color:var(--ink-soft); font-size:13px; text-decoration:none;}
.form-error{padding:10px 12px; border-radius:8px; color:var(--critical); background:var(--critical-soft); font-size:12.5px;}
.messages{display:flex; flex-direction:column; gap:8px;}
.callout p{margin:0;}
.tabs a.tab{text-decoration:none;}
.tab .tag{margin-left:6px; font-size:9px; padding:1px 5px; border:1px solid var(--line); border-radius:100px; color:var(--muted); font-weight:500;}
.subtabs{border-top:1px solid var(--line);}
.subtabs .tab{font-size:11.5px; padding:8px 12px;}
.theme-seg button[aria-pressed="true"]{background:var(--accent); color:#fff;}
.identity-pill a{font-family:"IBM Plex Mono",monospace; font-size:10px; padding:4px 9px; border-radius:100px; border:1px solid var(--line); background:var(--paper); color:var(--ink-soft); white-space:nowrap; text-decoration:none;}
.identity-pill a:hover{border-color:var(--accent); color:var(--accent);}
.identity-pill form{display:contents;}
.wordmark{text-decoration:none;}
.seg a{font-family:"IBM Plex Mono",monospace; font-size:10.5px; padding:6px 12px; color:var(--muted); text-decoration:none; white-space:nowrap;}
.seg a.active{background:var(--accent); color:#fff;}
.seg a:hover:not(.active){color:var(--ink);}
.status-filter{flex-wrap:wrap; border-radius:12px;}
.detail-grid{display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:18px; align-items:start;}
.stack{display:flex; flex-direction:column; gap:18px; min-width:0;}
.kv-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; margin:0; padding:14px; background:var(--surface-2); border-radius:8px; font-size:13px;}
.kv-grid dt{font-family:"IBM Plex Mono",monospace; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);}
.kv-grid dd{margin:2px 0 0; color:var(--ink);}
.prose{white-space:pre-line; font-size:13px;}
.totals{display:grid; gap:6px; width:min(320px,100%); margin:16px 0 0 auto; font-size:13px;}
.totals div{display:flex; justify-content:space-between; gap:16px; font-variant-numeric:tabular-nums;}
.totals dt{color:var(--muted);}
.totals dd{margin:0;}
.totals .grand{padding-top:8px; border-top:1.5px solid var(--ink); font-weight:600; font-size:14.5px;}
.totals .grand dt{color:var(--ink);}
.code-display{font-family:"IBM Plex Mono",monospace; font-size:24px; font-weight:600; letter-spacing:.14em; color:var(--accent); background:var(--accent-soft); border:1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius:8px; padding:10px 16px;}
.tracking-row{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.tracking-row .hint{font-size:12px; color:var(--muted); margin-top:8px;}
.hist-row{align-items:flex-start;}
.hist-row .hist-main{display:flex; flex-direction:column; gap:3px; min-width:0;}
.hist-row .hist-main p{font-size:12.4px;}
.hist-row .hist-note{color:var(--muted);}
.action-stack{display:flex; flex-direction:column; gap:8px;}
.action-stack .btn{justify-content:center;}
.items-table input{padding:7px 8px; border-radius:6px; border:1px solid var(--line); background:var(--paper); color:var(--ink); font-size:12.6px; width:100%; min-width:70px;}
.items-table td.desc input{min-width:240px;}
.items-table .field-error{display:block; margin-top:3px;}
.inline-check{display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-soft);}
.visually-hidden{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
.formset-card{display:flex; flex-direction:column; gap:14px;}
.formset-card legend{font-family:"IBM Plex Mono",monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); padding:0 6px;}
.formset-card fieldset{margin:0; padding:16px; border:1px solid var(--line); border-radius:10px;}
.auth-links a{text-decoration:none;}
.auth-field ul{margin:4px 0 0; padding-left:16px; font-size:11.5px; color:var(--auth-muted);}
.auth-field .helptext, .auth-field .hint{font-size:11.5px; color:var(--auth-muted);}
.mono{font-family:"IBM Plex Mono",monospace;}
@media (max-width:900px){ .detail-grid, .card-grid{grid-template-columns:1fr;} }
@media (max-width:700px){ .stat-row.cols-3{grid-template-columns:1fr;} }
@media (max-width:560px){ body{font-size:13.6px;} .kv-grid{grid-template-columns:1fr;} .code-display{font-size:19px;} .view-head h1{font-size:21px;} }
.tracking-label{font-family:"IBM Plex Mono",monospace; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:8px;}
/* Text on the accent colour: surface keeps contrast in both themes (accent is light blue in dark mode). */
.btn-primary, .btn-primary:hover, .seg button.active, .seg a.active, .theme-seg button[aria-pressed="true"]{color:var(--surface);}
.card .table-scroll table:not(.items-table){min-width:0;}
.detail-grid > *, .card-grid > *{min-width:0;}
/* People screens */
.profile-head{display:flex; align-items:center; gap:14px; min-width:0;}
.avatar-lg{width:48px; height:48px; font-size:14px; margin-right:0;}
.page-tabs{border-bottom:1px solid var(--line);}
.page-tabs a.tab{text-decoration:none;}
.toolbar{display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap;}
.toolbar-search{flex:1 1 240px; max-width:360px;}
.toolbar .status-filter{margin-left:auto;}
td a.emp-name{color:var(--ink); text-decoration:none;}
td a.emp-name:hover{color:var(--accent);}
.row-actions form{display:inline;}
.hint{font-size:11.5px; color:var(--muted);}
.stack > *, .wrap > main > *{min-width:0;}
.table-scroll{position:relative;}
.status-filter{max-width:100%;}
@media (max-width:560px){ .toolbar .status-filter{margin-left:0;} }
/* Attendance (att-row and src-tag from the prototype's attendance list) */
.att-row{display:grid; grid-template-columns:110px 110px 90px 1fr auto; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--line); font-size:12.8px;}
.att-row .d{font-family:"IBM Plex Mono",monospace; color:var(--ink-soft);}
.att-row .h{font-variant-numeric:tabular-nums; color:var(--ink-soft);}
.src-tag{font-family:"IBM Plex Mono",monospace; font-size:9.5px; color:var(--muted); text-transform:uppercase;}
.att-day summary{list-style:none; cursor:pointer;}
.att-day summary::-webkit-details-marker{display:none;}
.att-day summary:hover{background:var(--surface-2);}
.att-day[open] summary{background:var(--surface-2);}
.att-day:last-child summary{border-bottom:none;}
.punch-list{padding:6px 12px 12px;}
.date-nav{align-items:center;}
.date-nav .field{flex-direction:row; align-items:center; gap:8px;}
.month-label{font-family:"Newsreader",serif; font-size:17px; padding:0 6px;}
.callout form{margin-left:auto;}
@media (max-width:560px){ .att-row{grid-template-columns:82px 1fr auto; font-size:11.8px;} .att-row > :nth-child(3), .att-row > :nth-child(5){display:none;} }

/* Payroll: progress steps, actions, payslip sheet (payslip-* from the prototype's payslip modal) */
.steps{display:flex; gap:0; margin:0; padding:0; list-style:none; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--surface);}
.steps li{flex:1; padding:10px 12px; font-family:"IBM Plex Mono",monospace; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); text-align:center; border-right:1px solid var(--line);}
.steps li:last-child{border-right:none;}
.steps li.reached{color:var(--accent); background:var(--accent-soft);}
.steps li.current{font-weight:600; box-shadow:inset 0 -2px 0 var(--accent);}
.action-row{display:flex; gap:24px; flex-wrap:wrap; align-items:flex-start;}
.action-row > form{display:flex; flex-direction:column; gap:6px; max-width:320px;}
.inline-form{flex-direction:row !important; align-items:flex-end; flex-wrap:wrap; gap:8px !important;}
.warning-list{margin:6px 0 0; padding-left:18px; font-size:12.4px;}
.payslip-sheet{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:24px; max-width:820px;}
.payslip-top{display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding-bottom:12px; border-bottom:1.5px solid var(--ink);}
.payslip-title{text-align:right;}
.payslip-title h2{font-size:20px;}
.payslip-org{font-family:"IBM Plex Mono",monospace; font-size:12px; color:var(--ink); text-transform:uppercase; letter-spacing:.05em; font-weight:600;}
.payslip-kv{margin:14px 0; grid-template-columns:repeat(3,minmax(0,1fr));}
.payslip-columns{display:grid; grid-template-columns:1fr 1fr; gap:24px;}
.payslip-line{display:flex; justify-content:space-between; gap:12px; padding:7px 2px; border-bottom:1px dashed var(--line); font-size:13px;}
.payslip-line.total{border-top:1.5px solid var(--ink); border-bottom:none; font-weight:600; margin-top:4px; padding-top:10px;}
.payslip-line.muted-line{color:var(--ink-soft); font-size:12.4px;}
.payslip-section-title{font-family:"IBM Plex Mono",monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:16px 0 4px;}
.payslip-net{display:flex; justify-content:space-between; align-items:center; margin-top:18px; padding:14px 16px; border-radius:10px; background:var(--accent-soft); color:var(--accent); font-size:15px;}
.payslip-net strong{font-family:"Newsreader",serif; font-size:24px; font-variant-numeric:tabular-nums;}
.payslip-remarks{margin-top:12px;}
.payslip-footer{margin-top:16px; text-align:center;}
@media (max-width:700px){ .payslip-columns, .payslip-kv{grid-template-columns:1fr;} .steps li{font-size:9.5px; padding:8px 4px;} .payslip-sheet{padding:16px;} }
@media print{
  :root{color-scheme:light;}
  body{background:#fff; padding:0;}
  .topbar, .messages, .no-print, .skip-link{display:none !important;}
  .wrap{max-width:none;}
  .payslip-sheet{border:none; border-radius:0; padding:0; max-width:none; page-break-after:always; break-after:page; color:#000; background:#fff;}
  .payslip-sheet:last-of-type{page-break-after:auto; break-after:auto;}
  .payslip-net{background:#eef1f7; color:#000;}
}

/* HR settings: weekday picker (from the prototype's settings view) */
.weekday-picker{display:flex; gap:6px; flex-wrap:wrap;}
.weekday-picker label{display:flex; align-items:center; gap:5px; font-size:12px; padding:6px 10px; border:1px solid var(--line); border-radius:100px; color:var(--ink-soft); cursor:pointer;}
.weekday-picker input{width:13px; height:13px;}
.weekday-picker label:has(input:checked){border-color:var(--accent); color:var(--accent); background:var(--accent-soft);}
.section-divider span{white-space:normal;}
