/* HRM interface styles. One file, no framework.
   Order: fonts, tokens, base, type, buttons, forms, tables, badges, layout (rail, header, footer), pages, utilities, responsive, print. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-var.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  /* colour */
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #15263a;
  --ink-2: #33475c;
  --muted: #5a6b7e;
  --line: #e2e8ef;
  --line-strong: #c8d2dd;
  --nav: #102136;
  --nav-active: #1d3a58;
  --nav-text: #c9d6e2;
  --nav-muted: #9db0c3;
  --accent: #14739a;
  --accent-hover: #0f5f80;
  --accent-soft: #e8f4f8;
  --success: #0f6b43;   --success-bg: #e3f3ea;  --success-line: #bfe0cd;
  --warning: #7a4f00;   --warning-bg: #fdf0cf;  --warning-line: #efd78f;
  --danger: #9d2a22;    --danger-hover: #7f201a; --danger-bg: #fdebe8; --danger-line: #f1c4be;
  --info: #1d558f;      --info-bg: #e8f1fc;     --info-line: #c4dbf3;
  --neutral: #465a6e;   --neutral-bg: #edf1f5;  --neutral-line: #d5dde6;
  /* spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  /* radius */
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-pill: 999px;
  /* type scale: page title, section title, body, caption */
  --fs-title: clamp(22px, 1.6vw + 14px, 28px);
  --fs-section: 16px;
  --fs-body: 14px;
  --fs-caption: 12px;
  --fs-stat: 28px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow-pop: 0 8px 28px rgba(16, 35, 55, .12);
  --rail-width: 248px;
  --tap: 44px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: var(--fs-body)/1.5 var(--font); font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a.btn, .side-nav a, .brand, .utility-user, .quick-access-links a, .skip-link { text-decoration: none; }
code { font: 12.5px var(--mono); padding: 1px 5px; background: var(--neutral-bg); border-radius: var(--r-sm); overflow-wrap: anywhere; }
pre { font: 12.5px/1.5 var(--mono); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(255,255,255,.9); border-radius: var(--r-sm); }
.sidebar :focus-visible { outline-color: #8fd8ee; box-shadow: none; }
.skip-link { position: absolute; left: var(--sp-3); top: -60px; z-index: 100; padding: var(--sp-2) var(--sp-4); color: #fff; background: var(--ink); border-radius: var(--r); }
.skip-link:focus { top: var(--sp-3); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- type scale ---------- */
h1, h2, h3 { color: var(--ink); }
h1 { margin: 0; font-size: var(--fs-title); line-height: 1.2; font-weight: 650; letter-spacing: -.02em; text-wrap: balance; }
h2 { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-section); line-height: 1.35; font-weight: 620; letter-spacing: -.005em; }
h3 { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-body); line-height: 1.4; font-weight: 620; }
.panel > h2:first-child, .panel > h3:first-child, .panel > form > h3:first-child { margin-top: 0; }
.sub, .page-sub { margin: var(--sp-1) 0 0; color: var(--muted); max-width: 72ch; }
.muted { color: var(--muted); }
.caption, small { font-size: var(--fs-caption); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- page header: title, one-line subtitle, primary action on the right ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); font-size: var(--fs-caption); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-hover); }
.crumbs .sep { color: var(--line-strong); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3) var(--sp-5); margin: 0 0 var(--sp-5); }
.page-head-main { min-width: 0; flex: 1 1 340px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.page-actions form { margin: 0; }

/* ---------- buttons ---------- */
button, input, select, textarea, .btn { font: inherit; }
button, .btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px var(--sp-4); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 580; line-height: 1.2; cursor: pointer; text-align: center; transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
button:hover, .btn:hover { color: var(--ink); background: var(--surface-soft); border-color: #aab8c6; text-decoration: none; }
button:active, .btn:active { background: var(--neutral-bg); }
button:disabled, .btn:disabled, .btn[aria-disabled=true] { cursor: not-allowed; opacity: .5; }
button.primary, .btn.primary, .primary { color: #fff; background: var(--accent); border-color: var(--accent); }
button.primary:disabled, .btn.primary[aria-disabled=true] { color: var(--muted); background: var(--neutral-bg); border-color: var(--neutral-line); opacity: 1; }
button.primary:hover, .btn.primary:hover, .primary:hover { color: #fff; background: var(--accent-hover); border-color: var(--accent-hover); }
/* destructive actions look secondary; the confirm dialog does the warning */
button.danger, .btn.danger, .danger { color: var(--danger); background: var(--surface); border-color: var(--danger-line); }
button.danger:hover, .btn.danger:hover, .danger:hover { color: var(--danger-hover); background: var(--danger-bg); border-color: #e3a49d; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm, button.sm, td button, td .btn, .person button { min-height: 32px; padding: 4px var(--sp-3); font-size: 13px; }
.btn.lg, button.lg { min-height: 52px; padding: var(--sp-3) var(--sp-5); font-size: 17px; }
.btn.link, button.link { min-height: 0; padding: 0; color: var(--ink); background: none; border: 0; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.btn.link:hover { color: var(--accent-hover); background: none; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
.ico { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; flex-basis: 16px; }
.btn .ico { width: 16px; height: 16px; flex-basis: 16px; }

/* ---------- forms ---------- */
input, select, textarea { width: auto; min-height: 38px; max-width: 100%; padding: 7px var(--sp-3); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); }
input[type=checkbox], input[type=radio] { width: 16px; min-height: 0; height: 16px; padding: 0; accent-color: var(--accent); vertical-align: -3px; }
input[type=file] { padding: var(--sp-2); background: var(--surface-soft); border-style: dashed; }
input[type=color] { padding: 3px; cursor: pointer; }
textarea { min-height: 96px; line-height: 1.45; }
::placeholder { color: #5f6f81; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--neutral-bg); }
label { color: var(--ink-2); font-weight: 560; }
.field-sm { width: 8rem; } .field-md { width: 14rem; } .field-lg { width: 22rem; } .field-full { width: 100%; }
form.stack p, .field { margin: 0 0 var(--sp-4); }
form.stack label, .field > label { display: block; margin-bottom: var(--sp-1); }
form.stack textarea, form.stack select, form.stack input:not([type=checkbox]):not([type=radio]):not([type=file]), .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; max-width: 560px; }
form.stack input[type=file] { width: 100%; max-width: 560px; }
form.stack label:has(input[type=checkbox]), form.stack label:has(input[type=radio]), .check-field { display: flex; align-items: flex-start; gap: var(--sp-2); font-weight: 500; }
.help-text, .helptext, form.stack .muted { display: block; margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-caption); line-height: 1.45; font-weight: 400; }
.errorlist { margin: var(--sp-1) 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 13px; font-weight: 520; }
.errorlist li::before { content: "Error: "; font-weight: 650; }
.field-error, p:has(> .errorlist) input, .form-field:has(.errorlist) input, .form-field:has(.errorlist) select { border-color: #d27f77; }
.form-errors { color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding-top: var(--sp-1); }
.form-field { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.form-field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .form-field select { width: min(100%, 520px); }
.form-field input[type=file] { width: 100%; }
.panel form .form-field:last-of-type { margin-bottom: var(--sp-3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.row.end { align-items: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin: 0; }
.inline-form input { min-height: 32px; padding: 4px var(--sp-2); font-size: 13px; }
.inline-form select { min-height: 32px; font-size: 13px; }
details { padding: var(--sp-2) 0; }
details > summary { color: var(--ink); font-weight: 580; cursor: pointer; padding: var(--sp-1) 0; }
details > summary:hover { color: var(--accent-hover); }
.disclosure { margin-top: var(--sp-3); border-top: 1px solid var(--line); padding-top: var(--sp-2); }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.scroll table { min-width: 640px; }
.scroll table.fit { min-width: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); font-variant-numeric: tabular-nums; }
body > .app-shell main > table, main > table, .panel > table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.scroll table, .panel .scroll table { border: 0; }
th, td { padding: 10px var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-soft); font-size: var(--fs-caption); font-weight: 620; white-space: nowrap; }
thead th, tr:first-child > th { position: sticky; top: 0; z-index: 1; }
td { color: var(--ink-2); }
tbody tr:nth-child(even) td { background: #fafbfd; }
tbody tr:hover td { background: #eef3f8; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.num, th.num, td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td .muted, td .t { font-size: var(--fs-caption); }
tr.total td, tr.total th { color: var(--ink); background: var(--surface-soft); font-weight: 650; border-top: 1px solid var(--line-strong); }
tr.weekend td { color: var(--muted); background: #f5f7fa; }
tr.is-today td { background: var(--accent-soft); }
table.facts th { width: 11rem; color: var(--muted); font-weight: 560; background: transparent; position: static; white-space: normal; }
table.facts td { color: var(--ink); }
table.facts tr:hover td { background: transparent; }
table.facts tr:nth-child(even) td { background: transparent; }
.panel table:not(.facts) { margin-top: 0; }
.panel .scroll { border: 0; border-radius: 0; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-5) var(--sp-3); }
.empty strong { color: var(--ink); font-weight: 620; }
.empty span { color: var(--muted); max-width: 60ch; }
.empty .btn { margin-top: var(--sp-2); }
td.empty-cell { padding: 0; background: var(--surface) !important; }
.empty-block { padding: var(--sp-5); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty-block .empty { padding: 0; }

/* ---------- status badges: one set ---------- */
.badge { display: inline-block; padding: 2px 9px; color: var(--neutral); background: var(--neutral-bg); border: 1px solid var(--neutral-line); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 620; line-height: 1.45; white-space: nowrap; vertical-align: middle; }
.badge::first-letter { text-transform: uppercase; }
.badge + .badge { margin-left: var(--sp-1); }
/* Colour carries one meaning everywhere: green = done or good, amber = waiting for someone or late, blue = information or open,
   red = a problem, grey outline = draft. */
.badge.ok, .badge.in, .badge.approved, .badge.posted, .badge.active, .badge.paid { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.badge.warn, .badge.late, .badge.waiting, .badge.pending, .badge.review, .badge.awaiting { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.badge.bad, .badge.absent, .badge.missing, .badge.rejected, .badge.reversed { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.badge.info, .badge.open { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.badge.draft { color: var(--ink-2); background: var(--surface); border: 1px solid var(--muted); }
.badge.muted, .badge.neutral { color: var(--neutral); background: var(--neutral-bg); }
p.badge, div.badge { display: block; width: fit-content; margin: 0 0 var(--sp-2); }
.count { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; margin-left: auto; padding: 0 6px; color: #3d2d00; background: #f3cc70; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count.bad { color: #fff; background: #b8382f; }

/* ---------- panels, tiles, notices ---------- */
.panel { margin-bottom: var(--sp-4); padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.narrow, .narrow { max-width: 600px; }
.panel.tight { padding: var(--sp-4); }
.bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-4); }
.bar form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; }
.bar label { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-5); }
.tile { display: block; min-height: 88px; padding: var(--sp-4); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; }
a.tile:hover { border-color: #aab8c6; text-decoration: none; }
.tile .n { color: var(--ink); font-size: var(--fs-stat); line-height: 1.1; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .l { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-caption); font-weight: 560; }
.tile.ok .n { color: var(--success); } .tile.warn .n { color: var(--warning); } .tile.bad .n { color: var(--danger); } .tile.info .n { color: var(--info); }
.tile.ok, .tile.warn, .tile.bad, .tile.info { background: var(--surface); }
.messages { margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.messages li, .alert, .note { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--info-line); border-radius: var(--r); }
.messages li { color: var(--info); background: var(--info-bg); }
.messages li.success { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.messages li.error, .alert { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.note { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.alert a, .note a, .messages a { color: inherit; text-decoration-color: currentColor; font-weight: 580; }
.alert ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.grid2 > .panel { margin-bottom: 0; }
.grid2 + *, .grid2 + .panel { margin-top: var(--sp-4); }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--sp-4); align-items: start; }
.board .panel { margin: 0; padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.board .dept h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 var(--sp-1); font-size: 15px; }
.board .dept h2 .muted { font-weight: 560; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 9px 0; border-bottom: 1px solid var(--line); }
.person:last-child { padding-bottom: var(--sp-1); border-bottom: 0; }
.person a { font-weight: 560; }
.person .t { margin-top: 1px; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.stat-line { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--fs-caption); }
.checklist { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.check-mark { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border: 1.5px solid var(--line-strong); border-radius: 5px; color: #fff; }
.check-mark.done { background: var(--success); border-color: var(--success); }
.check-mark .ico { width: 12px; height: 12px; stroke-width: 2.6; }
.legal { color: var(--muted); font-size: var(--fs-caption); max-width: 80ch; }

/* ---------- sign-in and other pre-login pages ---------- */
.login-wrap { display: flex; min-height: 72vh; align-items: center; justify-content: center; padding: var(--sp-5) 0; }
.login { width: min(400px, 100%); margin: 0; padding: var(--sp-6); text-align: center; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,35,55,.05), 0 12px 32px rgba(16,35,55,.06); }
.login.wide { width: min(520px, 100%); }
.login form { text-align: left; }
.login h1 { font-size: 22px; }
.login .sub { margin: var(--sp-1) auto var(--sp-5); }
.login form.stack input:not([type=checkbox]) { max-width: none; }
.login .btn, .login button { width: 100%; }
.login .secondary-link { margin: var(--sp-4) 0 0; font-size: 13px; }
.login ol { text-align: left; padding-left: var(--sp-5); }
.login-mark { display: block; width: auto; max-width: 160px; max-height: 64px; object-fit: contain; margin: 0 auto var(--sp-4); }
.code-input { font-size: 22px; letter-spacing: .25em; text-align: center; }
.qr { display: flex; justify-content: center; margin: var(--sp-3) 0; }
.demo-logins { margin-top: var(--sp-4); padding: var(--sp-3); color: var(--warning); background: var(--warning-bg); border: 1px dashed var(--warning-line); border-radius: var(--r); font-size: var(--fs-caption); text-align: left; }

/* ---------- app shell: rail, header, footer ---------- */
.authenticated .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--rail-width); height: 100vh; flex-direction: column; gap: var(--sp-4); padding: var(--sp-4) var(--sp-3) var(--sp-3); overflow: hidden; color: #fff; background: var(--nav); }
.sidebar .brand { display: flex; min-width: 0; width: 100%; flex: 0 0 auto; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-2) var(--sp-4); overflow: hidden; color: #fff; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .brand:hover { color: #fff; }
.sidebar .brand img { display: block; width: auto; max-width: 132px; height: 40px; flex: 0 0 auto; object-fit: contain; }   /* fixed height: the menu does not move when the logo arrives */
.sidebar .brand .product-name { flex: 0 1 auto; padding-left: var(--sp-3); color: #c9eaf5; border-left: 1px solid rgba(255,255,255,.24); font-size: 15px; font-weight: 650; white-space: nowrap; }
.side-nav { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: var(--sp-3); overflow-x: hidden; overflow-y: auto; padding: 1px 1px var(--sp-2); scrollbar-color: rgba(255,255,255,.24) transparent; scrollbar-width: thin; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 var(--sp-3) var(--sp-1); color: var(--nav-muted); font-size: var(--fs-caption); font-weight: 600; }
.side-nav a { display: flex; min-height: 34px; align-items: center; gap: 10px; padding: 7px var(--sp-3); color: var(--nav-text); border-radius: var(--r); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.side-nav a .ico { opacity: .8; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav a.on { color: #fff; background: var(--nav-active); font-weight: 620; box-shadow: inset 3px 0 0 #7fd0e8; }
.side-nav a.on .ico { opacity: 1; }
.sidebar-account { flex: 0 0 auto; padding: var(--sp-3) var(--sp-2) 0; border-top: 1px solid rgba(255,255,255,.12); }
.account-meta { display: flex; min-width: 0; align-items: center; gap: var(--sp-2); }
.account-avatar { display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; color: #e7f8fc; background: #2d4a67; border-radius: 50%; font-size: 12px; font-weight: 650; }
.account-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.35; }
.account-copy strong { overflow: hidden; color: #f3f7fb; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--nav-muted); font-size: var(--fs-caption); }
.sidebar-account form { margin-top: var(--sp-1); }
.sidebar .logout-button { min-height: 32px; padding: 4px 0; color: var(--nav-text); background: transparent; border: 0; font-size: 13px; font-weight: 500; }
.sidebar .logout-button:hover { color: #fff; background: transparent; text-decoration: underline; }
.app-shell { min-height: 100vh; margin-left: var(--rail-width); }
.utility-bar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: var(--sp-5); padding: var(--sp-2) var(--sp-6); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.utility-context { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utility-actions { display: flex; align-items: center; gap: var(--sp-4); }
.sync-pill { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 3px 11px 3px 9px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-caption); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; background: #b9801a; border-radius: 50%; }
.sync-pill.is-ok .status-dot { background: #2e8b62; }
.sync-pill.is-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.sync-pill.is-error .status-dot { background: var(--danger); }
.utility-user { display: flex; flex-direction: column; padding-left: var(--sp-4); color: var(--ink); border-left: 1px solid var(--line); line-height: 1.3; }
.utility-user:hover { color: var(--accent-hover); }
.utility-user-name { font-size: 13px; font-weight: 600; }
.utility-user-role { color: var(--muted); font-size: var(--fs-caption); }
.workspace-main { width: 100%; max-width: 1600px; min-height: calc(100vh - 110px); margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-6); }
.public-shell { min-height: 100vh; }
.public-main { max-width: 1280px; min-height: calc(100vh - 72px); margin: 0 auto; padding: var(--sp-5); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6) var(--sp-5); color: var(--muted); font-size: var(--fs-caption); }
.public-shell .foot { justify-content: center; }
.foot .vendor { display: inline-flex; align-items: center; gap: 6px; }
.foot .vendor img { display: block; width: auto; height: 20px; }

/* ---------- page parts ---------- */
.quick-access { margin: 0 0 var(--sp-5); }
.quick-access-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.quick-access-links a { display: flex; min-width: 0; min-height: 60px; align-items: center; gap: var(--sp-3); padding: var(--sp-3); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.quick-access-links a:hover { border-color: #aab8c6; color: var(--ink); }
.quick-access-links a > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.quick-access-links strong { font-size: 13px; font-weight: 620; }
.quick-access-links small { color: var(--muted); font-size: var(--fs-caption); line-height: 1.35; }
.quick-icon { display: flex; width: 36px; height: 36px; flex: 0 0 36px; align-items: center; justify-content: center; color: var(--accent-hover); background: var(--accent-soft); border-radius: var(--r); }
.day-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.day-switch form { margin: 0; }
.live-note { margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--fs-caption); }
.branding-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: start; gap: var(--sp-4); }
.branding-form-panel, .brand-preview-panel { padding: var(--sp-5); }
.branding-form { display: flex; flex-direction: column; gap: var(--sp-2); }
.logo-preview-frame { display: flex; width: min(100%, 520px); min-height: 104px; align-items: center; justify-content: center; padding: var(--sp-4); background: var(--nav); border-radius: var(--r-lg); }
.logo-preview-frame img { display: block; max-width: 100%; max-height: 70px; object-fit: contain; }
.brand-preview-rail { display: flex; min-height: 120px; align-items: center; justify-content: center; gap: var(--sp-3); margin: var(--sp-4) 0; padding: var(--sp-5); color: #d6e5ef; background: var(--nav); border-radius: var(--r-lg); }
.brand-preview-rail img { max-width: 96px; max-height: 44px; object-fit: contain; }
.brand-preview-rail span { padding-left: var(--sp-3); color: #c9eaf5; border-left: 1px solid rgba(255,255,255,.25); font-weight: 650; }
.preview-caption { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-4); color: var(--muted); font-size: var(--fs-caption); }
.color-control { display: flex; align-items: center; gap: var(--sp-3); }
.branding-form .color-control input[type=color] { width: 48px; height: 42px; min-height: 42px; flex: 0 0 48px; }
.color-control span { color: var(--ink-2); font: 600 12.5px var(--mono); }
.accent-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-2); padding: var(--sp-3); background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--r); }
.accent-preview > span { flex: 1 0 100%; color: var(--muted); font-size: var(--fs-caption); font-weight: 560; }
.accent-preview a { color: var(--accent-hover); font-weight: 600; }
.steps { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.steps .btn[aria-current=step] { color: #fff; }
.adapter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.adapter-grid .tile .l { color: var(--ink); font-size: 14px; font-weight: 620; }
.adapter-grid .tile .muted { margin-top: var(--sp-1); font-size: 13px; }
.revealed { font-size: 16px; }
.big-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.net-pay { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 1.5px solid var(--ink); border-radius: var(--r); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.preformatted { white-space: pre-wrap; overflow-x: auto; }
.neg { color: var(--danger); }

/* ---------- payslip on screen: same sections and labels as the PDF ---------- */
.payslip { position: relative; max-width: 920px; margin-left: auto; margin-right: auto; padding: var(--sp-6); overflow: hidden; }
.payslip-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 2px solid var(--ink); }
.payslip-head h2 { margin: 0; font-size: 22px; }
.payslip-head .when { text-align: right; line-height: 1.6; }
.payslip table.facts { margin-top: var(--sp-3); background: var(--surface-soft); }
.payslip table.facts th { width: 8.5rem; }
.payslip table.facts td { background: transparent; }
.payslip-sections { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-5); margin-top: var(--sp-4); }
.payslip-sections h3 { margin-top: 0; }
.payslip.is-draft::after { content: "DRAFT"; position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); color: rgba(180, 35, 24, .09); font-size: 140px; font-weight: 800; letter-spacing: .08em; pointer-events: none; }
.payslip-foot { margin-top: var(--sp-4); }

/* ---------- round 2: banners, segmented control, dates, lists ---------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.banner > .banner-text { flex: 1 1 320px; min-width: 0; }
.banner > details { flex: 1 1 100%; padding: 0; }
.banner .btn { background: var(--surface); }
.alert details > summary, .note details > summary { color: inherit; }
.kv-list { margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.kv-list li { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 5px 0; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); color: var(--ink-2); }
.kv-list li strong { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 var(--sp-4); padding: 3px; background: var(--neutral-bg); border: 1px solid var(--neutral-line); border-radius: var(--r); }
.seg a { display: inline-flex; min-height: 32px; align-items: center; padding: 4px var(--sp-4); color: var(--ink-2); border-radius: var(--r-sm); font-weight: 560; text-decoration: none; }
.seg a:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.seg a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(16,35,55,.14), 0 0 0 1px var(--line-strong); }
.date-pick { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 38px; padding: 7px var(--sp-3); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 580; cursor: pointer; }
.date-pick:hover { background: var(--surface-soft); border-color: #aab8c6; }
.date-pick .ico { width: 16px; height: 16px; flex-basis: 16px; color: var(--muted); }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.date-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-echo { margin-left: var(--sp-2); font-size: var(--fs-caption); white-space: nowrap; }
.date-echo:empty { display: none; }
.sep-m { display: none; }
.build { margin-left: var(--sp-2); color: var(--muted); font-size: 11px; opacity: .8; }
.print-only { display: none; }
.rules-list { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); color: var(--ink-2); }
.sticky-wide { max-height: 70vh; overflow: auto; }
tr.group-row > th { position: sticky; top: 33px; z-index: 1; color: var(--ink); background: var(--neutral-bg); font-size: 13px; text-align: left; }
.group-row th .muted { margin-left: var(--sp-2); font-weight: 500; }
.pending-note { display: block; color: var(--warning); font-size: var(--fs-caption); font-weight: 600; }
.lead-in { max-width: 62ch; }
.code-table td:first-child { white-space: nowrap; }
.dept-jump { display: none; }
.kpi-row-note { margin: calc(-1 * var(--sp-3)) 0 var(--sp-4); }
.tile.zero .n { color: var(--muted); }
.tile .n.dash { color: var(--muted); }
.cols-unique th:first-child { width: 7rem; }
.hint-line { margin: var(--sp-2) 0 0; color: var(--muted); font-size: var(--fs-caption); }
.page-actions .btn.primary + .btn, .page-actions button.primary + .btn { }
.scroll-wrap { position: relative; }
.scroll-wrap::before, .scroll-wrap::after { content: ""; position: absolute; top: 1px; bottom: 1px; z-index: 3; width: 22px; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.scroll-wrap::before { left: 1px; background: linear-gradient(to right, rgba(16,35,55,.2), rgba(16,35,55,0)); border-radius: 11px 0 0 11px; }
.scroll-wrap::after { right: 1px; background: linear-gradient(to left, rgba(16,35,55,.2), rgba(16,35,55,0)); border-radius: 0 11px 11px 0; }
.scroll-wrap.shadow-l::before, .scroll-wrap.shadow-r::after { opacity: 1; }
.more-toggle, .more-title { display: none; }
.field-help { color: var(--muted); font-size: var(--fs-caption); }
.settings-table th { width: 15rem; }
.settings-table td .help-text { max-width: 60ch; }

/* ---------- Django admin (Setup pages) ---------- */

@media (max-width: 1080px) {
  :root { --rail-width: 0px; }
  .authenticated .sidebar { position: relative; width: 100%; height: auto; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4) var(--sp-1); overflow: visible; }
  .sidebar .brand { width: min(100%, 320px); padding: 0 2px var(--sp-1); border-bottom: 0; }
  .sidebar .brand img { max-width: 120px; height: 32px; }
  .sidebar-account { position: absolute; top: var(--sp-2); right: var(--sp-3); padding: 0; border: 0; }
  .sidebar-account .account-copy, .sidebar-account form { display: none; }
  .side-nav { flex: 0 0 auto; flex-direction: row; gap: var(--sp-2); overflow-x: auto; overflow-y: hidden; padding: 0 0 var(--sp-1); }
  .nav-group { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 2px; }
  .nav-label { display: none; }
  .side-nav a { min-height: var(--tap); padding: 6px var(--sp-3); }
  .side-nav a .ico { display: none; }
  .app-shell { margin-left: 0; }
  .utility-bar { position: static; min-height: 48px; padding: var(--sp-2) var(--sp-5); }
  .workspace-main { min-height: 0; padding: var(--sp-5); }
  .quick-access-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
  .payslip-sections { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sidebar .brand { width: auto; max-width: 235px; }
  .sidebar-account { top: var(--sp-2); right: var(--sp-3); }
  .utility-bar { padding: var(--sp-2) var(--sp-4); }
  .utility-context { display: none; }
  .utility-actions { width: 100%; justify-content: space-between; gap: var(--sp-2); }
  .utility-user { padding-left: var(--sp-3); }
  .workspace-main { padding: var(--sp-4) var(--sp-4) var(--sp-5); }
  .public-main { padding: var(--sp-4); }
  .page-head { margin-bottom: var(--sp-4); }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions button { flex: 1 1 auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .tile { min-height: 76px; padding: var(--sp-3); }
  .tile .n { font-size: 24px; }
  .quick-access-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .quick-access-links a { min-height: var(--tap); padding: var(--sp-2) var(--sp-3); }
  .quick-access-links small, .quick-icon { display: none; }
  .board { grid-template-columns: 1fr; gap: var(--sp-3); }
  .panel, .branding-form-panel, .brand-preview-panel { padding: var(--sp-4); }
  .login { padding: var(--sp-5) var(--sp-4); }
  .grid2, .branding-layout { grid-template-columns: minmax(0, 1fr); }
  .bar form, .bar select, .bar input:not([type=checkbox]) { width: 100%; }
  .bar form input, .bar form select { flex: 1; }
  .field-sm, .field-md, .field-lg { width: 100%; }
  button, .btn, input, select { min-height: var(--tap); }
  td button, td .btn, .person button, .btn.sm, .inline-form input, .inline-form select { min-height: var(--tap); padding: 6px var(--sp-3); }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .person { padding: var(--sp-3) 0; }
  .person a { display: inline-block; padding: var(--sp-1) 0; }
  .foot { flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4) var(--sp-5); }
  .payslip { padding: var(--sp-4); }
  .payslip.is-draft::after { font-size: 80px; }
  .payslip-head .when { text-align: left; }
}

/* ---------- round 2: small screens ---------- */
@media (max-width: 1080px) {
  .more-toggle { position: sticky; right: 0; z-index: 2; display: inline-flex; min-height: var(--tap); flex: 0 0 auto; align-items: center; gap: 6px; padding: 6px var(--sp-3); color: #fff; background: var(--nav-active); border: 0; border-radius: var(--r); box-shadow: -10px 0 10px -4px var(--nav); font-size: 13.5px; }
  .more-toggle:hover { color: #fff; background: #26486b; }
  .more-toggle .ico { display: inline-block; width: 18px; height: 18px; }
  .nav-more { position: fixed; inset: auto 0 0 0; z-index: 60; display: none; max-height: 78vh; flex-direction: column; gap: var(--sp-3); overflow-y: auto; padding: var(--sp-4) var(--sp-4) var(--sp-5); background: var(--nav); border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.35); }
  .nav-more.open { display: flex; }
  .nav-more .nav-group { flex-direction: column; align-items: stretch; }
  .nav-more .nav-label { display: block; }
  .nav-more .side-nav a, .nav-more a { display: flex; min-height: var(--tap); align-items: center; gap: 10px; padding: 6px var(--sp-3); color: var(--nav-text); border-radius: var(--r); white-space: nowrap; text-decoration: none; }
  .nav-more a .ico { display: inline-block; }
  .nav-more a.on { color: #fff; background: var(--nav-active); }
  .more-title { display: flex; align-items: center; justify-content: space-between; color: #fff; }
  .more-title .more-close { min-height: 32px; color: var(--nav-text); background: none; border: 0; }
  .dept-jump { display: flex; gap: var(--sp-2); margin: 0 calc(-1 * var(--sp-4)) var(--sp-4); padding: 0 var(--sp-4) var(--sp-1); overflow-x: auto; scrollbar-width: none; }
  .dept-jump a { flex: 0 0 auto; padding: 6px var(--sp-3); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 13px; font-weight: 560; text-decoration: none; white-space: nowrap; }
  .board .dept { scroll-margin-top: var(--sp-3); }
}
@media (max-width: 650px) {
  .utility-actions { min-width: 0; }
  .sync-pill { flex: 0 0 auto; padding-right: 9px; }
  .sync-pill .pill-lead { display: none; }
  .utility-user { min-width: 0; flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: flex-end; gap: 0; overflow: hidden; white-space: nowrap; }
  .utility-user-name, .utility-user-role { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .utility-user-name { flex: 0 1 auto; }
  .utility-user-role { flex: 0 1 auto; }
  .sep-m { display: inline; white-space: pre; }
  .seg { display: flex; width: 100%; }
  .seg a { flex: 1 1 0; justify-content: center; }
  .date-echo { display: none; }
  /* tables that become stacked rows with a label per value */
  table.stack-sm { min-width: 0 !important; }
  .scroll table.stack-sm { min-width: 0; }
  table.stack-sm thead, table.stack-sm tr:first-child:has(> th) { display: none; }
  table.stack-sm tr { display: block; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td, table.stack-sm th { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding: 4px 0; text-align: right; border: 0; background: transparent !important; white-space: normal; }
  table.stack-sm td[data-label]::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: var(--fs-caption); font-weight: 600; text-align: left; }
  table.stack-sm td.lead { display: block; padding-bottom: var(--sp-1); font-weight: 620; text-align: left; }
  table.stack-sm td.lead::before { display: none; }
  table.stack-sm td.actions { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  table.stack-sm td.actions::before { display: none; }
  table.stack-sm td > form, table.stack-sm td .inline-form { width: 100%; }
  table.stack-sm .inline-form input { flex: 1 1 100%; width: 100%; }
  table.stack-sm tr.total { display: flex; justify-content: space-between; }
  table.stack-sm tr.total td { padding: 0; }
  table.stack-sm tr.total td[colspan] { flex: 1 1 auto; text-align: left; }
  table.stack-sm tr.total td::before { display: none; }
  .panel > table:not(.facts):not(.stack-sm) { display: block; max-width: 100%; overflow-x: auto; }
  table.facts, table.facts tbody { display: block; }
  table.facts td { min-width: 0; overflow-wrap: anywhere; }
  table.facts td + td + td { grid-column: 1 / -1; }
  table.facts tr { display: grid; grid-template-columns: 8rem minmax(0, 1fr); }
  table.facts th, table.facts td { width: auto; }
  table.facts td.side-note { width: auto; }
  .page-head-main { flex-basis: 100%; }
  .net-pay { font-size: 18px; }
  .payslip-head .when { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media print {
  .print-only { display: block; }
  .sidebar, .utility-bar, .bar, .noprint, .skip-link, .page-actions, .crumbs { display: none !important; }
  body.authenticated .app-shell { margin-left: 0; }
  .workspace-main, .public-main { max-width: none; padding: 0; }
  body { background: #fff; }
  .panel, .tile { box-shadow: none; }
  .badge { border-color: #999; }
  .payslip { border: 0; padding: 0; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}.mt-4{margin-top:var(--sp-4)}.mt-5{margin-top:var(--sp-5)}.mb-0{margin-bottom:0}.mb-3{margin-bottom:var(--sp-3)}
.row.end-x{justify-content:flex-end}
table.facts td.side-note{width:16rem}
td.check-cell{width:32px}
.scroll td:first-child, .scroll th:first-child { white-space: nowrap; }
