/* Rosterwick · design system
   Type scale 12 / 13 / 14 / 16 / 20 / 28 / 40 · spacing 4 8 12 16 24 32 48 · radius 4 / 8 / 12 */

:root {
  --petrol: #0E5A6B;
  --petrol-strong: #0A4654;
  --petrol-ink: #0E5A6B;
  --petrol-tint: #DCEBEF;
  --petrol-wash: #EDF5F7;
  --lilac: #D9D2FF;
  --lilac-ink: #3F3492;
  --lilac-wash: #F0EDFF;

  --bg: #EEF3F5;
  --surface: #FFFFFF;
  --surface-2: #F6F9FA;
  --surface-3: #E7EEF1;
  --line: #D6E0E4;
  --line-strong: #B9C8CE;
  --ink: #10262D;
  --ink-2: #3F5962;
  --ink-3: #587079;
  --on-petrol: #FFFFFF;

  --ok: #1D7048;   --ok-bg: #DDF0E5;
  --warn: #965200; --warn-bg: #FCEBD5;
  --bad: #B3261E;  --bad-bg: #F9E0DE;
  --info: #0E5A6B; --info-bg: #DCEBEF;

  /* muster codes */
  --c-p-bg: #DCEBEF;  --c-p: #0B4F5E;
  --c-lt-bg: #FCE6CF; --c-lt: #8A4500;
  --c-h-bg: #DCEBEF;  --c-h: #0B4F5E;
  --c-l-bg: #D9D2FF;  --c-l: #3F3492;
  --c-w-bg: #E3E9EC;  --c-w: #485F68; --c-w-hatch: #CFD9DD;
  --c-ho-bg: #F4E4C1; --c-ho: #6E4A05;
  --c-a-bg: #F9DCD9;  --c-a: #A3211A;

  --f-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 4px; --r2: 8px; --r3: 12px;
  --shadow-pop: 0 1px 2px rgba(16, 38, 45, .08), 0 12px 32px rgba(16, 38, 45, .16);
  --shadow-sticky: 0 1px 0 var(--line);
  --top-h: 56px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: 120ms;
  --t-med: 180ms;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --petrol: #2A8197;
  --petrol-strong: #33A0B8;
  --petrol-ink: #7FCBDC;
  --petrol-tint: #163E48;
  --petrol-wash: #11313A;
  --lilac: #CFC6FF;
  --lilac-ink: #DCD6FF;
  --lilac-wash: #2A2652;

  --bg: #0B181C;
  --surface: #11232A;
  --surface-2: #152B33;
  --surface-3: #1B3640;
  --line: #234149;
  --line-strong: #31545E;
  --ink: #E3EDF0;
  --ink-2: #ADC2C9;
  --ink-3: #8FA8B0;
  --on-petrol: #FFFFFF;

  --ok: #7ED3A4;   --ok-bg: #133A29;
  --warn: #F2B66B; --warn-bg: #3D2A10;
  --bad: #FF9E96;  --bad-bg: #431C1A;
  --info: #7FCBDC; --info-bg: #163E48;

  --c-p-bg: #173F49;  --c-p: #9AD8E6;
  --c-lt-bg: #47300F; --c-lt: #F7B86B;
  --c-h-bg: #173F49;  --c-h: #9AD8E6;
  --c-l-bg: #3A3473;  --c-l: #E2DCFF;
  --c-w-bg: #182E35;  --c-w: #8FA8B0; --c-w-hatch: #22404A;
  --c-ho-bg: #42361A; --c-ho: #F0D08F;
  --c-a-bg: #4A1F1D;  --c-a: #FFA79F;

  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/20px var(--f-sans);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 28px; line-height: 34px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
h4 { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--petrol-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r2); }
.skip:focus { left: 8px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s16 { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--petrol-strong); outline-offset: 2px; }
kbd { font: 500 11px/16px var(--f-mono); padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r1); background: var(--surface); color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r2);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: var(--on-petrol); }
.btn.primary:hover { background: var(--petrol-strong); border-color: var(--petrol-strong); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger.solid { color: #2a0a08; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-petrol); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--ink-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r2); border: 1px solid transparent; background: transparent; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--petrol-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- segmented, tabs, tags ---------- */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r2); background: var(--surface-3); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 38, 45, .12); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.tab { height: 40px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--petrol); font-weight: 600; }
.tab:hover { color: var(--ink); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); font: 600 11px/18px var(--f-mono); }
.count.hot { background: var(--lilac); color: #2E2670; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r1); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.lilac { background: var(--lilac); color: #2E2670; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.field .err { font-size: 12px; line-height: 16px; color: var(--bad); font-weight: 500; display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; min-width: 0; height: 38px; padding: 0 12px; border-radius: var(--r2);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { height: auto; min-height: 76px; padding: 8px 12px; resize: vertical; line-height: 20px; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23587079' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-tint); }
input[type="time"], input[type="date"], input.mono { font-family: var(--f-mono); font-size: 13px; }
input[disabled], select[disabled] { background: var(--surface-2); color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.stack { display: grid; gap: var(--s4); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--petrol); margin: 0; }
.switch { width: 38px; height: 22px; border-radius: 11px; border: 0; background: var(--line-strong); position: relative; flex: none; transition: background var(--t-fast); padding: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-med) var(--ease); }
.switch[aria-checked="true"] { background: var(--petrol); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--petrol-tint); border-color: var(--petrol); color: var(--petrol-ink); font-weight: 600; }
.saved-note { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: var(--s5); padding: 0 var(--s5);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: block; line-height: 18px; }
.brand small { display: block; font-size: 11px; line-height: 14px; color: var(--ink-3); font-weight: 500; }
.mark { width: 28px; height: 28px; flex: none; }
.nav { display: flex; align-items: stretch; gap: 2px; height: 100%; min-width: 0; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; border-top: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--petrol); }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.searchbtn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); color: var(--ink-3); font-size: 13px; min-width: 190px; }
.searchbtn kbd { margin-left: auto; }
.searchbtn:hover { border-color: var(--line-strong); color: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--lilac); color: #2E2670; flex: none; border: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.o-BAN { background: #D3E9EF; color: #0A4654; }
.avatar.o-KP { background: #E2DCFF; color: #3F3492; }
.avatar.o-HQ { background: #F1E3C6; color: #6E4A05; }
:root[data-theme="dark"] .avatar.o-BAN { background: #1D4B56; color: #CDEFF6; }
:root[data-theme="dark"] .avatar.o-KP { background: #3A3473; color: #E8E4FF; }
:root[data-theme="dark"] .avatar.o-HQ { background: #4A3C1C; color: #F6DFAE; }
.side-switch { display: inline-flex; }
.view { padding: var(--s5) var(--s5) var(--s7); max-width: 1440px; margin: 0 auto; min-height: calc(100vh - var(--top-h)); }
.view.narrow { max-width: 1120px; }
.tabbar { display: none; }
.m-only { display: none !important; }

/* page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.ph-t { display: grid; gap: 4px; min-width: 0; }
.ph-t .eyebrow { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.ph-t p { color: var(--ink-2); }
.ph-a { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.back:hover { color: var(--ink); }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); min-height: 52px; }
.panel-b { padding: var(--s4); }
.panel-b.flush { padding: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px var(--s4); font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rule { height: 1px; background: var(--line); margin: var(--s4) 0; border: 0; }

/* tables */
.tbl-wrap { overflow-x: visible; }
.num .btn, .tbl th { font-family: var(--f-sans); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: var(--top-h); z-index: 2; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface-2); position: sticky; bottom: 0; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .who b { font-weight: 600; display: block; }
.tbl .who small { display: block; color: var(--ink-3); font-size: 12px; line-height: 16px; }
.tbl input[type="number"] { height: 30px; width: 96px; text-align: right; font-family: var(--f-mono); font-size: 13px; padding: 0 8px; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }

/* empty, skeleton */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: var(--s7) var(--s5); color: var(--ink-2); }
.empty svg { width: 96px; height: 72px; margin-bottom: 4px; }
.empty h3 { color: var(--ink); }
.empty p { max-width: 380px; }
.skel { display: grid; gap: 10px; padding: var(--s4); }
.skel i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.skel i:nth-child(3n) { width: 72%; }
.skel i:nth-child(3n+1) { width: 92%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--r2); background: #10262D; color: #EEF3F5; box-shadow: var(--shadow-pop); font-size: 14px; animation: rise var(--t-med) var(--ease); }
:root[data-theme="dark"] .toast { background: #E3EDF0; color: #10262D; }
.toast span { flex: 1; min-width: 0; }
.toast.bad { background: #5B1511; color: #FFE9E7; }
.toast button { border: 0; background: transparent; color: var(--lilac); font-weight: 650; padding: 6px 8px; border-radius: 6px; }
:root[data-theme="dark"] .toast button { color: #3F3492; }
.toast button:hover { background: rgba(255, 255, 255, .1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* overlays */
.scrim { position: fixed; inset: 0; background: rgba(9, 25, 30, .42); z-index: 60; animation: fade var(--t-med) var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { position: fixed; z-index: 61; left: 50%; top: 8vh; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); max-height: 84vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r3); box-shadow: var(--shadow-pop); border: 1px solid var(--line); animation: pop var(--t-med) var(--ease); }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal.drawer { left: auto; right: 0; top: 0; bottom: 0; max-height: none; height: 100vh; transform: none; width: min(420px, 100vw); border-radius: 0; border-width: 0 0 0 1px; animation: slidein var(--t-med) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px); } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.modal-h p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.modal-b { padding: var(--s5); overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.modal-f { display: flex; justify-content: flex-end; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r3) var(--r3); flex-wrap: wrap; }
.modal-f .demo-note { margin-right: auto; }
.demo-note { font-size: 12px; color: var(--ink-3); }
.menu { position: fixed; z-index: 70; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-pop); padding: 4px; animation: fade var(--t-fast); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: 6px; text-align: left; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); }
.menu button .mono { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 4px; }
.tip { position: fixed; z-index: 80; pointer-events: none; background: #10262D; color: #EEF3F5; padding: 8px 10px; border-radius: 6px; font-size: 12px; line-height: 16px; max-width: 240px; box-shadow: var(--shadow-pop); }
.tip b { font-weight: 600; }
.tip .mono { color: var(--lilac); }

/* palette */
.pal { top: 12vh; width: min(600px, calc(100vw - 32px)); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-in input { border: 0; height: 52px; padding: 0; font-size: 16px; box-shadow: none !important; background: transparent; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-list .grp { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: left; min-height: 40px; }
.pal-item[aria-selected="true"] { background: var(--petrol-tint); }
.pal-item small { color: var(--ink-3); margin-left: auto; font-size: 12px; white-space: nowrap; }
.pal-item .avatar { width: 26px; height: 26px; font-size: 10px; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s5); }
.keys div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; border-bottom: 1px dashed var(--line); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
.login-art { background: var(--petrol); color: #EEF3F5; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .login-art { background: #0D3C47; }
.login-art .brand { color: #fff; }
.login-art .brand small { color: #BFD9DF; }
.login-art h1 { font-size: 40px; line-height: 44px; max-width: 520px; font-weight: 650; letter-spacing: -.02em; }
.login-art p { color: #CFE3E8; max-width: 480px; font-size: 16px; line-height: 24px; margin-top: 16px; }
.login-roll { display: grid; grid-template-columns: 120px repeat(14, 1fr); gap: 3px; max-width: 560px; font: 500 11px/20px var(--f-mono); }
.login-roll span { height: 22px; border-radius: 3px; display: grid; place-items: center; }
.login-roll .nm { justify-content: start; padding-left: 2px; color: #CFE3E8; font-family: var(--f-sans); font-size: 12px; }
.login-roll .p { background: rgba(255, 255, 255, .14); color: #E6F2F5; }
.login-roll .l { background: #D9D2FF; color: #3F3492; }
.login-roll .w { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 3px, transparent 3px 6px); color: #9CC3CC; }
.login-roll .lt { background: #F6C98F; color: #5A2E00; }
.login-roll .h { background: linear-gradient(135deg, rgba(255,255,255,.22) 50%, rgba(255,255,255,.05) 50%); color: #E6F2F5; }
.login-foot { font-size: 12px; color: #A9CBD3; }
.login-form { display: grid; align-content: center; padding: 48px; background: var(--surface); gap: var(--s5); }
.login-form form { display: grid; gap: var(--s4); width: 100%; max-width: 380px; }
.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-pick button { text-align: left; padding: 12px; border-radius: var(--r2); border: 1px solid var(--line-strong); background: var(--surface); display: grid; gap: 2px; }
.side-pick button b { font-weight: 600; font-size: 14px; }
.side-pick button span { font-size: 12px; color: var(--ink-3); line-height: 16px; }
.side-pick button[aria-pressed="true"] { border-color: var(--petrol); background: var(--petrol-wash); box-shadow: inset 0 0 0 1px var(--petrol); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------- muster ---------- */
.today-strip { display: flex; align-items: center; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: var(--s4); min-height: 52px; flex-wrap: wrap; }
.today-strip > div { padding: 8px 16px; display: grid; gap: 0; border-right: 1px solid var(--line); }
.today-strip > div:last-child { border-right: 0; margin-left: auto; }
.today-strip b { font: 600 20px/24px var(--f-mono); }
.today-strip span { font-size: 12px; color: var(--ink-3); line-height: 16px; white-space: nowrap; }
.today-strip .when b { font-family: var(--f-sans); font-size: 14px; line-height: 20px; }
.toolrow { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.brushes { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); flex-wrap: wrap; }
.brush { height: 32px; min-width: 32px; padding: 0 8px 0 4px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.brush:hover { background: var(--surface-3); color: var(--ink); }
.brush[aria-pressed="true"] { border-color: var(--petrol); background: var(--petrol-wash); color: var(--ink); font-weight: 600; }
.brush .sw { width: 24px; height: 22px; border-radius: var(--r1); display: grid; place-items: center; font: 600 10px/1 var(--f-mono); }
.brush .k { font: 500 10px/1 var(--f-mono); color: var(--ink-3); }
.hint { font-size: 12px; color: var(--ink-3); }
.lockbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r2); background: var(--lilac-wash); color: var(--lilac-ink); border: 1px solid var(--lilac); margin-bottom: var(--s3); font-size: 13px; }
.lockbar .btn { margin-left: auto; }

.muster { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); user-select: none; -webkit-user-select: none; touch-action: none; }
.mgrid { display: grid; grid-template-columns: 200px repeat(var(--days), minmax(0, 1fr)) repeat(4, 42px); }
.mgrid > * { min-width: 0; }
.mhead { position: sticky; top: var(--top-h); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line-strong); display: grid; place-items: center; height: 44px; font-size: 11px; line-height: 13px; color: var(--ink-3); text-align: center; }
.mhead:first-child { border-top-left-radius: var(--r2); place-items: center start; padding-left: 14px; font-weight: 600; font-size: 12px; }
.mhead b { display: block; font: 600 12px/14px var(--f-mono); color: var(--ink); }
.mhead.today { background: var(--petrol); color: #CFE6EB; border-radius: 6px 6px 0 0; }
.mhead.today b { color: #fff; }
.mhead.hol b { color: var(--c-ho); }
.mhead.tot { font-weight: 600; font-size: 11px; color: var(--ink-2); border-left: 1px solid var(--line); }
.mhead.tot + .mhead.tot { border-left: 0; }
.mgroup { grid-column: 1 / -1; padding: 10px 14px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.mgroup span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.mname { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; height: 34px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.mname:hover b { text-decoration: underline; }
.mname b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mname small { display: block; font-size: 11px; line-height: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mname > span { min-width: 0; }
.mc { height: 34px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 3px 1.5px; display: grid; cursor: crosshair; position: relative; }
.mc.tdy { background: var(--petrol-wash); }
.mc i { display: grid; place-items: center; border-radius: var(--r1); font: 600 10.5px/1 var(--f-mono); font-style: normal; letter-spacing: -.02em; transition: transform var(--t-fast); }
.mc.inspect { cursor: pointer; }
.mc:focus-visible { outline-offset: -2px; z-index: 3; }
.mc.pv i { outline: 2px dashed var(--petrol-strong); outline-offset: -1px; }
.mc.pv.no i { outline-color: var(--bad); }
.mc.flash i { animation: flash .5s var(--ease); }
@keyframes flash { 0% { transform: scale(.7); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.mc.off i { background: transparent; }
.mc.na { cursor: not-allowed; }
.mc.na i { background: repeating-linear-gradient(90deg, transparent 0 3px, var(--surface-3) 3px 4px); }
.mc.fut i { opacity: .62; }
.mc .corner { position: absolute; top: 3px; right: 2px; width: 0; height: 0; border-top: 6px solid var(--warn); border-left: 6px solid transparent; border-top-right-radius: 3px; }
.c-0 { border: 1px dashed var(--line-strong); color: var(--ink-3); }
.c-P { background: var(--c-p-bg); color: var(--c-p); }
.c-LT { background: var(--c-lt-bg); color: var(--c-lt); }
.c-H { background: linear-gradient(135deg, var(--c-h-bg) 50%, transparent 50%); color: var(--c-h); box-shadow: inset 0 0 0 1px var(--c-h-bg); }
.c-L { background: var(--c-l-bg); color: var(--c-l); }
.c-W { background: repeating-linear-gradient(135deg, var(--c-w-bg) 0 3px, var(--c-w-hatch) 3px 5px); color: var(--c-w); }
.c-HO { background: var(--c-ho-bg); color: var(--c-ho); }
.c-A { background: var(--c-a-bg); color: var(--c-a); }
.c-X { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong); }
.mt { height: 34px; border-bottom: 1px solid var(--line); display: grid; place-items: center; font: 500 12px/1 var(--f-mono); color: var(--ink-2); }
.mt.first { border-left: 1px solid var(--line); }
.mt.hot { color: var(--bad); font-weight: 600; }
.mfoot { height: 36px; display: grid; place-items: center; font: 500 11px/1 var(--f-mono); color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.mfoot:first-child { place-items: center start; padding-left: 14px; font: 600 12px/1 var(--f-sans); color: var(--ink-2); border-bottom-left-radius: var(--r2); }
.mfoot.low { color: var(--bad); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); font-size: 12px; color: var(--ink-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 16px; border-radius: 3px; display: inline-block; }
.m-day { display: none; }

/* phone day view */
.wkstrip { display: grid; grid-template-columns: 36px repeat(7, minmax(0, 1fr)) 36px; gap: 2px; align-items: center; margin-bottom: var(--s3); }
.wkstrip button.d { height: 52px; border: 1px solid transparent; border-radius: var(--r2); background: none; display: grid; place-items: center; align-content: center; gap: 2px; padding: 0; font-size: 11px; color: var(--ink-3); }
.wkstrip button.d b { font: 600 15px/1 var(--f-mono); color: var(--ink); }
.wkstrip button.d[aria-pressed="true"] { background: var(--petrol); color: #CFE6EB; }
.wkstrip button.d[aria-pressed="true"] b { color: #fff; }
.wkstrip button.d.tdy:not([aria-pressed="true"]) { border-color: var(--petrol); }
.dlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; touch-action: pan-y; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 8px; padding: 0 6px 0 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: 0; }
.drow .mc { height: 44px; border: 0; padding: 4px; }
.drow .mc i { font-size: 12px; }
.drow .meta { font-size: 12px; color: var(--ink-3); line-height: 16px; }
.dgroup { padding: 8px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* ---------- punches ---------- */
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.flag.late { color: var(--warn); }
.flag.miss { color: var(--bad); }
.flag.ok { color: var(--ok); }
.flag.live { color: var(--petrol-ink); }
.flag.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.time { font: 500 13px/20px var(--f-mono); }
.time s { color: var(--ink-3); margin-right: 6px; }
.corr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3) var(--s4); padding: var(--s4); border-bottom: 1px solid var(--line); }
.corr:last-child { border-bottom: 0; }
.corr .what { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.corr q { display: block; font-style: normal; color: var(--ink); margin-top: 6px; quotes: none; padding-left: 12px; border-left: 2px solid var(--lilac); }
.corr .acts { display: flex; gap: 8px; align-items: flex-start; }
.diff { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/20px var(--f-mono); }
.diff del { color: var(--bad); text-decoration-thickness: 1px; }
.diff ins { color: var(--ok); text-decoration: none; font-weight: 600; }

/* ---------- leave ---------- */
.lv-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--s3) var(--s4); padding: var(--s4); border-bottom: 1px solid var(--line); align-items: start; }
.lv-card:last-child { border-bottom: 0; }
.lv-date { width: 44px; text-align: center; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.lv-date small { display: block; background: var(--lilac); color: #2E2670; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; line-height: 16px; }
.lv-date b { display: block; font: 600 18px/28px var(--f-mono); }
.lv-card .line1 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.lv-card .line2 { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.clash { margin-top: 8px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 6px 10px; }
.bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bal > div { border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 12px; }
.bal b { display: block; font: 600 20px/24px var(--f-mono); }
.bal > div > span { font-size: 12px; color: var(--ink-3); display: block; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--petrol); border-radius: 3px; }
.meter.lilac i { background: #8E80E6; }
.lvcal { display: grid; grid-template-columns: 160px repeat(var(--days), minmax(0, 1fr)); font-size: 11px; }
.lvcal > div { height: 30px; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.lvcal .n { place-items: center start; padding-left: 12px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.lvcal .h { font: 500 11px/1 var(--f-mono); color: var(--ink-3); height: 36px; }
.lvcal .h.tdy { color: var(--petrol-ink); font-weight: 700; }
.lvcal .on::after { content: ""; width: 100%; height: 14px; background: var(--c-l-bg); }
.lvcal .pend::after { content: ""; width: 100%; height: 14px; background: repeating-linear-gradient(135deg, var(--c-l-bg) 0 3px, transparent 3px 6px); }

/* ---------- roster ---------- */
.rgrid { display: grid; grid-template-columns: 220px repeat(7, minmax(0, 1fr)); }
.rgrid > div, .rgrid > button { min-width: 0; }
.rh { height: 48px; display: grid; place-items: center; align-content: center; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); background: var(--surface); position: sticky; top: var(--top-h); z-index: 4; }
.rh b { font: 600 13px/16px var(--f-mono); color: var(--ink); }
.rh:first-child { place-items: center start; padding-left: 14px; }
.rh.tdy { box-shadow: inset 0 -3px 0 var(--petrol); }
.rcell { height: 46px; border: 0; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: none; padding: 5px; display: grid; }
.rcell:hover .shift { filter: brightness(.97); outline: 1px solid var(--line-strong); }
.shift { border-radius: 6px; display: grid; align-content: center; justify-items: start; padding: 0 8px; text-align: left; font-size: 12px; line-height: 15px; min-width: 0; overflow: hidden; }
.shift b { font-weight: 600; white-space: nowrap; }
.shift span { font: 400 11px/14px var(--f-mono); opacity: .9; white-space: nowrap; }
.sh-K { background: #E7E1FF; color: #3A2F8A; }
.sh-M { background: #DCEBEF; color: #0B4F5E; }
.sh-G { background: #E4EADF; color: #3D5226; }
.sh-E { background: #F7E5CC; color: #7A4300; }
.sh-O { background: repeating-linear-gradient(135deg, var(--c-w-bg) 0 3px, var(--c-w-hatch) 3px 5px); color: var(--ink-3); }
.sh-L { background: var(--c-l-bg); color: var(--c-l); }
:root[data-theme="dark"] .sh-K { background: #352F66; color: #E2DCFF; }
:root[data-theme="dark"] .sh-M { background: #173F49; color: #A6E0EC; }
:root[data-theme="dark"] .sh-G { background: #26361A; color: #CFE4B5; }
:root[data-theme="dark"] .sh-E { background: #45300F; color: #F6C98A; }
.rcell.changed .shift { box-shadow: inset 3px 0 0 var(--lilac-ink); }
.cov { height: 34px; display: grid; place-items: center; font: 500 12px/1 var(--f-mono); color: var(--ink-2); border-left: 1px solid var(--line); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cov.short { color: var(--bad); font-weight: 600; background: var(--bad-bg); }
.cov.lbl { place-items: center start; padding-left: 14px; font: 500 12px/1 var(--f-sans); color: var(--ink-3); border-left: 0; }
.rgroup { grid-column: 1 / -1; padding: 10px 14px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* ---------- payroll ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: st; }
.stepper li button { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; align-items: center; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: var(--r2); color: var(--ink-2); }
.stepper li button:hover:not([disabled]) { background: var(--surface-3); }
.stepper li button[disabled] { cursor: not-allowed; opacity: .55; }
.stepper .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font: 600 12px/1 var(--f-mono); grid-row: span 2; background: var(--surface); }
.stepper b { font-weight: 600; color: var(--ink); }
.stepper small { font-size: 12px; color: var(--ink-3); line-height: 16px; }
.stepper li.done .n { background: var(--petrol-tint); border-color: var(--petrol-tint); color: var(--petrol-ink); }
.stepper li.cur button { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stepper li.cur .n { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.wiz { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.wiz-side { position: sticky; top: calc(var(--top-h) + 24px); display: grid; gap: var(--s4); }
.wiz-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--surface-2); position: sticky; bottom: 0; border-radius: 0 0 var(--r2) var(--r2); flex-wrap: wrap; }
.sumbox { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); padding: var(--s4); display: grid; gap: 8px; }
.sumbox .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sumbox .row b { font-family: var(--f-mono); font-weight: 500; }
.sumbox .big { font: 600 28px/34px var(--f-mono); letter-spacing: -.02em; }
.checks { display: grid; gap: 0; }
.checks > div { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px var(--s4); border-bottom: 1px solid var(--line); }
.checks > div:last-child { border-bottom: 0; }
.checks .ic-ok { color: var(--ok); }
.checks .ic-warn { color: var(--warn); }
.checks .ic-bad { color: var(--bad); }
.checks p { font-size: 13px; color: var(--ink-2); }
.bridge { display: grid; gap: 0; }
.bridge > div { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px; align-items: center; gap: 12px; padding: 10px var(--s4); border-bottom: 1px solid var(--line); font-size: 14px; }
.bridge > div:last-child { border-bottom: 0; }
.bridge .bar { height: 10px; position: relative; background: var(--surface-3); border-radius: 2px; }
.bridge .bar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.bridge .bar i.up { background: var(--petrol); }
.bridge .bar i.down { background: #C9675F; }
.bridge .tot { font-weight: 650; background: var(--surface-2); }
.bridge .num { font-family: var(--f-mono); }
.why { display: flex; flex-wrap: wrap; gap: 4px; }
.why .tag { height: 20px; font-size: 11px; padding: 0 6px; }
.runcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); padding: var(--s5); align-items: center; border-left: 4px solid var(--lilac); }
.runcard .prog { display: flex; gap: 4px; margin-top: 12px; }
.runcard .prog i { height: 6px; flex: 1; max-width: 64px; border-radius: 3px; background: var(--surface-3); }
.runcard .prog i.on { background: var(--petrol); }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); align-items: end; height: 170px; padding: var(--s4) var(--s4) 0; }
.bars div { display: grid; align-content: end; gap: 6px; height: 100%; text-align: center; }
.bars i { display: block; background: var(--petrol-tint); border-radius: 4px 4px 0 0; border: 1px solid var(--petrol); border-bottom: 0; }
.bars div.cur i { background: var(--lilac); border-color: #8E80E6; }
.bars span { font: 500 12px/16px var(--f-mono); color: var(--ink-2); }
.bars small { font-size: 12px; color: var(--ink-3); padding-bottom: 10px; border-top: 1px solid var(--line-strong); padding-top: 6px; }

/* ---------- payslip document ---------- */
.docwrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s4); }
.doc { width: 100%; max-width: 794px; background: #fff; color: #10262D; border: 1px solid #D6E0E4; border-radius: 4px; padding: 40px 44px; font-size: 13px; line-height: 18px; box-shadow: 0 1px 2px rgba(16, 38, 45, .06); }
:root[data-theme="dark"] .doc { border-color: #31545E; }
.doc-h { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid #0E5A6B; align-items: flex-start; }
.doc-h h2 { font-size: 20px; color: #0E5A6B; }
.doc-h .addr { font-size: 12px; color: #46606A; line-height: 16px; margin-top: 4px; }
.doc-h .ttl { text-align: right; }
.doc-h .ttl b { display: block; font-size: 15px; letter-spacing: .02em; }
.doc-h .ttl span { font: 500 12px/18px var(--f-mono); color: #46606A; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; padding: 16px 0; border-bottom: 1px solid #D6E0E4; }
.doc-meta div { display: flex; justify-content: space-between; gap: 12px; }
.doc-meta dt { color: #587079; }
.doc-meta dd { margin: 0; font-weight: 600; text-align: right; }
.doc-att { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid #D6E0E4; border-radius: 4px; margin: 16px 0; }
.doc-att div { padding: 8px 10px; border-right: 1px solid #D6E0E4; }
.doc-att div:last-child { border-right: 0; }
.doc-att span { display: block; font-size: 11px; color: #587079; }
.doc-att b { font: 600 15px/20px var(--f-mono); }
.doc-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #D6E0E4; border-radius: 4px; }
.doc-tables table { width: 100%; border-collapse: collapse; }
.doc-tables table + table { border-left: 1px solid #D6E0E4; }
.doc-tables th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #46606A; padding: 8px 12px; background: #EEF3F5; }
.doc-tables th:last-child, .doc-tables td:last-child { text-align: right; }
.doc-tables td { padding: 6px 12px; border-top: 1px solid #EEF3F5; }
.doc-tables td:last-child { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.doc-tables tr.sum td { border-top: 1px solid #B9C8CE; font-weight: 700; }
.doc-net { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px; background: #EDF5F7; border-left: 4px solid #0E5A6B; }
.doc-net b { font: 600 24px/30px var(--f-mono); color: #0A4654; }
.doc-net small { display: block; font-size: 12px; color: #46606A; }
.doc-foot { margin-top: 20px; font-size: 11px; color: #587079; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.doc .stamp { display: inline-block; border: 1px solid #8E80E6; color: #3F3492; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; }

/* ---------- people / profile ---------- */
.prof-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s5); }
.prof-h h1 { font-size: 28px; }
.prof-h .sub { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); margin-top: 4px; font-size: 13px; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mcal .wd { font-size: 11px; color: var(--ink-3); text-align: center; font-weight: 600; }
.mcal .d { height: 40px; border-radius: 6px; display: grid; place-items: center; align-content: center; font: 500 12px/14px var(--f-mono); gap: 1px; }
.mcal .d small { font-size: 9.5px; font-weight: 600; }
.mcal .d.tdy { outline: 2px solid var(--petrol); outline-offset: 1px; }
.mcal .d.blank { background: none; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts div { padding: 12px var(--s5); border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts span { font-size: 12px; color: var(--ink-3); display: block; }
.facts b { font: 600 16px/22px var(--f-mono); }
.filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.filters .search { position: relative; flex: 1; max-width: 320px; min-width: 180px; }
.filters .search svg { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.filters .search input { padding-left: 36px; }

/* ---------- advances ---------- */
.adv { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 150px auto; gap: var(--s4); align-items: center; padding: var(--s4); border-bottom: 1px solid var(--line); }
.adv:last-child { border-bottom: 0; }
.adv .amt b { font: 600 16px/22px var(--f-mono); display: block; }
.adv .amt span { font-size: 12px; color: var(--ink-3); }
.adv .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.sched { width: 100%; border-collapse: collapse; font-size: 13px; }
.sched td, .sched th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.sched th { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sched td:last-child, .sched th:last-child { text-align: right; font-family: var(--f-mono); }

/* ---------- staff side ---------- */
.me { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.punchcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s5); display: grid; gap: var(--s4); text-align: center; }
.clock { font: 500 40px/44px var(--f-mono); letter-spacing: -.02em; }
.clock small { font-size: 20px; color: var(--ink-3); }
.punchbtn { height: 64px; border-radius: var(--r3); border: 0; background: var(--petrol); color: #fff; font-size: 18px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.punchbtn:hover { background: var(--petrol-strong); }
.punchbtn.out { background: var(--lilac); color: #2E2670; }
.punchbtn.out:hover { background: #C9C0FF; }
.geo { display: inline-flex; align-items: center; gap: 6px; justify-self: center; font-size: 12px; color: var(--ok); background: var(--ok-bg); border-radius: 12px; padding: 2px 10px; }
.mylog { display: grid; gap: 0; text-align: left; border-top: 1px solid var(--line); }
.mylog div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.weekline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekline div { border-radius: var(--r2); padding: 8px 6px; text-align: center; display: grid; gap: 2px; font-size: 11px; min-width: 0; }
.weekline div b { font: 600 13px/16px var(--f-mono); }
.weekline div.tdy { outline: 2px solid var(--petrol); outline-offset: 1px; }

/* settings */
.set { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.set nav { position: sticky; top: calc(var(--top-h) + 24px); display: grid; gap: 2px; }
.set nav a { padding: 8px 12px; border-radius: var(--r2); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.set nav a:hover { background: var(--surface-3); color: var(--ink); }
.set section { scroll-margin-top: calc(var(--top-h) + 16px); }
.setrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: 14px var(--s4); border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow p { font-size: 13px; color: var(--ink-3); }
.setrow b { font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .nav a { padding: 0 7px; font-size: 13px; }
  .searchbtn { min-width: 0; }
  .searchbtn .lbl-t { display: none; }
  .brand small { display: none; }
  .mgrid { grid-template-columns: 168px repeat(var(--days), minmax(0, 1fr)) repeat(4, 36px); }
  .split { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1080px) {
  .muster-scroll { overflow-x: auto; }
  .muster { min-width: 960px; }
  .mhead { top: 0; }
  .tbl-wrap { overflow-x: auto; }
  .tbl th { position: static; }
  .split, .cols2, .me { grid-template-columns: minmax(0, 1fr); }
  .wiz { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --top-h: 52px; }
  body { font-size: 14px; }
  h1 { font-size: 22px; line-height: 28px; }
  .d-only { display: none !important; }
  .m-only { display: revert !important; }
  .top { padding: 0 12px; gap: 8px; }
  .nav, .searchbtn, .side-switch, .top-tools .avatar { display: none; }
  .iconbtn.m-only { display: inline-grid !important; }
  .drow .mc { touch-action: none; }
  .brand b { font-size: 15px; }
  .view { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; position: relative; }
  .tabbar [aria-current="page"] { color: var(--petrol-ink); }
  .tabbar [aria-current="page"] svg { stroke-width: 2; }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; padding: 0 4px; }
  .ph { margin-bottom: 16px; align-items: flex-start; }
  .ph-a { width: 100%; }
  .ph-a .btn { flex: 1; }
  .ph-a .seg { width: 100%; }
  .ph-a .seg button { flex: 1; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .tabs { overflow: hidden; gap: 0; }
  .tab { padding: 0 8px; flex: 1; justify-content: center; font-size: 13px; }
  .tab .count { min-width: 18px; padding: 0 4px; }
  .muster-scroll, .muster.d-only { display: none; }
  .m-day { display: block; }
  .today-strip { display: grid; grid-template-columns: repeat(3, 1fr); }
  .today-strip > div { border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .today-strip > div:nth-child(3n) { border-right: 0; }
  .today-strip > div.when { grid-column: 1 / -1; border-right: 0; order: -1; }
  .today-strip > div:last-child { grid-column: 1 / -1; margin: 0; border-bottom: 0; }
  .brushes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .brush { padding: 0; justify-content: center; flex-direction: column; height: 48px; gap: 2px; font-size: 11px; }
  .brush .k { display: none; }
  .toolrow .hint { width: 100%; }
  /* responsive tables become stacked rows */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td, .rtable tfoot { display: block; width: 100%; }
  .rtable tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; min-width: 0; }
  .rtable td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; font-family: var(--f-sans); text-align: left; flex: none; }
  .rtable td.lead { display: block; text-align: left; padding-bottom: 6px; }
  .rtable td.lead::before { display: none; }
  .rtable td.hide-m { display: none; }
  .rtable td.num { font-size: 13px; }
  .rtable tfoot tr { background: var(--surface-2); }
  .rtable tfoot td { position: static; background: none; }
  .tbl-wrap { overflow: visible; }
  .tbl th { top: 0; }
  .corr { grid-template-columns: minmax(0, 1fr); }
  .corr .acts .btn { flex: 1; }
  .lv-card { grid-template-columns: 44px minmax(0, 1fr); }
  .lv-card .acts { grid-column: 1 / -1; display: flex; gap: 8px; }
  .lv-card .acts .btn { flex: 1; }
  .rgrid.d-only { display: none; }
  .wiz { grid-template-columns: minmax(0, 1fr); }
  .wiz-side { position: static; }
  .stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .stepper li button { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 6px 2px; gap: 4px; text-align: center; }
  .stepper .n { grid-row: auto; }
  .stepper b { font-size: 11px; line-height: 14px; font-weight: 600; }
  .stepper small { display: none; }
  .wiz-side .sumbox { display: none; }
  .bridge > div { grid-template-columns: minmax(0, 1fr) 96px; }
  .bridge .bar { display: none; }
  .runcard { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .doc { padding: 20px 16px; font-size: 12px; }
  .doc-h { flex-direction: column; gap: 8px; }
  .doc-h .ttl { text-align: left; }
  .doc-meta { grid-template-columns: minmax(0, 1fr); }
  .doc-att { grid-template-columns: repeat(3, 1fr); }
  .doc-att div:nth-child(3) { border-right: 0; }
  .doc-att div:nth-child(n+4) { border-top: 1px solid #D6E0E4; }
  .doc-tables { grid-template-columns: minmax(0, 1fr); }
  .doc-tables table + table { border-left: 0; border-top: 1px solid #D6E0E4; }
  .doc-net { flex-direction: column; align-items: flex-start; }
  .prof-h { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .prof-h .ph-a { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .facts div { padding: 10px 16px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .adv { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .adv .prog { grid-column: 1 / -1; }
  .adv .acts { grid-column: 1 / -1; justify-content: stretch; }
  .adv .acts .btn { flex: 1; }
  .set { grid-template-columns: minmax(0, 1fr); }
  .set nav { display: none; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .filters select { flex: 1; }
  .bars { height: 150px; gap: 10px; }
  .modal { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 90vh; border-radius: var(--r3) var(--r3) 0 0; animation: sheet var(--t-med) var(--ease); border-width: 1px 0 0; }
  .modal.wide { width: 100%; }
  .modal.drawer { height: auto; max-height: 90vh; top: auto; width: 100%; border-radius: var(--r3) var(--r3) 0 0; }
  .modal.pal { top: 0; bottom: auto; border-radius: 0 0 var(--r3) var(--r3); max-height: 80vh; animation: fade var(--t-med); }
  .modal-h { padding: 14px 16px; }
  .modal-b { padding: 16px; }
  .modal-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-f .btn { flex: 1; }
  .modal-f .demo-note { flex-basis: 100%; }
  .keys { grid-template-columns: minmax(0, 1fr); }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 24px 20px 28px; gap: 20px; }
  .login-art h1 { font-size: 26px; line-height: 32px; }
  .login-art p { font-size: 14px; line-height: 20px; margin-top: 10px; }
  .login-roll { grid-template-columns: 76px repeat(9, 1fr); }
  .login-roll .xm { display: none; }
  .login-form { padding: 24px 20px 40px; }
  .me .punchcard { padding: 20px 16px; }
  .clock { font-size: 34px; line-height: 40px; }
  .lvcal { grid-template-columns: 96px repeat(var(--days), minmax(0, 1fr)); }
  .lvcal .h { font-size: 9px; }
  .lvcal .n { font-size: 12px; padding-left: 8px; }
  .lvcal .hx { visibility: hidden; }
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }

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

/* ---------- print: only the payslip ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .doc, .doc * { visibility: visible; }
  .doc { position: absolute; left: 0; top: 0; border: 0; box-shadow: none; padding: 0; max-width: none; }
  .top, .tabbar, #toasts, #layer { display: none !important; }
}

/* ---------- late additions ---------- */
.num .tag, .num .muted.small { font-family: var(--f-sans); }
.login-art .mark > rect:first-child { fill: #EEF3F5; }
.login-art .mark > g { fill: #0E5A6B; }
.login-mid { display: grid; gap: 40px; }
.login-art .login-foot { max-width: none; }
.who b, .who small { display: block; }
.who small { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.bars { height: 190px; }
@media (max-width: 760px) {
  .rtable td:not(.lead):not(.full) { display: inline-flex; width: 50%; padding-right: 12px; vertical-align: top; align-items: baseline; }
  .rtable td:not(.lead):not(.full):empty { display: none; }
  .rtable td.full { padding-top: 6px; }
  .rtable td.full::before { display: none; }
  .rtable td.full { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  .tab { padding: 0 4px; font-size: 12.5px; min-width: 0; gap: 4px; }
  .adv { grid-template-columns: minmax(0, 1fr); }
  .bars { height: 180px; }
  .filters .count-note { display: none; }
}
@media (max-width: 760px) {
  .rtable td { justify-content: flex-end; gap: 6px; }
  .rtable td::before { margin-right: auto; padding-right: 6px; }
  .rtable td.full { justify-content: flex-start; }
}
@media (max-width: 760px) { .rtable td.hide-m { display: none !important; } }
@media (max-width: 760px) {
  .toolrow .hint { width: auto; flex: 1; min-width: 0; }
  .tabbar { height: calc(60px + env(safe-area-inset-bottom)); align-items: center; }
  .wiz-foot { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > span { min-width: 0; }
@media (max-width: 760px) {
  .wiz-foot .small.muted { display: none; }
  .wiz-foot { padding: 10px 12px; }
}
.login-ticket { display: flex; flex-wrap: wrap; gap: 6px 18px; max-width: 560px !important; margin: 0 !important; padding: 12px 16px; border: 1px dashed rgba(255, 255, 255, .32); border-radius: var(--r2); font: 500 13px/18px var(--f-mono) !important; color: #E6F2F5 !important; }
.login-ticket span:first-child { color: #D9D2FF; }
@media (max-width: 760px) { .login-ticket { display: none; } }
@media (max-width: 760px) { .wiz-foot .wf-next[disabled] { display: none; } }
