/* =====================================================================
   MAZIV Payroll — design tokens and styles
   Palette: MAZIV navy for structure, cool concrete for the ground,
   hard-hat yellow only for "your turn" (the current approval step and
   items that need someone). Lora carries money and page titles; Inter
   carries everything else, with tabular figures in all numbers.
   ===================================================================== */
@font-face { font-family: Inter; src: url(../fonts/inter-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter-500.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter-600.woff) format("woff"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: Lora; src: url(../fonts/lora-var.woff) format("woff"); font-weight: 400 700; font-display: swap; }

:root {
  --navy: #002060; --navy-2: #0d3380; --navy-ink: #001542; --navy-soft: #e6ebf5;
  --concrete: #edefeb; --paper: #ffffff; --ink: #18202e; --muted: #5d6572; --rule: #d6dad3; --rule-2: #e7e9e4;
  --hat: #f2b705; --hat-soft: #fff4cf; --hat-ink: #7a5a00;
  --ok: #1e7a4c; --ok-soft: #e3f1e9; --err: #b3261e; --err-soft: #fbe9e7;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Lora, Georgia, "Times New Roman", serif;
  --r-s: 6px; --r-m: 10px;
  --step--1: .8125rem; --step-0: .9375rem; --step-1: 1.125rem; --step-2: 1.5rem; --step-3: 2rem; --step-4: 2.75rem;
  font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--concrete);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--step-0); line-height: 1.5; }
a { color: var(--navy-2); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: var(--step-1); font-weight: 600; }
h3 { font-size: var(--step-0); font-weight: 600; }
p { margin: .5rem 0; }
:focus-visible { outline: 3px solid var(--hat); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--hat); color: var(--ink); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
.muted { color: var(--muted); } .small { font-size: var(--step--1); } .err { color: var(--err); }
.r { text-align: right; } .nowrap { white-space: nowrap; } .b { font-weight: 600; } .dim { opacity: .55; }
.money, .tbl td.r, .tbl th.r, .numin, dd { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.5rem; padding: .45rem 1rem;
  border: 1px solid var(--rule); border-radius: var(--r-s); background: var(--paper); color: var(--ink);
  font: 500 var(--step-0)/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b8bdb4; background: #fafbf9; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--rule-2); }
.btn.sm { min-height: 2rem; padding: .25rem .65rem; font-size: var(--step--1); }
.btn.block { width: 100%; }
.linkish { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: left; }
input, select, textarea { font: inherit; padding: .5rem .65rem; border: 1px solid #c4c9c0; border-radius: var(--r-s); background: #fff; width: 100%; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-2); outline-offset: 0; border-color: var(--navy-2); }
input:disabled, select:disabled { background: var(--concrete); color: var(--muted); }
label { display: flex; flex-direction: column; gap: .3rem; font-size: var(--step--1); font-weight: 500; margin: .65rem 0; }
label.check, label.radio { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; font-size: var(--step-0); }
label.check input, label.radio input { width: 1.05rem; height: 1.05rem; margin-top: .2rem; accent-color: var(--navy); flex: none; }
fieldset { border: 1px solid var(--rule); border-radius: var(--r-m); margin: .8rem 0; padding: .4rem 1rem .6rem; }
legend { font-weight: 600; padding: 0 .35rem; }
fieldset label.check { display: inline-flex; margin-right: 1.2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.hint { color: var(--muted); font-size: var(--step--1); }

/* ---------- setup problem (boot-check.js) ---------- */
.setup-missing { max-width: 640px; margin: 10vh auto; padding: 1.6rem 1.8rem; background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--hat); border-radius: var(--r-m); }
.setup-missing h1 { font: 600 var(--step-2)/1.2 var(--serif); margin-bottom: .6rem; }

/* ---------- sandbox ---------- */
.sandbox-band { background: var(--hat); color: var(--ink); padding: .45rem 1rem; font-weight: 600; font-size: var(--step--1); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.sandbox-band a, .sandbox-band button { color: var(--ink); font-weight: 600; }
.demo-users { margin-top: 1.6rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.demo-users h2 { font-size: var(--step-0); margin-bottom: .3rem; }
.demo-users .btn { width: 100%; justify-content: space-between; margin: .3rem 0; }
.demo-users .btn small { color: var(--muted); font-weight: 400; }

/* ---------- sign-in ---------- */
body.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 38%) 1fr; background: var(--paper); }
.signin-side { background: var(--navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.signin-side::after { /* the letterhead stripes of MAZIV forms */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background: linear-gradient(var(--hat) 0 4px, transparent 4px 7px, #fff 7px 9px, transparent 9px); opacity: .9; }
.signin-word { font: 600 clamp(3rem, 7vw, 5.5rem)/1 var(--serif); margin: auto 0 1rem; letter-spacing: -.01em; }
.signin-co { margin: 0 0 2rem; font-weight: 600; } .signin-co span { font-weight: 400; color: #b9c6e4; }
.signin-main { display: grid; place-items: center; padding: 2rem; }
.signin-box { width: min(380px, 100%); }
.signin-box h1 { font: 600 var(--step-3)/1.15 var(--serif); margin-bottom: 1rem; }
.note { padding: .65rem .85rem; border-radius: var(--r-s); background: var(--navy-soft); }
.note.err { background: var(--err-soft); color: var(--err); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.rail { background: var(--navy); color: #dfe6f5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1.1rem .8rem; overflow-y: auto; }
.rail-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.05rem; padding: .2rem .5rem 1rem; }
.rail-brand b { letter-spacing: .06em; font-weight: 700; }
.rail-brand span { color: #fff; }
.nav-group { margin: .4rem 0 .9rem; }
.nav-group p { margin: 0 .6rem .3rem; font-size: var(--step--1); color: #8fa1c9; }
.nav-group a { display: block; padding: .45rem .7rem; border-radius: var(--r-s); color: #dfe6f5; text-decoration: none; }
.nav-group a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group a[aria-current="page"] { background: #fff; color: var(--navy); font-weight: 600; }
.nav-group a.ext { color: #b9c6e4; }
.rail-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding: .9rem .6rem 0; display: flex; flex-direction: column; gap: .1rem; }
.who-name { color: #fff; font-weight: 600; text-decoration: none; }
.who-name:hover { color: #fff; text-decoration: underline; }
.who-role { color: #8fa1c9; font-size: var(--step--1); margin-bottom: .5rem; }
.rail-user .linkish { color: #dfe6f5; font-size: var(--step--1); }
.rail-user .linkish:hover { color: #fff; text-decoration: underline; }
.mobile-bar { display: none; }
main#view { outline: none; min-width: 0; }
.pad { padding: 2rem 2.4rem 3rem; max-width: 1320px; }
.pad.narrow { max-width: 640px; }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1, .page-title { font: 600 var(--step-3)/1.15 var(--serif); letter-spacing: -.005em; }
.lede { color: var(--muted); margin: .35rem 0 0; max-width: 70ch; }
.back { display: inline-block; margin-bottom: .3rem; text-decoration: none; font-size: var(--step--1); }
.back::before { content: "‹ "; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.panel, .card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1.2rem 1.4rem; margin: 0 0 1.2rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel h2, .card h2 { margin-bottom: .6rem; }
.panel-head, .card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.panel.flush .panel-head { padding: 1rem 1.4rem .2rem; }
.panel-head h2, .card-head h2 { margin: 0; }
.empty { color: var(--muted); padding: 1rem 1.4rem; margin: 0; }
.panel:not(.flush) > .empty { padding: 0; }
.banner { background: var(--navy-soft); border-left: 4px solid var(--navy); padding: .7rem 1rem; border-radius: var(--r-s); }
.banner.warn { background: var(--hat-soft); border-color: var(--hat); }
.banner.err { background: var(--err-soft); border-color: var(--err); }
.filters, .toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 0 0 .8rem; }
.filters input, .toolbar input { max-width: 280px; } .filters select { max-width: 220px; }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; line-height: 1.5; background: var(--rule-2); color: #3f4652; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.chip.warn { background: var(--hat-soft); color: var(--hat-ink); }
.st-draft { background: var(--rule-2); } .st-approved { background: var(--navy-soft); color: var(--navy); }
.st-released { background: var(--ok-soft); color: var(--ok); } .st-void { background: var(--err-soft); color: var(--err); }
.warn-text { color: var(--hat-ink); }
.chip.hidden-pay { background: repeating-linear-gradient(135deg, #eceee9 0 6px, #e2e5df 6px 12px); color: var(--muted); }
.hidden-note { color: var(--muted); font-size: var(--step--1); margin: .6rem 0 0; flex-basis: 100%; }
.tbl tr.hidden-row td { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.kv.two { grid-template-columns: max-content 1fr max-content 1fr; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin: 1.6rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--navy); border-color: var(--navy); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin: 0 0 1.2rem; }
.tile { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.tile span { color: var(--muted); font-size: var(--step--1); }
.tile strong { font: 600 var(--step-2)/1.2 var(--serif); font-variant-numeric: tabular-nums lining-nums; }

/* ---------- the approval track (the signature element) ---------- */
.track { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: s; }
.track li { position: relative; padding: 0 1.2rem 0 0; }
.track li::before { content: ""; position: absolute; top: 1.05rem; left: 2.6rem; right: .5rem; height: 2px; background: var(--rule); }
.track li:last-child::before { display: none; }
.track li.done::before { background: var(--navy); }
.track .dot { position: relative; z-index: 1; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; background: var(--paper); border: 2px solid var(--rule); color: var(--muted); }
.track li.done .dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.track li.now .dot { border: 3px solid var(--hat); color: var(--ink); background: var(--hat-soft); }
.track b { display: block; margin-top: .55rem; }
.track p { margin: .1rem 0 0; color: var(--muted); font-size: var(--step--1); max-width: 30ch; }
.track li.now b { color: var(--ink); }
.track li.wait b { color: var(--muted); }

/* ---------- pay run totals ---------- */
.sums { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2.5rem; padding: 1.2rem 1.4rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); }
.sum-main span { display: block; color: var(--muted); font-size: var(--step--1); }
.sum-main strong { font: 600 var(--step-4)/1 var(--serif); color: var(--navy); letter-spacing: -.01em; }
.sums dl { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin: 0; }
.sums dt { color: var(--muted); font-size: var(--step--1); } .sums dd { margin: 0; font-weight: 600; }

/* ---------- overview ---------- */
.hero { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; border-top: 4px solid var(--navy); }
.hero-label { color: var(--muted); font-size: var(--step--1); margin: 0; }
.hero-period { font: 600 var(--step-2)/1.2 var(--serif); margin: .2rem 0; }
.hero-figs { display: flex; gap: 2rem; margin: 0; align-items: flex-end; flex-wrap: wrap; }
.hero-figs dt { color: var(--muted); font-size: var(--step--1); } .hero-figs dd { margin: 0; font-weight: 600; font-size: var(--step-1); }
.hero-figs .big dd { font: 600 var(--step-4)/1 var(--serif); color: var(--navy); }
.setup ol { margin: .4rem 0 0; padding-left: 1.4rem; }
.setup li { margin: .45rem 0; } .setup li.done a { color: var(--muted); }
.setup li .chip { margin-left: .5rem; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 0 1.2rem; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { padding: .6rem 0 .6rem .9rem; border-left: 3px solid var(--hat); margin: 0 0 .6rem; }
.todo li span { display: block; color: var(--muted); font-size: var(--step--1); }
.glance { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; margin: 0; }
.glance dt { color: var(--muted); font-size: var(--step--1); } .glance dd { margin: 0; font: 600 var(--step-1)/1.3 var(--serif); }

/* ---------- users ---------- */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.roles > div { border-top: 3px solid var(--navy); background: var(--paper); border-radius: 0 0 var(--r-m) var(--r-m); padding: .9rem 1.1rem; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.roles h2 { margin: 0 0 .3rem; } .roles p { margin: 0 0 .5rem; font-size: var(--step--1); color: var(--muted); }
.role-pick label.radio { border: 1px solid var(--rule); border-radius: var(--r-s); padding: .55rem .7rem; margin: .4rem 0; }
.role-pick label.radio:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.role-pick small { display: block; color: var(--muted); }
.temp-pw { font: 600 1.5rem/1.2 var(--sans); letter-spacing: .08em; background: var(--hat-soft); border: 1px dashed var(--hat); border-radius: var(--r-s); padding: .7rem 1rem; text-align: center; user-select: all; }
.form-panel { max-width: 460px; }

/* ---------- settings ---------- */
.settings fieldset.panel { padding: .6rem 1.4rem 1rem; }
.settings legend { font-size: var(--step-1); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.4rem; }
.set-grid label span { font-weight: 500; }
.sticky-save { position: sticky; bottom: 0; padding: .8rem 0; background: var(--concrete); border-top: 1px solid var(--rule); }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; } .tbl-wrap.short { max-height: 380px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--step--1); background: var(--paper); }
.tbl th, .tbl td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule-2); vertical-align: top; text-align: left; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl thead th { background: #f6f7f4; font-weight: 600; color: var(--muted); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--rule); }
.tbl tbody tr:hover td { background: #fafbf8; }
.tbl tfoot th { background: #f6f7f4; border-top: 2px solid var(--ink); font-variant-numeric: tabular-nums; }
.tbl td:first-child, .tbl th:first-child { padding-left: 1.4rem; } .tbl td:last-child, .tbl th:last-child { padding-right: 1.4rem; }
.panel:not(.flush) .tbl td:first-child, .panel:not(.flush) .tbl th:first-child, .card .tbl td:first-child, .card .tbl th:first-child { padding-left: .5rem; }
.tbl.reg td, .tbl.reg th { white-space: nowrap; } .tbl.reg td:first-child { white-space: normal; min-width: 210px; }
.tbl.reg td.b { color: var(--navy); }
.numin { width: 5.4rem; text-align: right; padding: .35rem .45rem; }
.tbl.inputs td { vertical-align: middle; }
.tbl.inputs td:first-child { min-width: 190px; }
.tbl.inputs th.prem-col { min-width: 140px; }
.shell { align-items: start; }
.pick-list { max-height: 50vh; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r-s); padding: .3rem .7rem; }
.pick-list label { margin: .25rem 0; }

/* ---------- export menu ---------- */
details.menu { position: relative; }
details.menu summary { list-style: none; } details.menu summary::-webkit-details-marker { display: none; }
details.menu summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; margin: .3rem 0 0 .2rem; }
details.menu > div { position: absolute; right: 0; top: calc(100% + 4px); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m);
  box-shadow: 0 12px 32px rgba(0, 21, 66, .14); display: flex; flex-direction: column; min-width: 260px; z-index: 5; padding: .35rem; }
details.menu > div button, details.menu > div a { background: none; border: 0; font: inherit; text-align: left; padding: .55rem .75rem; border-radius: var(--r-s); cursor: pointer; color: var(--ink); text-decoration: none; }
details.menu > div button:hover, details.menu > div a:hover { background: var(--concrete); }

/* ---------- dialog ---------- */
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, 94vw); box-shadow: 0 30px 80px rgba(0, 21, 66, .3); color: var(--ink); }
dialog.dlg.wide { width: min(780px, 96vw); }
dialog.dlg::backdrop { background: rgba(0, 21, 66, .45); }
.dlg header { padding: 1.2rem 1.4rem .2rem; } .dlg header h3 { margin: 0; font: 600 var(--step-2)/1.2 var(--serif); }
.dlg-body { padding: .3rem 1.4rem; max-height: 68vh; overflow: auto; }
.dlg-err { margin: .4rem 1.4rem; padding: .55rem .8rem; background: var(--err-soft); color: var(--err); border-radius: var(--r-s); }
.dlg footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.4rem 1.2rem; flex-wrap: wrap; }

/* ---------- toasts, idle warning ---------- */
#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; max-width: min(460px, 92vw); }
.toast { background: var(--navy-ink); color: #fff; padding: .75rem 1rem; border-radius: var(--r-s); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.err { background: var(--err); }
.idle-warn { position: fixed; top: 0; left: 0; right: 0; background: var(--hat); color: var(--ink); padding: .7rem 1rem; text-align: center; font-weight: 600; z-index: 60; }

/* ---------- payslip and printed documents ---------- */
.payslip { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1.6rem; max-width: 840px; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--navy); padding-bottom: .7rem; margin-bottom: 1rem; }
.doc-head h2 { margin: 0; color: var(--navy); font: 600 var(--step-2)/1.1 var(--serif); }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1rem; }
.slip-cols h3 { color: var(--navy); }
table.slip { width: 100%; border-collapse: collapse; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
table.slip td { padding: .35rem 0; border-bottom: 1px solid var(--rule-2); }
table.slip tr.tot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
.net { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem; padding: .9rem 1.1rem; background: var(--navy); color: #fff; border-radius: var(--r-s); }
.net strong { font: 600 var(--step-3)/1 var(--serif); font-variant-numeric: tabular-nums; }
.slip-foot { margin-top: .9rem; display: flex; flex-direction: column; gap: .25rem; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.signs div { border-top: 1px solid var(--ink); padding-top: .3rem; text-align: center; font-size: var(--step--1); }

/* ---------- small screens ---------- */
@media screen and (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
}
@media screen and (max-width: 820px) {
  body.signin { grid-template-columns: 1fr; }
  .signin-side { padding: 1.4rem 1.5rem 2rem; }
  .signin-word { margin: 1rem 0 .3rem; font-size: 3rem; } .signin-co { margin: 0; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mobile-bar { display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 9; height: 46px; background: var(--navy); color: #fff; padding: .5rem .8rem; }
  .mobile-bar .rail-brand { padding: 0; }
  .rail > .rail-brand { display: none; }
  .menu-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; font: 600 var(--step--1) var(--sans); padding: .45rem .8rem; border-radius: var(--r-s); cursor: pointer; }
  .rail { position: fixed; top: 46px; left: 0; width: 270px; height: calc(100vh - 46px); z-index: 8; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
  body.nav-open main#view { filter: brightness(.6); }
  body.nav-open .rail { transform: none; visibility: visible; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .pad { padding: 1.2rem 1rem 2.4rem; }
  .page-head h1, .page-title { font-size: var(--step-2); }
  .grid2, .grid3, .slip-cols { grid-template-columns: 1fr; }
  .kv.two { grid-template-columns: max-content 1fr; }
  .track { grid-template-columns: 1fr; gap: 1rem; }
  .track li { display: grid; grid-template-columns: 2.1rem 1fr; gap: .8rem; }
  .track b { margin-top: .3rem; }
  .track li::before { left: 1.05rem; top: 2.1rem; bottom: -1rem; right: auto; width: 2px; height: auto; }
  .sum-main strong, .hero-figs .big dd { font-size: var(--step-3); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- print ---------- */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  .rail, .mobile-bar, .no-print, #toasts, .skip, .idle-warn { display: none !important; }
  .shell { display: block; } body { background: #fff; font-size: 10.5pt; }
  .pad { padding: 0; max-width: none; }
  .payslip { border: 0; padding: 0; max-width: none; }
  .net { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-tbl { font-size: 8pt; } .print-tbl th, .print-tbl td { padding: 2px 4px; }
  .tbl thead th { position: static; }
}
