/* Right Advisors Payroll. Navy sidebar, white top bar, blue menus, grey panels, red figures:
   the layout and colours of the payroll software the team already uses. */
:root {
  --rail: #0a1c42;
  --rail-ink: #c8d3ea;
  --leaf: #2d83d6;          /* blue: menus, selected tab, links */
  --leaf-deep: #1c4f94;
  --leaf-tint: #d3e5f9;     /* table headers */
  --marigold: #e44444;      /* red: counts, badges, highlights */
  --navy: #1c305e;          /* profile tab bar, section titles */
  --btn: #555a61;           /* the dark grey Add / Edit / Save buttons */
  --paper: #ffffff;
  --panel: #eeeeef;
  --surface: #ffffff;
  --line: #d6dbe3;
  --text: #1d2433;
  --muted: #5d6573;
  --danger: #c62828;
  /* chart series, fixed order */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --track: #e4e7ec;
  --bar-h: 52px;
  --rail-w: 104px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.45;
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--leaf-deep); }
code { font-size: .93em; background: var(--leaf-tint); padding: 1px 5px; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.num, .figure, dd, .bar-value, .badge, td { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--surface); padding: 6px 10px; }

/* ---------- frame ---------- */
.app {
  display: grid;
  grid-template: "top top" var(--bar-h) "rail main" 1fr "rail foot" auto / var(--rail-w) 1fr;
  height: 100vh;
}
.topbar {
  grid-area: top;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.brand {
  flex: 0 0 var(--rail-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  text-decoration: none;
  background: var(--surface);
  color: var(--navy);
  line-height: 1.15;
  border-right: 1px solid var(--line);
}
.brand img { max-width: 100%; max-height: 40px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: .93rem; letter-spacing: -.01em; }
.brand-sub { font-size: .75rem; color: var(--marigold); font-weight: 700; }

.tabs { display: flex; flex: 1; min-width: 0; }
.tab { position: relative; display: flex; }
.tab + .tab { border-left: 0; }
.tab-btn {
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  background: none;
  border: 0;
  padding: 0 13px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.tab-btn:hover { color: var(--text); background: var(--paper); }
.tab.is-current > .tab-btn { color: var(--leaf-deep); box-shadow: inset 0 -3px 0 var(--marigold); }
.tab.is-open > .tab-btn { background: var(--leaf); color: #fff; box-shadow: none; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 232px;
  max-height: calc(100vh - var(--bar-h) - 16px);
  overflow-y: auto;
  background: var(--leaf);
  padding: 6px 0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 24px rgba(22, 39, 31, .28);
}
.tab.is-open > .dropdown { display: block; }
@media (hover: hover) and (min-width: 1081px) {
  .tab:hover > .dropdown { display: block; }
  .tab:hover > .tab-btn { background: var(--leaf); color: #fff; box-shadow: none; }
}
.dropdown a {
  display: block;
  padding: 6px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: #eef6f0;
  text-decoration: none;
  white-space: nowrap;
}
.dropdown li + li a { border-top: 1px solid rgba(255, 255, 255, .12); }
.dropdown a:hover, .dropdown a:focus-visible { background: var(--navy); color: #fff; outline: none; }

.who { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: .85rem; white-space: nowrap; }
.who-name { color: var(--muted); }
.who-name strong { color: var(--leaf); }
.menu-toggle { display: none; }

.rail {
  grid-area: rail;
  background: var(--rail);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 8px 0;
}
.rail a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 6px;
  color: var(--rail-ink);
  text-decoration: none;
  font-size: .76rem;
  font-weight: 600;
  text-align: center;
  border-left: 3px solid transparent;
}
.rail svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.rail a.is-current { color: #fff; background: rgba(255, 255, 255, .1); border-left-color: var(--marigold); }

.main { grid-area: main; overflow: auto; padding: 16px; }
.statusbar {
  grid-area: foot;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 16px;
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

/* ---------- shared pieces ---------- */
.btn {
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: #3c4046; }
.btn-warn { background: #f0a43a; color: #fff; }
.btn-warn:hover { background: #d98b1f; }
.btn-quiet { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-quiet:hover { border-color: var(--muted); }
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; }
.card { background: var(--panel); border: 0; }
.dash .panel, .dash .events { background: var(--panel); border-color: transparent; }
.dash .card { background: #e2e2e4; }
.panel > h2, .events h2 { font-size: .95rem; font-weight: 700; margin-bottom: 10px; }
.card h3 { font-size: .85rem; font-weight: 600; color: var(--muted); }
.soft { color: var(--muted); font-weight: 500; }
.empty { color: var(--muted); font-size: .85rem; padding: 6px 0; max-width: 46ch; }
.na { color: var(--muted); }
.tag { font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: var(--track); color: var(--muted); }
.tag-warn { background: #fdecd2; color: #7a4a05; }
.tag-ok { background: #e6f4ea; color: #1e6b34; }
.alert, .notice { padding: 9px 12px; border-radius: 5px; font-size: .88rem; margin: 12px 0; }
.alert { background: #fbe9e7; color: var(--danger); border: 1px solid #f3c7c2; }
.notice { background: #e6f4ea; color: #1e6b34; border: 1px solid #c3e2cc; }
.badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 11px;
  background: var(--marigold);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-align: center;
}
.badge-zero, .badge-na { background: var(--track); color: var(--muted); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr) 232px; gap: 14px; align-items: start; }
.dash-col { display: grid; gap: 14px; min-width: 0; }
.dash-col > *, .events { min-width: 0; overflow-x: auto; }       /* a wide table scrolls inside its card, never over the next column */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.pair > * { min-width: 0; overflow-wrap: anywhere; }
.panel > .pair { gap: 12px; }
.figure { font-size: .95rem; color: var(--muted); margin: 2px 0 8px; }
.figure .num { font-size: 1.9rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.donut-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.donut { width: 84px; height: 84px; flex: none; }
.donut circle { fill: none; stroke-width: 6; }
.donut-track { stroke: var(--surface); }
.slot-1 { stroke: var(--s1); }
.slot-2 { stroke: var(--s2); }
.slot-3 { stroke: var(--s3); }
.legend { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.legend b { color: var(--text); margin-left: 4px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.key.slot-1 { background: var(--s1); }
.key.slot-2 { background: var(--s2); }
.key.slot-3 { background: var(--s3); }

.seg { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.seg button {
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 7px 14px;
  color: var(--muted);
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { color: var(--leaf-deep); border-bottom-color: var(--leaf); }
.chart-title { font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.bars { display: grid; gap: 5px; }
.bars li { display: grid; grid-template-columns: minmax(84px, 34%) 1fr 3.5ch; align-items: center; gap: 10px; font-size: .84rem; }
.bar-label { text-align: right; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { width: 100%; height: 12px; display: block; }
.bar rect { fill: var(--s1); }
.bars li:hover .bar-label { color: var(--text); }
.bar-value { font-weight: 600; text-align: right; }

.facts { display: grid; gap: 7px; font-size: .88rem; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 700; }
.facts-grid { grid-template-columns: 1fr 1fr; column-gap: 20px; }
.rates { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.rates b { color: var(--text); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.tile:not(.tile-static):hover { border-color: var(--leaf); color: var(--leaf-deep); }
.tile-static { cursor: default; color: var(--muted); }

.events { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.events section { padding: 12px 14px; }
.events section + section { border-top: 1px solid var(--line); }
.events h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; margin-bottom: 0; }
.events ul { margin-top: 8px; display: grid; gap: 6px; }
.ev-name { display: block; font-size: .84rem; font-weight: 600; }
.ev-meta, .ev-more { font-size: .78rem; color: var(--muted); }
.ev-more { margin-top: 6px; }

/* ---------- pages, tables ---------- */
.page h1 { font-size: 1.35rem; letter-spacing: -.01em; margin-bottom: 12px; }
.page-narrow { max-width: 720px; }
.crumb { font-size: .82rem; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); max-width: 62ch; margin-bottom: 16px; }
.sub { font-size: .95rem; margin: 20px 0 8px; }
.links { columns: 2; column-gap: 28px; font-size: .9rem; }
.links li { padding: 4px 0; break-inside: avoid; }
.stack { display: grid; gap: 8px; max-width: 280px; justify-items: start; }
label { font-size: .85rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="search"], input[type="month"], input:not([type]),
input[type="date"], input[type="email"], input[type="file"], select, textarea {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid #b9c4bb;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.strip { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; font-size: .85rem; }
.strip dt { color: var(--muted); }
.strip dd { font-weight: 700; font-size: 1.05rem; }
.strip dd.na { font-weight: 500; font-size: .85rem; }
.strip-wide { margin-left: auto; text-align: right; max-width: 34ch; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; display: block; }
.grid { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid th { text-align: left; background: var(--leaf-tint); padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.grid th a { color: var(--text); text-decoration: none; display: flex; justify-content: space-between; gap: 8px; }
.sort { color: var(--leaf); font-size: .7rem; align-self: center; }
.grid td { padding: 7px 10px; border-bottom: 1px solid #e9ecf1; }
.grid tbody tr:hover td { background: #f3f7fc; }
.filters td { padding: 6px; background: #f3f7fc; }
.filters input { padding: 5px 7px; font-size: .85rem; min-width: 90px; }
.is-left td { color: var(--muted); }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; }
.count { color: var(--muted); font-size: .85rem; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; font-size: .85rem; text-decoration: none; }
.pager span { background: var(--leaf); border-color: var(--leaf); color: #fff; font-weight: 700; }

/* ---------- step 2: masters, forms, import ---------- */
.table-wrap, .panel, td, th { position: relative; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.r, .grid th.r, .grid td.r { text-align: right; }
.grid th.c, .grid td.c { text-align: center; }
.c { text-align: center; }
.nowrap { white-space: nowrap; }
.small { font-size: .85rem; }
.mono, code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.upper { text-transform: uppercase; }
.req { color: var(--danger); }
.hint { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.flash { margin: 0 0 12px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.page-head h1 { margin-bottom: 0; }
.head-actions, .confirm-bar, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.confirm-bar { margin: 12px 0; }
.quiet-link { color: inherit; text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }
.bullets { list-style: disc; padding-left: 20px; display: grid; gap: 2px; }
.alert .bullets a { color: var(--danger); }
.alert p + .bullets { margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips a, .chip { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); text-decoration: none; }
.chips a:hover { border-color: var(--leaf); color: var(--leaf-deep); }
.chips a[aria-current="page"] { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.chip { background: var(--leaf-tint); color: var(--leaf-deep); border-color: #b9d3f0; }

.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 6px; background: #fff7ea; border: 1px solid #f1d6a8; font-size: .88rem; }
.callout.warn { display: block; }

.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.split-wide { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
.form-grid { display: grid; gap: 10px; }
.form-grid > label, .row2 label, fieldset.plain > label, .filters-row label { display: block; }
.form-grid > label > :is(input, select, textarea), .row2 label > input, fieldset.plain > label > input,
.filters-row label > select { display: block; margin-top: 4px; }
.grid td code { white-space: nowrap; }
.field > label { display: block; margin-bottom: 4px; }
.form-grid label .soft, .field label .soft { font-weight: 500; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain { display: grid; gap: 10px; }
.radios, .checks { display: grid; gap: 4px; }
.radios legend, .checks legend { font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.radios label, .checks label, label.check { display: flex; align-items: baseline; gap: 7px; font-weight: 500; font-size: .88rem; }
.checks { grid-template-columns: 1fr 1fr; }
.checks legend { grid-column: 1 / -1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--leaf); width: 15px; height: 15px; flex: none; }
.num-input { text-align: right; font-variant-numeric: tabular-nums; }
textarea { resize: vertical; }
input[aria-invalid="true"], .is-bad input, .is-bad select { border-color: var(--danger); }
.field-error { display: block; font-size: .78rem; color: var(--danger); font-weight: 600; margin-top: 2px; }

.emp-form { display: grid; gap: 14px; }
.emp-form fieldset.panel { padding: 14px 16px 16px; }
.emp-form legend { font-size: .95rem; font-weight: 700; padding: 0 6px; margin-left: -6px; color: var(--navy); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; align-items: start; }
.field-wide { grid-column: 1 / -1; }
.fields label.check { align-self: end; padding-bottom: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0; border-top: 1px solid var(--line); }

.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table-tools .count { margin-left: auto; }
label.inline { display: flex; align-items: center; gap: 8px; }
label.inline input, label.inline select { width: auto; min-width: 200px; }
.table-title { font-size: .95rem; padding: 12px 12px 0; }
.table-note { font-size: .8rem; color: var(--muted); padding: 10px 12px; }
.history { margin-top: 14px; }
.scroll-x { overflow-x: auto; }
.pad { padding: 10px 12px; }
.grid.compact td, .grid.compact th { padding: 5px 8px; }
.grid tfoot th, .grid tfoot td { padding: 7px 10px; border-top: 2px solid var(--line); text-align: left; background: #f3f7fc; }
.grid tfoot td.r, .grid th.r, .grid td.r { text-align: right; }
.grid th.c, .grid td.c { text-align: center; }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * { display: inline; margin-left: 10px; }
td.detail { font-size: .82rem; max-width: 70ch; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--leaf-deep); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--danger); }
.yes { color: var(--leaf); font-weight: 700; }
tr.is-editing td { background: #fff7ea; }
tr.is-current-row td { background: #f3f7fc; }
tr.is-bad td { background: #fdf3f2; }
.tag-info { background: #e3eefb; color: #1d4f91; }
.tag-bad { background: #fbe0dd; color: var(--danger); }
.strip dd.bad { color: var(--danger); }
.bars li:has(.wide) { grid-template-columns: minmax(60px, 22%) 1fr 8ch; }
.filters-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-bottom: 4px; }
.filters-row label { min-width: 160px; }
details summary { cursor: pointer; font-weight: 600; margin: 10px 0 6px; }

/* ---------- directory dialog ---------- */
.modal { width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 24px 60px rgba(22, 39, 31, .35); }
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(22, 39, 31, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.05rem; }
.search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.search input { max-width: 360px; }
.modal-body { margin: 0 16px 16px; overflow: auto; flex: 1; }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--rail); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 8px; padding: 28px; border-top: 5px solid var(--marigold); }
.login-brand { margin-bottom: 4px; }
.login-brand .brand-name { color: var(--navy); font-size: 1rem; }
.login-brand img { max-height: 56px; }
.login-card h1 { font-size: 1.4rem; letter-spacing: -.01em; margin-bottom: 16px; }
.login-card form { display: grid; gap: 6px; }
.login-card input { margin-bottom: 8px; }
.login-card .btn { margin-top: 6px; padding: 9px 14px; }
.login-foot { margin-top: 18px; font-size: .8rem; color: var(--muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 1500px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .events { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .events section + section { border-top: 0; }
  .events section { border-bottom: 1px solid var(--line); }
}
@media (max-width: 1080px) {
  .app { display: block; height: auto; }
  .topbar { flex-wrap: wrap; position: sticky; top: 0; }
  .brand { flex: 1; flex-direction: row; align-items: baseline; gap: 6px; padding: 14px 16px; }
  .menu-toggle { display: block; font: inherit; font-weight: 600; background: var(--rail); color: #fff; border: 0; padding: 0 16px; cursor: pointer; }
  .tabs { display: none; flex-basis: 100%; flex-direction: column; order: 5; max-height: 70vh; overflow-y: auto; border-top: 1px solid var(--line); }
  .tabs.is-open { display: flex; }
  .tab { flex-direction: column; }
  .tab + .tab { border-left: 0; border-top: 1px solid var(--line); }
  .tab-btn { padding: 12px 16px; width: 100%; }
  .dropdown { position: static; max-height: none; box-shadow: none; border-radius: 0; }
  .who { background: var(--rail); }
  .who-name { display: none; }
  .rail { flex-direction: row; overflow-x: auto; padding: 0; }
  .rail a { flex: 0 0 auto; padding: 8px 12px; border-left: 0; border-bottom: 3px solid transparent; }
  .rail a.is-current { border-bottom-color: var(--marigold); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .statusbar { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .checks, .row2 { grid-template-columns: 1fr; }
  label.inline input, label.inline select { min-width: 0; }
  .pair, .tiles { grid-template-columns: 1fr; }
  .links { columns: 1; }
  .strip-wide { margin-left: 0; text-align: left; }
}

/* ---------- step 3: screens laid out like the reference software ---------- */
.ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.visually-hidden { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-small { font-size: .78rem; padding: 4px 10px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }
.danger-text { color: var(--danger); }
.inline-form { display: inline; }
.screen-title { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.screen-title .ico { width: 18px; height: 18px; }
.screen-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-inline label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.search-inline input { width: 220px; }
.screen-grid { min-height: 320px; }
.button-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.button-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.last-code { text-align: right; font-size: .82rem; line-height: 1.2; }
.last-code > span { margin-left: 8px; }

/* coloured-square tabs: Earning / Deduction / Other, Active / In Active */
.kind-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.kind-tabs a { display: flex; align-items: center; gap: 8px; min-width: 150px; padding: 8px 14px; background: #f1f3f6; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .88rem; border-radius: 3px 3px 0 0; }
.kind-tabs a i { width: 10px; height: 18px; background: #90adb5; display: inline-block; }
.kind-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 -2px 0 var(--line) inset; }
.kind-tabs a[aria-current="page"] i { background: var(--marigold); }
.kind-tabs-wide a { flex: 1; }

/* selectable grids */
[data-selectable] tbody tr[data-id] { cursor: pointer; }
[data-selectable] tbody tr.is-selected td, tr.is-selected td { background: #cfe2f8 !important; }

/* employee list */
.list-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.counters { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.counter { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--muted); font-size: .85rem; padding: 3px 4px; border-bottom: 2px solid transparent; }
.counter b { font-size: 1.05rem; color: var(--text); }
.counter-current b { color: var(--navy); }
.counter-left b { color: var(--marigold); }
.counter-all b { color: #c9a227; }
.counter[aria-current="page"] { border-bottom-color: var(--leaf); color: var(--text); }
.search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid #b9c4d2; border-radius: 3px; }
.search-box input { border: 0 !important; min-width: 70px; padding: 4px 6px !important; }
.search-box button { border: 0; background: none; padding: 0 6px; color: var(--muted); cursor: pointer; }
.pager .off { color: #a2a9b4; background: #f3f4f6; }

/* pop-up sheets (Add / Edit) */
.overlay { position: fixed; inset: 0; background: rgba(10, 28, 66, .45); display: grid; place-items: start center; padding: 6vh 16px; z-index: 40; overflow-y: auto; }
.sheet { background: var(--surface); width: min(560px, 100%); border-radius: 6px; padding: 0 18px 18px; box-shadow: 0 24px 60px rgba(10, 28, 66, .35); }
.sheet-wide { width: min(860px, 100%); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin: 0 -18px 14px; padding: 10px 18px; background: #f1f3f6; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.sheet-head h2 { font-size: 1rem; }
.sheet-close { font-size: 1.4rem; line-height: 1; text-decoration: none; color: var(--muted); padding: 0 4px; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.two-col { grid-template-columns: 1fr 1fr; }
.two-col .span2 { grid-column: 1 / -1; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin: 10px 0 14px; }
.check-list label { display: flex; gap: 7px; align-items: baseline; font-weight: 500; font-size: .88rem; }

/* employee profile */
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.profile-tabs { display: flex; flex-wrap: wrap; background: var(--navy); border-radius: 4px 4px 0 0; padding: 0 40px 0 4px; position: relative; }
.profile-tabs a, .profile-tabs span { color: #fff; text-decoration: none; font-size: .78rem; font-weight: 600; padding: 9px 10px; border-right: 1px solid rgba(255, 255, 255, .15); white-space: nowrap; }
.profile-tabs a:hover { background: rgba(255, 255, 255, .1); }
.profile-tabs [aria-current="page"] { background: var(--surface); color: var(--navy); }
.profile-tabs .is-off { color: rgba(255, 255, 255, .45); cursor: not-allowed; }
.profile-tabs .profile-close { position: absolute; right: 4px; top: 2px; border: 0; font-size: 1.2rem; line-height: 1; padding: 6px 10px; }
.profile-body { padding: 14px 16px 16px; }
.profile-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.pgroup { margin-bottom: 10px; }
.pgroup-title { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-style: italic; font-weight: 700; color: var(--navy); margin: 6px 0 8px; }
.frow { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; align-items: start; gap: 8px; margin-bottom: 6px; }
.frow > label { font-size: .8rem; font-weight: 500; color: #4a5260; padding-top: 6px; }
.frow input, .frow select, .frow textarea { padding: 5px 7px; font-size: .86rem; }
.frow-check { grid-template-columns: 1fr; }
.frow .req { color: var(--danger); }
.photo-block { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.photo { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #e7eaef; display: grid; place-items: center; color: #9aa3b0; flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .ico { width: 40px; height: 40px; }
.photo-actions { display: grid; gap: 4px; justify-items: start; }
.profile-actions { margin-top: 8px; }
.split-rows { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.row-fields .frow { grid-template-columns: minmax(100px, 40%) 1fr; }
.checks-grid { display: grid; grid-template-columns: 1fr; }
.checks-grid label.check { font-size: .84rem; margin: 2px 0; }
.row-grid { margin-top: 0; }
.row-open { margin-left: 6px; text-decoration: none; font-weight: 700; }
.stack-grids { display: grid; gap: 14px; }

/* slab master */
.slab-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.slab-form { display: grid; gap: 10px; margin-bottom: 12px; }
.slab-range, .slab-copy { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.slab-range label, .slab-copy > label:first-child { display: grid; gap: 4px; width: 170px; }
.month-grid { display: grid; grid-template-columns: repeat(12, minmax(62px, 1fr)); gap: 4px; }
.month-grid label { display: grid; gap: 3px; font-size: .74rem; text-align: center; }
.month-grid input { padding: 5px; }
.slab-rows td, .slab-rows th { padding: 5px 6px; font-size: .8rem; }

/* letters */
.letters-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.upload-block { margin-bottom: 18px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.upload-row input[type="file"] { width: auto; }
.letter-form { display: grid; gap: 12px; }
.letter-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.letter-meta > label { display: grid; gap: 4px; }
.letter-meta > label.check { display: flex; align-self: end; }
label.check.inline { display: inline-flex; }
.letter-work { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; }
.field-list { border: 1px solid var(--line); border-radius: 4px; max-height: 470px; overflow-y: auto; }
.field-list-head { padding: 7px 10px; background: #f1f3f6; font-weight: 600; font-size: .85rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.field-list li + li { border-top: 1px solid #edf0f3; }
.field-list button { width: 100%; text-align: left; font: inherit; font-size: .84rem; padding: 5px 10px; background: none; border: 0; cursor: pointer; }
.field-list button:hover { background: var(--leaf-tint); }
.field-list .hint { padding: 8px 10px; }
.editor { border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; min-width: 0; }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 6px; background: #f6f7f9; border-bottom: 1px solid var(--line); font-size: .8rem; }
.editor-bar button { font: inherit; min-width: 28px; height: 28px; border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; }
.editor-bar button:hover { border-color: var(--line); background: var(--surface); }
.editor-bar label { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.editor-bar select { width: auto; padding: 3px 4px; font-size: .8rem; }
.editor-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor-area { min-height: 420px; padding: 18px 22px; outline: none; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.editor-area:focus { box-shadow: inset 0 0 0 2px var(--leaf-tint); }
.letter-preview { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 28px 36px; margin: 12px 0; max-width: 860px; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5; }
.letter-preview table, .letter table { border-collapse: collapse; }
.letterhead { display: block; max-width: 100%; max-height: 140px; margin: 0 auto 16px; }

@media (max-width: 1080px) {
  .pcols { grid-template-columns: minmax(0, 1fr); }
  .profile-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .frow { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
  .frow input, .frow select { min-width: 0; }
  .split-rows, .slab-layout, .letters-layout, .letter-work { grid-template-columns: minmax(0, 1fr); }
  .letter-meta { grid-template-columns: minmax(0, 1fr); }
  .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
.mini-facts { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin: -4px 0 8px; }
.mini-facts b, .red { color: var(--marigold); }
.trend { width: 100%; height: auto; max-height: 150px; }
.trend-grid { stroke: var(--track); stroke-width: 1; }
.trend-y { font-size: 7px; fill: var(--muted); text-anchor: end; }
.trend-x { font-size: 7px; fill: var(--muted); text-anchor: middle; }
.cal td { height: 54px; vertical-align: top; width: 14.28%; }
.cal-day { display: block; font-size: .78rem; color: var(--muted); }
.cal-pill { display: block; margin-top: 4px; padding: 2px 4px; border-radius: 9px; background: #cfe9f5; font-size: .72rem; text-align: center; white-space: nowrap; }
.cal-pill.is-off { background: var(--track); color: #9aa3b0; }
.dir-photo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.search select { max-width: 360px; }
.photo-actions label.btn { position: relative; }
td.actions.left { text-align: left; }
td.actions.left > * { margin: 0 10px 0 0; }
.letter-meta > label { align-content: start; }

/* ---------- step 4: company, settings, users and rights */
.pcols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-lite { border: 1px solid var(--line); border-radius: 4px; padding: 4px 12px 8px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 2px 28px; }
.setting-cell { position: relative; padding-right: 58px; }
.setting-cell > .tag { position: absolute; right: 0; top: 6px; }
.setting-cell .frow { grid-template-columns: minmax(0, 1fr) 170px; margin-bottom: 2px; }
.setting-note { margin: 0 0 8px; }
.who .icon-link { position: relative; display: inline-flex; align-items: center; padding: 6px; border-radius: 4px; color: var(--muted); }
.who .icon-link:hover { background: #eef2f7; color: var(--navy); }
.who .icon-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.logo-box { display: grid; place-items: center; min-height: 110px; border: 1px dashed var(--line); border-radius: 4px; margin-bottom: 12px; padding: 10px; background: #fafbfc; }
.logo-box img { max-width: 100%; max-height: 90px; }
.rights-wrap { max-height: 62vh; overflow: auto; }
.rights th.group { background: #e9eef5; color: var(--navy); text-align: left; font-style: italic; }
.rights td.c, .rights th.c { text-align: center; width: 64px; }
.rights tr.is-unbuilt td:first-child { color: var(--muted); }
.role-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 4px; }
.role-list a { display: flex; justify-content: space-between; padding: 7px 10px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.role-list a[aria-current="page"] { background: var(--navy); color: #fff; }
.role-list a[aria-current="page"] .soft { color: #d6dcea; }
.access-list { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; display: grid; gap: 4px; }
.access-list label { display: flex; gap: 7px; align-items: baseline; font-weight: 500; font-size: .86rem; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1080px) {
  .pcols-2, .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .setting-cell .frow { grid-template-columns: minmax(0, 1fr) 150px; }
}
@media (max-width: 560px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
.split-gap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.formula-box { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; align-items: start; }
.formula-box textarea { width: 100%; }
.picker { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: #fafbfc; }
.picker label { display: block; font-size: .8rem; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 150px; overflow: auto; font-size: .82rem; }
.picker-list li { padding: 2px 0; }
.jv-wrap { max-height: 55vh; overflow: auto; }
.jv-wrap input { width: 100%; min-width: 90px; }
@media (max-width: 900px) { .formula-box { grid-template-columns: minmax(0, 1fr); } }
/* salary structure pop-up */
.sheet-xwide { width: min(1180px, 100%); }
.ss-head { gap: 10px; flex-wrap: wrap; }
.ss-head h2 { flex: 1 1 260px; }
.ss-date select { padding: 4px 6px; }
.ss-nav { display: flex; gap: 6px; }
.ss-top { display: grid; grid-template-columns: 180px 180px minmax(0, 1fr); gap: 10px; margin-bottom: 8px; }
.ss-top label { display: block; font-size: .85rem; font-weight: 600; }
.ss-top input { width: 100%; }
.ss-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.ss-col .grid { width: 100%; }
.ss-col td { vertical-align: middle; }
.ss-amt { width: 110px; text-align: right; padding: 3px 6px; }
.is-estimate td { color: var(--muted); font-style: italic; }
.ss-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 22px; margin: 12px 0 4px; padding: 10px 12px; background: #eef3fa; border-radius: 4px; font-size: .92rem; }
.ss-foot b { color: var(--navy); margin-left: 6px; font-size: 1rem; }
details.history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
details.history summary { cursor: pointer; display: flex; align-items: baseline; gap: 8px; }
details.history summary h3 { display: inline; margin: 0; font-size: .95rem; }
@media (max-width: 900px) {
  .ss-cols, .ss-top { grid-template-columns: minmax(0, 1fr); }
}
.import-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.import-kinds label.is-off { color: var(--muted); }
.import-options summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.import-options { display: grid; gap: 10px; }
.format-links li { margin-bottom: 6px; }
.legend-box { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; margin: 10px 0; font-size: .85rem; }
.legend-box p { margin: 4px 0; }
@media (max-width: 560px) { .import-kinds { grid-template-columns: minmax(0, 1fr); } }
.inline-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-filters label { font-size: .82rem; font-weight: 600; }
.label-like { display: block; font-weight: 600; font-size: .9rem; }
.to-list { margin: 4px 0; font-size: .86rem; max-height: 90px; overflow: auto; }
th.c, td.c { text-align: center; width: 42px; }
.assign-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.assign-side { padding: 10px 12px; }
.field-list-head select { display: block; width: 100%; margin-top: 4px; }
@media (max-width: 1080px) { .assign-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---- step 5: leave, holidays, attendance, monthly variables */
.inline-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin-bottom: 12px; }
.inline-fields label { font-weight: 600; font-size: .85rem; }
.inline-fields label > :is(input, select) { display: block; margin-top: 4px; min-width: 200px; }
.inline-actions { display: flex; gap: 6px; }
.hol-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.hol-cols h2.screen-title { margin-top: 0; }
.check-list-tight { max-height: 220px; overflow: auto; margin: 4px 0; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.lm-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 22px; }
.lm-row { display: grid; grid-template-columns: 46% 54%; align-items: center; gap: 8px; min-height: 34px; font-size: .84rem; }
.lm-row > label { font-weight: 500; color: var(--muted); }
.lm-field { display: flex; align-items: center; gap: 4px; }
.lm-field > select, .lm-field > input[type=text] { width: 100%; min-width: 0; padding: 4px 6px; }
.lm-field > select[multiple] { height: auto; }
.lm-field > input.lm-num { width: 64px; flex: none; }
.lm-field > select { flex: 1 1 auto; }
.lm-plus, .lm-unit { font-size: .75rem; font-weight: 700; color: var(--muted); }
.lm-remarks { display: block; margin: 12px 0 8px; font-weight: 600; font-size: .85rem; }
.lm-remarks textarea { display: block; width: 100%; margin-top: 4px; }
.lm-scope { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px; background: #f1f3f6; border-radius: 4px; }
.lm-scope label { font-weight: 700; font-size: .82rem; }
.lm-scope select { display: block; width: 100%; margin-top: 4px; }
.bal-table { margin-top: 14px; }
.bal-table input.num-input { width: 100%; min-width: 70px; padding: 4px 6px; }
.bal-table input.is-manual { background: #fff7ea; }
.soft-row th, .soft-row td { color: var(--muted); font-weight: 500; font-size: .82rem; }
.filter-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.filter-head h3 { font-size: 1.05rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.filter-grid label { font-weight: 600; font-size: .85rem; }
.filter-grid label > :is(select, input) { display: block; width: 100%; margin-top: 4px; }
.att-grid th, .mv-grid th { font-size: .74rem; white-space: normal; vertical-align: bottom; min-width: 52px; }
.att-grid td.zero, .mv-grid td.zero { color: #9aa3b0; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--marigold); vertical-align: middle; }
.row-note { font-size: .85rem; font-weight: 700; color: var(--navy); margin: 0; }
.att-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.att-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; font-size: .84rem; font-weight: 600; border-bottom: 1px solid #eef0f4; }
.att-row input.num-input { width: 90px; padding: 4px 6px; }
.att-row input[type=text]:not(.num-input) { width: 60%; }
.att-total { border-bottom: 0; background: #eef3fa; padding: 0 6px; border-radius: 4px; margin-top: 6px; }
.is-bad-num { color: var(--danger); }
.mv-form .att-row input.num-input { width: 140px; }
@media (max-width: 900px) {
  .hol-cols, .lm-cols, .att-cols { grid-template-columns: minmax(0, 1fr); }
  .lm-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- step 6: process salary, view salary, payslip filter */
.vs-top { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 22px; align-items: center; margin-bottom: 10px; font-size: .85rem; }
.vs-pay label { font-weight: 700; font-size: .82rem; }
.vs-pay select { display: block; margin-top: 3px; }
.vs-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.vs-counts a { color: var(--muted); text-decoration: none; }
.vs-counts a:hover { text-decoration: underline; }
.vs-totals { display: grid; gap: 4px; margin: 0; }
.vs-totals div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.vs-totals dd { margin: 0; color: var(--muted); }
.c-blue { color: #2d6fc4; } .c-green { color: #1e8a43; } .c-red { color: var(--danger); } .c-amber { color: #d98b1f; font-weight: 700; }
.vs-scroll { max-height: 55vh; overflow: auto; }
.vs-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; align-items: start; }
.vs-cols table { border-right: 1px solid var(--line); }
.vs-view-head { background: var(--navy); color: #fff; }
.vs-view-head h2, .vs-view-head .soft, .vs-view-head .sheet-close { color: #fff; }
.vs-comp-top { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-bottom: 10px; font-size: .88rem; }
.vs-gross td { background: #fff4d6 !important; font-weight: 700; }
.emp-filter { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.emp-filter .sheet-foot { grid-column: 1 / -1; }
.emp-filter table { max-height: 50vh; }
@media (max-width: 900px) { .vs-top, .vs-cols, .emp-filter { grid-template-columns: minmax(0, 1fr); } }

/* ---- step 7: salary sheet, sheet designer, PF / ESIC reports */
[role=tabpanel][hidden] { display: none !important; }
.sheet-title { text-align: center; margin: 4px 0 10px; font-size: .95rem; }
.sheet-scroll { max-height: 62vh; overflow: auto; }
.sheet-grid th { font-size: .72rem; white-space: normal; vertical-align: bottom; min-width: 70px; position: sticky; top: 0; z-index: 1; }
.sheet-grid td { white-space: nowrap; font-size: .8rem; }
.sheet-grid tfoot td { position: sticky; bottom: 0; background: #eef3fa; }
.sheet-subtotal td, .sheet-subtotal th { background: #fff4d6 !important; font-weight: 700; }
.sheet-footer { display: flex; justify-content: space-between; gap: 16px; margin: 40px 20px 10px; font-weight: 600; }
.filter-months { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px; }
.filter-months label { font-weight: 600; font-size: .85rem; }
.dual { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; margin: 12px 0; }
.dual select { width: 100%; min-height: 260px; font-size: .84rem; }
.dual-search { width: 100%; margin-bottom: 6px; }
.dual-btns { display: grid; gap: 6px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.stat-list ul { list-style: none; margin: 0; padding: 0; }
.stat-list li { border-bottom: 1px solid #eef0f4; }
.stat-list li > * { display: block; padding: 7px 10px; font-size: .86rem; text-decoration: none; }
.stat-list a[aria-current] { background: var(--navy); color: #fff; font-weight: 700; }
.stat-tools { display: grid; gap: 8px; padding: 10px; }
.stat-tools label { font-weight: 600; font-size: .82rem; }
.stat-tools select { display: block; width: 100%; margin-top: 3px; }
.stat-summary { max-width: 560px; }
.stat-summary th { text-align: left; font-weight: 600; }
.ecr-preview { background: #f6f7f9; border: 1px solid var(--line); padding: 10px; font-size: .8rem; max-height: 55vh; overflow: auto; white-space: pre; }
@media (max-width: 900px) { .stat-layout, .dual, .row3 { grid-template-columns: minmax(0, 1fr); } }
.mail-text { margin-top: 12px; }
.mail-text label { display: block; font-weight: 600; font-size: .85rem; margin-top: 8px; }
.mail-text :is(input, textarea) { display: block; width: 100%; margin-top: 4px; }
.emp-filter-bar { margin-bottom: 12px; }
.report-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; margin-bottom: 10px; }
.report-bar label { font-weight: 600; font-size: .82rem; }
.report-bar select { display: block; margin-top: 3px; }
.report-pager { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols-2 td input[type=text] { width: 100%; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.inc-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin: 6px 0 10px; }
.inc-top label { font-weight: 600; font-size: .82rem; }
.inc-top :is(select, input) { display: block; width: 100%; margin-top: 3px; }
.inc-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 0; align-items: start; max-height: 55vh; overflow: auto; }
.inc-cols table { border-right: 1px solid var(--line); }
.inc-cols input.num-input { width: 90px; padding: 3px 6px; text-align: right; }
.is-changed td { background: #eef8ee; }
.sheet-nav { font-size: .85rem; margin-left: auto; margin-right: 16px; }
@media (max-width: 900px) { .inc-top, .inc-cols { grid-template-columns: minmax(0, 1fr); } }
.att-bar { display: block; width: 100%; height: 16px; margin: 14px 0 6px; }
.att-bar .att-absent { fill: #d9534f; }
.att-bar .att-present { fill: #1e8a43; }
.att-bar-legend { display: flex; justify-content: space-between; font-size: .85rem; margin: 0 0 6px; }
.pt-table input[readonly] { width: 100%; background: #f2f3f5; border: 1px solid var(--line); padding: 4px 6px; }
.pt-table select { width: 100%; }
.block-label { display: block; font-weight: 600; font-size: .85rem; margin-top: 10px; }
.block-label textarea { display: block; width: 100%; margin-top: 4px; }
.disb-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.disb-bar > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg-link { display: inline-block; padding: 8px 16px; text-decoration: none; color: inherit; border-bottom: 3px solid transparent; }
.seg-link[aria-selected=true] { border-bottom-color: var(--navy); font-weight: 700; }
.supp-cols { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, .9fr); }
.supp-other { display: grid; gap: 8px; align-content: start; }
.supp-other label { font-weight: 600; font-size: .82rem; }
.supp-other :is(input, select, textarea) { display: block; width: 100%; margin-top: 3px; }
.grat-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.grat-form { display: grid; gap: 10px; }
.grat-form label { font-weight: 600; font-size: .82rem; }
.grat-form :is(input, select) { display: block; width: 100%; margin-top: 3px; }
@media (max-width: 900px) { .grat-layout, .supp-cols { grid-template-columns: minmax(0, 1fr); } }
.lc-table { max-width: 720px; }
.lc-table input.num-input { width: 90px; text-align: right; }
.stat-group { padding: 8px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }

/* Organisation Chart: nested lists drawn as a tree */
.org-chart { overflow-x: auto; padding: 12px 0; }
.org-chart ul { list-style: none; margin: 0; padding-left: 26px; border-left: 1px dashed var(--line); }
.org-chart > ul { border-left: 0; padding-left: 0; }
.org-chart li { margin: 6px 0; position: relative; }
.org-chart ul ul > li::before { content: ""; position: absolute; left: -26px; top: 18px; width: 22px; border-top: 1px dashed var(--line); }
.org-card { display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 200px; }
.org-card:hover { border-color: var(--muted); }
.org-card span { font-size: .8rem; color: var(--muted); }
.org-card .org-count { color: var(--text); }
.org-empty { text-align: center; font-size: 1.6rem; color: var(--muted); padding: 60px 0; }

.thumb { max-width: 120px; max-height: 80px; border-radius: 4px; display: block; }

/* top menu on mid-size screens: tighter tabs so they never run into "Welcome admin" */
.who { flex: none; }
@media (max-width: 1400px) and (min-width: 1081px) {
  .tab-btn { padding: 0 8px; font-size: .78rem; }
  .who-name { display: none; }
}
/* ---------- employee self service (/ess) ---------- */
.ess { background: var(--paper); min-height: 100vh; }
.ess-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ess-brand { font-weight: 700; color: var(--navy); text-decoration: none; }
.ess-brand span { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); }
.ess-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.ess-nav a { padding: 6px 10px; border-radius: 4px; color: var(--navy); text-decoration: none; font-size: .88rem; font-weight: 600; }
.ess-nav a:hover { background: var(--paper); }
.ess-out { display: flex; align-items: center; gap: 8px; }
.ess-main { max-width: 1100px; margin: 0 auto; padding: 18px 16px; display: grid; gap: 14px; }
.ess-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ess-card { display: grid; gap: 4px; text-decoration: none; color: var(--text); }
.ess-card span { color: var(--muted); font-size: .9rem; }
.ess-narrow { max-width: 460px; }
.stack { display: grid; gap: 10px; }
.stack label > :is(input, select, textarea) { display: block; width: 100%; margin-top: 4px; }
