/* Sri Iniya Silks design system: ivory silk paper, deep maroon, antique gold.
   Layout: phones get a top bar + bottom tabs + one card per staff member;
   from 760px the same markup becomes a side menu + table-like rows. */
:root {
  --bg: oklch(0.982 0.012 88);
  --fg: oklch(0.24 0.05 25);
  --card: oklch(0.995 0.006 90);
  --primary: oklch(0.36 0.13 22);
  --primary-fg: oklch(0.985 0.012 88);
  --secondary: oklch(0.945 0.026 82);
  --secondary-fg: oklch(0.32 0.1 24);
  --muted: oklch(0.955 0.018 85);
  --muted-fg: oklch(0.48 0.035 40);
  --faint: oklch(0.62 0.02 60);
  --accent: oklch(0.78 0.115 82);
  --border: oklch(0.9 0.025 80);
  --input: oklch(0.82 0.03 70);
  --ring: oklch(0.62 0.11 60);
  --danger: oklch(0.5 0.19 27);
  --danger-tint: oklch(0.94 0.035 27);
  --present: oklch(0.42 0.1 150);
  --present-tint: oklch(0.94 0.045 150);
  --half: oklch(0.5 0.11 70);
  --half-tint: oklch(0.95 0.05 85);
  --leave: oklch(0.44 0.1 255);
  --leave-tint: oklch(0.94 0.03 255);
  --holiday: oklch(0.45 0.1 320);
  --holiday-tint: oklch(0.94 0.03 320);
  --maroon-a: oklch(0.36 0.13 22);
  --maroon-b: oklch(0.24 0.09 20);
  --gold-a: oklch(0.86 0.09 92);
  --gold-b: oklch(0.72 0.13 74);
  --on-maroon-soft: oklch(0.86 0.09 92);
  --shadow: 0 10px 30px -18px oklch(0.28 0.11 22 / 0.3);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: Jost, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.19 0.035 25);
    --fg: oklch(0.965 0.014 88);
    --card: oklch(0.24 0.045 24);
    --primary: oklch(0.8 0.11 82);
    --primary-fg: oklch(0.22 0.06 24);
    --secondary: oklch(0.3 0.055 24);
    --secondary-fg: oklch(0.965 0.014 88);
    --muted: oklch(0.27 0.045 24);
    --muted-fg: oklch(0.78 0.03 70);
    --faint: oklch(0.6 0.03 60);
    --border: oklch(1 0 0 / 14%);
    --input: oklch(1 0 0 / 22%);
    --ring: oklch(0.7 0.1 75);
    --danger: oklch(0.72 0.16 25);
    --danger-tint: oklch(0.3 0.07 25);
    --present: oklch(0.78 0.12 150);
    --present-tint: oklch(0.3 0.05 150);
    --half: oklch(0.82 0.11 80);
    --half-tint: oklch(0.32 0.05 80);
    --leave: oklch(0.78 0.09 255);
    --leave-tint: oklch(0.3 0.05 255);
    --holiday: oklch(0.8 0.08 320);
    --holiday-tint: oklch(0.3 0.05 320);
    --shadow: 0 10px 30px -18px oklch(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.boot { padding: 40px 20px; color: var(--muted-fg); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted-fg); }
.display { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
.hint { font-size: 13px; color: var(--muted-fg); }

/* ---------- buttons ---------- */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 2px; border: 1px solid var(--primary);
  background: transparent; color: var(--primary); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: oklch(0.26 0.06 26); }
.btn.solid { background: var(--primary); color: var(--primary-fg); }
.btn.solid:hover:not(:disabled) { background: color-mix(in oklch, var(--primary) 88%, black); border-color: transparent; color: var(--primary-fg); }
.btn.quiet { border-color: var(--input); color: var(--fg); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { width: 44px; min-height: 44px; padding: 0; font-size: 18px; letter-spacing: 0; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-fg); }
.input {
  min-height: 46px; padding: 0 12px; border: 1px solid var(--input); border-radius: 2px;
  background: var(--card); font-size: 16px; width: 100%;
}
.input[type="time"] { min-width: 0; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.login-hero {
  background: linear-gradient(160deg, var(--maroon-a), var(--maroon-b)); color: oklch(0.985 0.012 88);
  padding: calc(env(safe-area-inset-top, 0px) + 56px) max(24px, env(safe-area-inset-right, 0px)) 32px max(24px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px;
}
.login-logo { width: min(100%, 300px); height: auto; display: block; }
.login-hero .display { font-size: clamp(30px, 4.4vw, 52px); }
.gold-rule { height: 3px; width: 120px; background: linear-gradient(135deg, var(--gold-a), var(--gold-b), var(--gold-a)); }
.login form { padding: 28px 24px 40px; display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 440px; }
@media (min-width: 760px) {
  .login { flex-direction: row; }
  .login-hero { flex: 1 1 50%; justify-content: center; padding: 64px; gap: 24px; }
  .login-logo { width: min(100%, 460px); }
  .login form { margin: auto; }
}

/* ---------- shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .display { font-size: 24px; }
.side { display: none; }
.content { flex: 1; width: 100%; max-width: 1180px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs a { min-width: 0; padding: 0 2px; min-height: 58px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg); border-top: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--primary); border-top-color: var(--primary); }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 20; }
.menu-panel button { min-height: 44px; text-align: left; padding: 0 12px; border: 0; background: none; border-radius: 2px; cursor: pointer; font-size: 14px; }
.menu-panel button:hover { background: var(--secondary); }
.menu-panel .who { padding: 10px 12px; font-size: 13px; color: var(--muted-fg); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

@media (min-width: 760px) {
  .shell { flex-direction: row; }
  .side {
    display: flex; flex-direction: column; gap: 4px; width: 240px; flex: none; position: sticky; top: 0; height: 100vh;
    background: var(--card); border-right: 1px solid var(--border); padding: 24px 14px;
  }
  .side .brand { padding: 0 12px 18px; display: flex; flex-direction: column; gap: 4px; }
  .side .brand .display { font-size: 24px; }
  .side a, .side .soon { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 2px; text-decoration: none; font-size: 14.5px; color: var(--fg); }
  .side a:hover { background: var(--muted); }
  .side a[aria-current="page"] { background: var(--secondary); color: var(--primary); font-weight: 500; }
  .side .soon { color: var(--faint); cursor: default; }
  .side .soon small { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
  .side .foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted-fg); }
  .side .foot button { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--primary); cursor: pointer; font-size: 13px; }
  .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar { display: none; }
  .tabs { display: none; }
  .content { padding: 28px 32px 48px; gap: 20px; }
}

/* ---------- page header, date strip ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .display { font-size: clamp(26px, 4vw, 36px); }
.nav-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: thin; }
.day {
  flex: none; width: 48px; height: 60px; border: 1px solid var(--border); border-radius: 2px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  scroll-snap-align: center; text-decoration: none; color: var(--fg); position: relative; font-variant-numeric: tabular-nums;
}
.day small { font-size: 10px; letter-spacing: 0.08em; color: var(--muted-fg); text-transform: uppercase; }
.day.gap { border-color: var(--danger); }
.day.gap::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.day[aria-current="date"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.day[aria-current="date"] small { color: inherit; opacity: 0.85; }
.day[aria-disabled="true"] { background: var(--muted); color: var(--faint); border-style: dashed; cursor: not-allowed; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted-fg); }
.stat .v { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat.present .v { color: var(--present); }
.stat.absent .v { color: var(--danger); }
.stat.leave .v { color: var(--leave); }
.stat.missing { background: var(--danger-tint); border-color: var(--danger); }
.stat.missing .k, .stat.missing .v { color: var(--danger); }
.banner { padding: 12px 14px; border-radius: 4px; background: var(--secondary); color: var(--secondary-fg); font-size: 14px; }
.banner.danger { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 220px; }
@media (min-width: 760px) { .actions .btn { flex: 0 0 auto; } }

/* ---------- staff rows ---------- */
.staff-list { display: flex; flex-direction: column; gap: 10px; }
.staff-head { display: none; }
.staff {
  background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 14px;
  display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "who" "status" "times" "note";
}
.staff.unmarked { border-color: var(--danger); }
.staff.busy { opacity: 0.6; pointer-events: none; }
.who { grid-area: who; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; }
.who .name { font-size: 16px; font-weight: 500; }
.who .sub { font-size: 12.5px; color: var(--muted-fg); }
.tag { font-size: 12px; white-space: nowrap; }
.tag.late { color: var(--half); }
.tag.missing { color: var(--danger); }
.tag.ok { color: var(--present); }
.pills { grid-area: status; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pills.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pill {
  min-height: 46px; border: 1px solid var(--input); border-radius: 2px; background: var(--card);
  color: var(--secondary-fg); font-size: 13px; font-weight: 500; cursor: pointer; padding: 0 2px;
}
.pill[aria-pressed="true"].Present { background: var(--present-tint); border-color: var(--present); color: var(--present); }
.pill[aria-pressed="true"].HalfDay { background: var(--half-tint); border-color: var(--half); color: var(--half); }
.pill[aria-pressed="true"].Absent { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }
.pill[aria-pressed="true"].Leave { background: var(--leave-tint); border-color: var(--leave); color: var(--leave); }
.pill[aria-pressed="true"].Holiday { background: var(--holiday-tint); border-color: var(--holiday); color: var(--holiday); }
.pill:disabled { cursor: not-allowed; opacity: 0.55; }
.times { grid-area: times; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.time-group { display: flex; align-items: center; gap: 6px; flex: 1 1 150px; min-width: 0; }
.time-group > span { font-size: 12px; color: var(--muted-fg); width: 26px; flex: none; }
.time-group .input { min-height: 44px; flex: 1; font-size: 15px; padding: 0 8px; }
.time-group .btn { padding: 0 12px; }
.worked { font-size: 13px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.note { grid-area: note; display: flex; gap: 8px; align-items: center; }
.note .input { min-height: 42px; font-size: 14px; }
.note-toggle { background: none; border: 0; padding: 0; color: var(--primary); font-size: 13px; cursor: pointer; min-height: 32px; text-align: left; }
.lock { grid-area: note; font-size: 13px; color: var(--muted-fg); }

@media (min-width: 760px) {
  .staff-list { gap: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--card); overflow: hidden; }
  .staff-head, .staff {
    display: grid; align-items: center; gap: 14px;
    grid-template-columns: minmax(140px, 0.9fr) minmax(300px, 1.4fr) minmax(330px, 1.5fr);
    grid-template-areas: "who status times" "note note note";
  }
  .staff-head { padding: 12px 16px; background: var(--muted); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-fg); border-bottom: 1px solid var(--border); grid-template-areas: none; }
  .staff { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 16px; row-gap: 6px; }
  .staff:last-child { border-bottom: 0; }
  .staff.unmarked { border-color: var(--border); background: color-mix(in oklch, var(--danger-tint) 55%, var(--card)); }
  .who { flex-direction: column; gap: 2px; }
  .times { flex-wrap: nowrap; }
  .time-group { flex: 1 1 0; }
  .time-group .input { min-width: 0; padding: 0 6px; }
}

/* ---------- month calendar ---------- */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { text-align: center; font-size: 11px; letter-spacing: 0.12em; color: var(--muted-fg); text-transform: uppercase; }
.cell {
  min-height: 60px; border: 1px solid var(--border); border-radius: 2px; background: var(--card); color: var(--fg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  font-variant-numeric: tabular-nums; padding: 4px;
}
.cell.blank { visibility: hidden; }
.cell.gap { border-color: var(--danger); }
.cell.today { border: 2px solid var(--primary); }
.cell.future { background: var(--muted); color: var(--faint); border-style: dashed; }
.cell.holiday .n { color: var(--holiday); font-weight: 500; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.Present { background: var(--present); }
.dot.HalfDay { background: var(--half); }
.dot.Absent { background: var(--danger); }
.dot.Leave { background: var(--leave); }
.dot.Holiday, .dot.WeekOff { background: var(--holiday); }
.dot.none { background: transparent; border: 1px solid var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted-fg); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 760px) { .cell { min-height: 84px; } .dot { width: 9px; height: 9px; } }

.table-box { overflow-x: auto; border: 1px solid var(--border); border-radius: 4px; background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-fg); padding: 10px 12px; background: var(--muted); border-bottom: 1px solid var(--border); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; }
.miss { color: var(--danger); font-weight: 500; }

/* ---------- dialog, toast ---------- */
dialog { border: 0; border-radius: 4px; padding: 0; background: var(--card); color: var(--fg); width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: oklch(0.2 0.03 25 / 0.5); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 2px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
#toast.bad { background: var(--danger); color: oklch(0.985 0.012 88); }
@media (min-width: 760px) { #toast { bottom: 24px; } }
@media (prefers-reduced-motion: no-preference) { .staff, .pill, .day { transition: background-color 120ms, border-color 120ms, opacity 120ms; } }

/* ---------- admin: shared ---------- */
.chip { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; white-space: nowrap; }
.chip.ok { background: var(--present-tint); color: var(--present); }
.chip.due { background: var(--secondary); color: var(--secondary-fg); }
.chip.warn { background: var(--danger-tint); color: var(--danger); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14.5px; padding: 3px 0; }
.line > span:first-child { color: color-mix(in oklch, var(--fg) 78%, var(--bg)); min-width: 0; }
.line.sum { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; font-weight: 500; }
.line.sum > span:first-child { color: var(--fg); }
.line.bad, .line.bad > span:first-child { color: var(--danger); }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--primary); cursor: pointer; font-size: 13.5px; min-height: 32px; }
.back { font-size: 14px; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: oklch(0.985 0.012 88); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
select.input { appearance: auto; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
dialog p { margin: 0; font-size: 14.5px; }

/* ---------- salary ---------- */
.band { background: linear-gradient(160deg, var(--maroon-a), var(--maroon-b)); color: oklch(0.985 0.012 88); border-radius: 4px; padding: 18px; display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-end; justify-content: space-between; }
.band .eyebrow { color: var(--on-maroon-soft); }
.band .big { font-family: var(--display); font-size: 40px; line-height: 1.05; }
.band-sub { font-size: 13px; color: var(--on-maroon-soft); }
.band-grid { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px 24px; font-size: 12.5px; }
.band-grid div { display: flex; flex-direction: column; }
.band-grid span { color: var(--on-maroon-soft); }
.band-grid b { font-weight: 500; font-size: 16px; }
@media (max-width: 520px) { .band-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } }
.sal-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.sal-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sal-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name net" "days status" "ot adv";
  gap: 4px 12px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--fg);
}
.sal-row.sel { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.sal-row:hover { border-color: var(--input); }
.c-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.c-name small { color: var(--muted-fg); font-size: 12px; }
.c-net { grid-area: net; font-size: 18px; text-align: right; }
.c-days { grid-area: days; font-size: 13px; color: var(--muted-fg); }
.c-ot { grid-area: ot; font-size: 13px; color: var(--muted-fg); }
.c-adv { grid-area: adv; font-size: 13px; color: var(--muted-fg); text-align: right; }
.c-status { grid-area: status; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.sal-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.detail-head .display { font-size: 30px; }
.net-box { text-align: right; }
.net-box .big { font-family: var(--display); font-size: 34px; color: var(--primary); line-height: 1.05; }
.adv { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.adv:last-child { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 1099px) { .hide-narrow { display: none; } }
@media (min-width: 1100px) {
  .sal-grid { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); }
  .sal-detail { position: sticky; top: 20px; }
}

/* ---------- employees ---------- */
.emp-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.emp { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.emp.inactive { opacity: 0.7; }
.emp-main { display: flex; flex-direction: column; }
.emp-main b { font-size: 16px; font-weight: 500; }
.emp-main small { color: var(--muted-fg); font-size: 12.5px; }
.emp-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.emp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: auto; }

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.settings-grid form.card > div:last-child { margin-top: 4px; }
.ot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.ot-main { display: flex; flex-direction: column; min-width: 0; }
.ot-actions { grid-column: 1 / -1; display: flex; gap: 14px; }
