/* ===========================================================================
   components.css — LED Works HR component library + utilities (Session 2).
   Uses tokens.css. Loaded before the (now-stub) style.css. This is the whole
   look: base, app shell (sidebar + topbar), cards, tables, badges, buttons,
   forms, alerts, toasts, modals, skeletons, empty states, plus a small utility
   layer so views need no inline-style attributes.
   =========================================================================== */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: var(--fs-md)/1.55 var(--font); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; margin: 0 0 var(--s1); color: var(--ink); }
h2 { font-size: var(--fs-lg); font-weight: 650; margin: 0 0 var(--s2); color: var(--ink); }
h3 { font-size: var(--fs-md); font-weight: 650; margin: 0 0 var(--s1); color: var(--ink); }
p { margin: var(--s2) 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-weak); }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex-shrink: 0; background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .16s ease; z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s4) var(--s3);
  font-weight: 700; font-size: var(--fs-lg); color: var(--side-ink-strong); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; }
.sidebar .brand .brand-mark { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.sidebar nav { flex: 1; padding: var(--s2); overflow-y: auto; overflow-x: hidden; }
.nav-item { display: flex; align-items: center; gap: var(--s3); padding: 9px 11px; margin: 1px 0; border-radius: var(--r-sm);
  color: var(--side-ink); font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.nav-item:hover { background: var(--side-hover); color: var(--side-ink-strong); text-decoration: none; }
.nav-item.active { background: var(--side-active); color: var(--side-ink-strong); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--side-ink); }
.nav-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.side-foot { padding: var(--s2); border-top: 1px solid var(--side-bg-2); }
.side-user { display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: var(--r-sm); }
.side-user .avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--side-active);
  color: var(--side-ink-strong); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.side-user .who { min-width: 0; }
.side-user .who .nm { color: var(--side-ink-strong); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* collapsed sidebar (icons only) */
.app-shell.side-collapsed .sidebar { width: var(--side-w-collapsed); }
.app-shell.side-collapsed .nav-label,
.app-shell.side-collapsed .brand span,
.app-shell.side-collapsed .side-user .who { display: none; }
.app-shell.side-collapsed .nav-item { justify-content: center; padding: 9px 0; }
.app-shell.side-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.side-collapsed .side-user { justify-content: center; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s5); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.icon-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2); border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.topsearch { position: relative; flex: 1; max-width: 420px; }
.topsearch svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  stroke: var(--muted); fill: none; stroke-width: 2; pointer-events: none; }
.topsearch input { width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--field-border); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13.5px; }
.topsearch .results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); overflow: hidden; z-index: 40; }
.topsearch .results a { display: block; padding: 8px 12px; color: var(--ink); font-size: 13.5px; }
.topsearch .results a:hover, .topsearch .results a.sel { background: var(--surface-2); text-decoration: none; }
.topsearch .results .rc { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.menu-wrap { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 6px; z-index: 40; }
.menu-pop .mi { display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink); font-size: 13.5px; cursor: pointer; width: 100%; background: none; border: 0; text-align: left; }
.menu-pop .mi:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .nav-ico { width: 18px; height: 18px; color: var(--muted); }
.menu-pop .nav-ico svg { width: 18px; height: 18px; }
.menu-pop .mhead { padding: 8px 10px 6px; }
.menu-pop .mhead .nm { font-weight: 650; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* ---------- content area ---------- */
.content { flex: 1; min-width: 0; }
.main { padding: var(--s5) var(--s5); max-width: var(--content-max); margin: 0 auto; }
.topline { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.subtle { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- cards + KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow-1); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4);
  box-shadow: var(--shadow-1); }
.stat .n { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.stat.accent .n { color: var(--accent); }

/* Compact policy disclosure: keep payroll's primary task visible, with the exact
   engine-backed eligibility matrix available on demand. */
.allowance-policy-card { padding: 0; overflow: hidden; }
.allowance-policy-summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center;
  gap: var(--s3); min-height: 72px; padding: var(--s3) var(--s4); cursor: pointer; list-style: none; }
.allowance-policy-summary::-webkit-details-marker { display: none; }
.allowance-policy-summary:hover { background: var(--surface-2); }
.allowance-policy-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--info-weak); color: var(--info); }
.allowance-policy-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.allowance-policy-copy { min-width: 0; display: grid; gap: 2px; }
.allowance-policy-title { color: var(--ink); font-weight: 650; }
.allowance-policy-glance { display: flex; flex-wrap: wrap; column-gap: var(--s4); row-gap: 1px; color: var(--muted);
  font-size: var(--fs-sm); }
.allowance-policy-glance b { color: var(--ink-2); font-weight: 600; }
.allowance-policy-action { display: inline-flex; align-items: center; gap: var(--s1); color: var(--accent); font-size: var(--fs-sm);
  font-weight: 650; white-space: nowrap; }
.allowance-policy-chevron { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8;
  transition: transform .16s ease; }
.allowance-policy-card[open] .allowance-policy-summary { border-bottom: 1px solid var(--line); }
.allowance-policy-card[open] .allowance-policy-chevron { transform: rotate(180deg); }
.allowance-policy-detail { padding: var(--s4); }
.allowance-policy-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.allowance-policy-rule-grid > div { padding: var(--s3); border-radius: var(--r-sm); background: var(--surface-2); }
.allowance-policy-label { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: 650; }
.allowance-policy-rule-grid p { margin: var(--s1) 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.allowance-policy-detail-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
  margin: var(--s4) 0 var(--s2); }
.allowance-policy-table th { position: static; }
.allowance-policy-source { margin-top: var(--s3); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th, table > tr:first-child th { position: sticky; top: var(--topbar-h); z-index: 1; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
tr.clickable:hover td, tr:hover td.hoverable { background: var(--surface-2); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.totrow td { border-top: 2px solid var(--line); background: var(--surface); }
textarea.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.code-block { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r1, 8px); padding: 10px; overflow-x: auto; white-space: pre; margin: 6px 0 0; }
/* Profile tab panes (S8.2) */
.ppane { display: none; }
.ppane.pon { display: block; }
/* Month calendar grid (S8.3/S8.4) */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: center; padding: 2px 0; }
.cal-cell { min-height: 62px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: var(--surface); font-size: 11.5px; }
.cal-cell.cal-blank { border: none; background: transparent; }
.cal-cell.cal-rest { background: var(--surface-2); color: var(--muted); }
.cal-cell.cal-work { background: var(--info-weak); border-color: color-mix(in srgb, var(--info) 35%, var(--line)); color: var(--ink); }
.cal-cell.cal-work .cal-shift { color: var(--info); font-size: 13px; font-weight: 800; }
.cal-cell.clickable { min-height: 64px; cursor: pointer; }
.cal-cell.clickable:hover, .cal-cell.clickable:focus { outline: 2px solid var(--info); outline-offset: 1px; }
.cal-cell.cal-hol { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.cal-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-pay { color: var(--accent); font-weight: 700; }
.cal-shift { font-variant-numeric: tabular-nums; }
.cal-ws { color: var(--muted); }
.cal-badge { margin-top: 2px; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-alert-badge { display: inline-block; padding: 1px 4px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-weight: 800; }
.schedule-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.schedule-detail-list { display: grid; gap: var(--s2); margin: var(--s4) 0; }
.schedule-detail-list > div { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.schedule-detail-list span { text-align: right; }
.punch-list { padding-left: var(--s5); }
.calendar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s4); }
.calendar-actions button { min-height: 44px; }
.request-explainer { margin: var(--s2) 0 var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--info-weak); color: var(--ink-2); font-size: var(--fs-sm); }
.balance-story { margin-bottom: var(--s3); padding: var(--s4); border: 1px solid color-mix(in srgb, var(--info) 30%, var(--line)); border-radius: var(--r-lg); background: var(--info-weak); }
.balance-story p { margin: var(--s2) 0 0; color: var(--ink-2); }
.balance-explainer { margin-top: var(--s3); }
.request-balance { margin: var(--s3) 0; padding: var(--s3); border-radius: var(--r-md); background: var(--info-weak); color: var(--info); font-weight: 700; }
.attachment-list { margin-top: var(--s2); }
.correction-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin: var(--s4) 0; }
.correction-compare > div { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.swap-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.swap-preview > div { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3); border-radius: var(--r-md); background: var(--info-weak); }
.coach-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.62); pointer-events: none; }
.coach-target { position: relative; z-index: 1001; border-radius: var(--r-md); box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--info); }
.coach-panel { position: fixed; left: 50%; bottom: var(--s4); z-index: 1002; width: min(520px, calc(100vw - 24px)); transform: translateX(-50%); padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); }
.coach-panel h2 { margin: var(--s1) 0 var(--s2); }
.coach-panel p { margin: 0 0 var(--s3); color: var(--ink-2); }
.coach-progress { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; }
.coach-controls { display: flex; justify-content: flex-end; gap: var(--s2); }
.coach-controls button { min-height: 44px; }
.profile-read-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); }
.profile-read-grid > div { display: flex; flex-direction: column; gap: var(--s1); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.profile-read-grid span { color: var(--ink-2); overflow-wrap: anywhere; }
.ess-footer { display: flex; justify-content: center; padding: var(--s5) 0; }
.ess-footer button { min-height: 44px; }
.issue-card { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.issue-card:last-child { border-bottom: 0; }
.performance-welcome { margin-bottom: var(--s3); padding: var(--s4); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--info-weak), var(--ok-weak)); }
.performance-welcome p { margin: 0; color: var(--ink-2); }
.performance-money { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-weak); }
.standing-card.good { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.standing-card.watch { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-weak); }
.standing-card.action { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-weak); }
.standing-card h2 { text-transform: capitalize; }
.performance-progress { width: 100%; height: 16px; accent-color: var(--ok); }
.cal-chip { margin: 2px 0; }
.cal-legend { margin: 4px 0 6px; }
.accent-card { border-left: 3px solid var(--accent); }
.text-ok { color: var(--ok); }
.align-self-end { align-self: flex-end; }
.align-self-center { align-self: center; }
.cellnum { width: 74px; text-align: right; font-variant-numeric: tabular-nums; padding: 4px 6px; }
/* ESS slim shell (mobile-first) */
.ess-wrap { max-width: 640px; margin: 0 auto; padding: 12px; }
.ess-switch-banner { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--warn-weak); border: 1px solid var(--warn); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 10px; font-weight: 700; }
.money-toggle { min-width: 88px; min-height: 44px; }
.money-sensitive { white-space: nowrap; font-variant-numeric: tabular-nums; }
.payslip-net { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-lg); }
.payslip-ytd { margin-top: var(--s3); }
.calendar-expander { margin-top: var(--s3); }
.calendar-expander summary { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink-2); font-weight: 700; cursor: pointer; }
.ess-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 12px; }
.ess-hi { font-size: 18px; font-weight: 700; }
.ess-main { margin-top: 8px; }
.print-title { display: none; }
@media print { .print-title { display: block; font-weight: bold; font-size: 15px; margin-bottom: 8px; } .topline .row { display: none; } }
.table-wrap { overflow-x: auto; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; border: 1px solid transparent; }
.b-owner { background: var(--owner-weak); color: var(--owner); }
.b-hr { background: var(--hr-weak); color: var(--hr); }
.b-ok { background: var(--ok-weak); color: var(--ok); }
.b-warn { background: var(--warn-weak); color: var(--warn); }
.b-danger { background: var(--danger-weak); color: var(--danger); }
.b-muted { background: var(--surface-2); color: var(--muted); }
.b-info { background: var(--info-weak); color: var(--info); }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 14px; font: 600 13.5px/1 var(--font); cursor: pointer; transition: background .12s ease, box-shadow .12s ease; }
button:hover, .btn:hover { background: var(--accent-hover); text-decoration: none; }
button:active, .btn:active { background: var(--accent-active); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--field-border); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); }
button.danger, .btn.danger { background: var(--danger); color: #fff; }
button.danger:hover, .btn.danger:hover { background: var(--accent-hover); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); padding: 6px 10px; border-color: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--accent-weak); }
button.sm, .btn.sm { padding: 5px 10px; font-size: 12.5px; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
button svg, .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: var(--r-sm);
  width: 100%; background: var(--surface); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin: var(--s3) 0 var(--s1); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.field-hint { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s1); }
.field-err { color: var(--danger); font-size: var(--fs-sm); margin-top: var(--s1); }

/* ---------- layout helpers used across views ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.check-list { display: grid; gap: var(--s2); max-height: 320px; overflow: auto; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.check-list > label { margin: 0; padding: var(--s2); border-radius: var(--r-sm); background: var(--surface); }
.w-70 { width: 70px; flex: 0 0 70px; }

/* ---------- alerts ---------- */
.alert { padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: var(--s3); font-size: 13.5px; border: 1px solid transparent; }
.alert.info { background: var(--info-weak); border-color: color-mix(in srgb, var(--info) 22%, transparent); color: var(--ink); }
.alert.warn { background: var(--warn-weak); border-color: color-mix(in srgb, var(--warn) 28%, transparent); color: var(--ink); }
.alert.danger { background: var(--danger-weak); border-color: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--ink); }
.alert.ok { background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 26%, transparent); color: var(--ink); }

/* ---------- toasts ---------- */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--gray-900); color: #fff; padding: 12px 18px;
  border-radius: var(--r-md); z-index: 99; box-shadow: var(--shadow-2); max-width: 380px; font-size: 13.5px;
  animation: toast-in .18s ease; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.swap-decision-error { margin: var(--s2) 0 0; max-width: 320px; }

/* ---------- modals ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: flex-start; justify-content: center;
  z-index: 50; padding: 44px 16px; overflow: auto; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); width: 560px; max-width: 100%;
  box-shadow: var(--shadow-2); animation: pop .14s ease; }
.modal.wide { width: 1020px; }
.modal h2 { margin-top: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------- skeletons ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; margin: 9px 0; }
.skel-title { height: 20px; width: 40%; margin-bottom: var(--s3); }
.skel-card { height: 84px; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--muted); }
.empty .ico { width: 40px; height: 40px; margin: 0 auto var(--s2); color: var(--gray-400); }
.empty .ico svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty .msg { font-size: 13.5px; }
.empty .msg b { color: var(--ink); display: block; font-size: var(--fs-md); margin-bottom: 3px; }
.empty button { margin-top: var(--s3); }

/* ---------- misc ported components ---------- */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; background: var(--muted); color: #fff; font-size: 11px; font-weight: 700; font-style: normal;
  line-height: 1; cursor: help; flex: none; user-select: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%);
  width: min(280px, 72vw); background: var(--gray-900); color: #fff; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 400; line-height: 1.5; box-shadow: var(--shadow-2); opacity: 0; visibility: hidden;
  transition: opacity .12s ease; z-index: 60; text-align: left; pointer-events: none; }
.tip::before { content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--gray-900); opacity: 0; visibility: hidden; transition: opacity .12s ease; z-index: 60; }
.tip:hover::after, .tip:hover::before, .tip:focus::after, .tip:focus::before { opacity: 1; visibility: visible; }

.tabbar { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.tabbar button, .tabbar a { background: transparent; color: var(--muted); border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; padding: 8px 14px; cursor: pointer; text-decoration: none; font: inherit; display: inline-flex; align-items: center; }
.tabbar button:hover, .tabbar a:hover { background: var(--surface-2); }
.tabbar button.on, .tabbar a.on { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); background: var(--accent-weak); }

.stepper { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s3) 0 var(--s4); }
.step { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 4px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.step.done { background: var(--ok-weak); color: var(--ok); }
.step.current { background: var(--accent); color: #fff; font-weight: 700; }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: var(--s4); }
.tl-item { position: relative; padding-bottom: 13px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-item .when { font-size: 11.5px; color: var(--muted); }

.next-banner { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap;
  background: var(--gray-900); color: #fff; border-radius: var(--r-md); padding: var(--s4) var(--s4); margin-bottom: var(--s4); }
.next-banner .who { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
.next-banner .what { font-size: 15.5px; font-weight: 700; }

.review-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
.review-grid > div:first-child { max-height: 74vh; overflow: auto; padding-right: 8px; }
.review-grid .incident-desc { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; background: var(--surface); margin-top: 6px; }
.ai-pane { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); max-height: 72vh; min-height: 380px; }
.ai-pane .chat { flex: 1; overflow: auto; min-height: 100px; margin: 8px 0; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 30% -10%, #1c2b48 0%, var(--gray-900) 55%); padding: var(--s4); }
.login-card { background: var(--surface); padding: var(--s6) var(--s6); border-radius: var(--r-lg); width: 380px; box-shadow: var(--shadow-2); }
.login-card .brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: var(--s3); }
.login-company-mark { min-height: 48px; display: flex; align-items: center; justify-content: center; margin-bottom: var(--s3); }
.login-company-mark img { display: block; max-width: 220px; max-height: 56px; object-fit: contain; object-position: center; }
.login-company-mark .brand-mark { margin-bottom: 0; }
.login-company-mark .brand-mark[hidden], .login-company-mark img[hidden] { display: none; }
.login-door-links { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin-top: var(--s4); font-size: var(--fs-sm); color: var(--muted); }
.login-door-links a { color: var(--muted); text-decoration: none; }
.login-door-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- utilities (so views need no inline-style) ---------- */
.clickable { cursor: pointer; }
.layout { display: flex; min-height: 100vh; } /* compat alias for the old shell markup */
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }
.text-left { text-align: left; } .text-center { text-align: center; } .text-right { text-align: right; }
.text-danger { color: var(--danger); } .text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-muted { color: var(--muted); }
.fw-400 { font-weight: 400; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.wrap-anywhere { word-break: break-word; overflow-wrap: anywhere; }
.block { display: block; } .inline-block { display: inline-block; }
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .gap-1 { gap: var(--s1); } .gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); }
.w-auto { width: auto; } .w-full { width: 100%; }
.w-70 { width: 72px; } .w-90 { width: 90px; } .w-110 { width: 110px; } .w-150 { width: 150px; } .w-160 { width: 160px; } .w-240 { width: 240px; } .w-320 { width: 320px; }
.grow-search { max-width: 320px; flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: var(--s1); } .mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); } .mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: 6px; }
.my-1 { margin-top: var(--s1); margin-bottom: var(--s1); } .my-2 { margin-top: var(--s2); margin-bottom: var(--s2); }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; } .mb-2px { margin-bottom: 2px; }
.m-0 { margin: 0; } .my-4 { margin: 4px 0; } .my-6 { margin: 6px 0; } .my-8 { margin: 8px 0; }
.ml-6 { margin-left: 6px; } .ml-8 { margin-left: 8px; } .ml-auto { margin-left: auto; }
.py-5 { padding: 20px 0; } .py-tight { padding: 3px 0; } .p-card { padding: 12px 16px; }
.w-72 { width: 72px; } .w-84 { width: 84px; }
.fs-12 { font-size: 12px; } .fs-15 { font-size: 15px; letter-spacing: 1px; }
.pre-wrap { white-space: pre-wrap; } .break-all { word-break: break-all; } .no-underline { text-decoration: none; }
.cursor-pointer { cursor: pointer; } .align-self-center { align-self: center; }
.between { justify-content: space-between; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.surface-2 { background: var(--surface-2); } .op-80 { opacity: .8; max-width: 640px; }
.mono-area { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mono-txt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; } .ls-1 { letter-spacing: 1px; }
.codes-grid { font-family: ui-monospace, monospace; font-size: 14px; line-height: 1.9; columns: 2; margin: 12px 0; }
.min-h-50 { min-height: 50px; } .min-h-60 { min-height: 60px; } .min-h-80 { min-height: 80px; }
.min-h-150 { min-height: 150px; } .min-h-160 { min-height: 160px; } .min-h-52vh { min-height: 52vh; } .min-h-60vh { min-height: 60vh; }
.scroll-45vh { max-height: 45vh; overflow: auto; margin: 10px 0; } .scroll-520 { max-height: 520px; overflow: auto; }
.indent-1 { margin: 4px 0 4px 2px; line-height: 1.45; } .indent-2 { margin: 4px 0 4px 18px; line-height: 1.45; }
.my-3 { margin: 12px 0; } .mw-240 { max-width: 240px; } .mw-340 { max-width: 340px; } .mw-420 { max-width: 420px; }
.divider-b { border-bottom: 1px solid var(--line); }
.cell-rest { background: var(--surface-2); } .cell-holiday { background: var(--danger-weak); }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.app-shell.side-collapsed .nav-badge { display: none; }
.chip-stack { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.logo-preview { max-height: 48px; max-width: 160px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; background: #fff; }
.employee-photo-control { display: flex; align-items: center; gap: var(--s4); }
.employee-photo-copy { min-width: 0; flex: 1; }
.profile-photo-frame { width: 104px; height: 104px; flex: none; overflow: hidden; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.profile-photo-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-photo-fallback { display: grid; width: 100%; height: 100%; place-items: center; font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.profile-photo-fallback[hidden] { display: none; }
.photo-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 560px) { .employee-photo-control { align-items: flex-start; } .profile-photo-frame { width: 78px; height: 78px; } }
.pol-title { cursor: pointer; font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.px-6 { padding: 0 6px; } .p-1012 { padding: 10px 12px; } .p-12 { padding: 12px; }
.btn-on-dark { background: rgba(255,255,255,.14); color: #fff; }
.btn-on-dark:hover { background: rgba(255,255,255,.24); }
.mtb-4-8 { margin: 4px 0 8px; } .mtb-8-4 { margin: 8px 0 4px; } .mtb-10-4 { margin: 10px 0 4px; }
.mtb-2-8 { margin: 2px 0 8px; } .mtb-4-10 { margin: 4px 0 10px; } .mtb-n4-10 { margin: -4px 0 10px; }
.mtb-8-4-lh { margin: 8px 0 4px; line-height: 1.45; }
.divider-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.divider-row:last-child { border-bottom: 0; }
.section-top { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.img-fit { max-width: 100%; max-height: 65vh; border-radius: var(--r-sm); display: block; margin: 0 auto; }
.frame-65 { width: 100%; height: 65vh; border-radius: var(--r-sm); border: 0; }
.chat-bubble { white-space: normal; text-align: left; display: inline-block; max-width: 85%; padding: 8px 12px;
  border-radius: var(--r-md); font-weight: 400; font-size: 13px; }
.chat-bubble.me { background: var(--accent-weak); }
.chat-bubble.ai { background: var(--surface-2); }
.issue-archived { margin-top: var(--s3); }
.issue-archived summary { cursor: pointer; font-weight: 700; }
.issue-archived-list { display: grid; gap: var(--s2); margin-top: var(--s3); }

/* ---------- annotate mode (owner/HR point-and-comment capture) ---------- */
.admin-fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; } /* below modal backdrops (50): the fab must never float over a dialog */
.admin-fab .mi-link { display: block; padding: 8px 12px; color: inherit; text-decoration: none; }
body.annotate-on { cursor: crosshair; height: auto; min-height: 100%; } /* body must grow with content or the sticky banner stops at the first viewport-height */
/* The banner lives in normal flow (sticky, first child of body), so it owns its 34px and the
   shell starts below it. Sticky shell pieces then pin 34px lower so scrolling never hides them. */
body.annotate-on .topbar { top: 34px; }
body.annotate-on .sidebar { top: 34px; height: calc(100vh - 34px); }
body.annotate-on thead th, body.annotate-on table > tr:first-child th { top: calc(var(--topbar-h) + 34px); }
body.annotate-on button, body.annotate-on a, body.annotate-on input, body.annotate-on select, body.annotate-on textarea { cursor: crosshair; }
.annotate-hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.annotate-banner { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: var(--s3);
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; height: 34px; box-sizing: border-box; padding: 0 40px 0 12px; }
.annotate-banner button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #fff; font-size: 14px; cursor: pointer; padding: 4px 8px; }
.annotate-popover { position: fixed; z-index: 95; background: var(--surface-1, #fff); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: var(--s3); width: 300px; cursor: auto; }
.annotate-popover label { font-weight: 700; font-size: 13px; }
.annotate-popover textarea { width: 100%; min-height: 72px; margin: var(--s2) 0; }
@media (max-width: 599px) {
  .annotate-popover.docked { left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: var(--r-md) var(--r-md) 0 0; }
}
@media (max-width: 600px) {
  /* Here body itself is the scroll container (overflow-x hidden); it must keep its viewport
     height so the sticky banner pins to the scrollport instead of scrolling away with content. */
  body.annotate-on { height: 100%; }
}

/* ---------- responsive ---------- */
@media (min-width: 1024px) {
  .ess-wrap .tabbar { flex-wrap: wrap; overflow-x: visible; white-space: normal; }
}
@media (max-width: 1023px) {
  .ess-wrap .tabbar { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
  .ess-wrap .tabbar a { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .ai-pane { max-height: none; min-height: 0; }
}
@media (max-width: 860px) {
  .side-collapse-btn { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-2); }
  .app-shell.side-open .sidebar { transform: none; }
  .app-shell.side-collapsed .sidebar { width: var(--side-w); }
  .app-shell.side-collapsed .nav-label, .app-shell.side-collapsed .brand span, .app-shell.side-collapsed .side-user .who { display: block; }
  .scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 25; }
  .main { padding: var(--s4); }
}
@media (max-width: 600px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .ess-wrap { width: 100%; max-width: 100%; padding: var(--s2); }
  .ess-main, .ess-main > *, .card { min-width: 0; max-width: 100%; }
  .ess-top { gap: var(--s2); }
  .ess-top button, .ess-switch-banner button, .ess-main button, .ess-main .btn { min-height: 44px; }
  .ess-wrap input:not([type=checkbox]):not([type=radio]):not(.photo-file-input), .ess-wrap select, .ess-wrap textarea { min-height: 44px; }
  .ess-wrap .tabbar { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .ess-wrap .tabbar a { flex: 0 0 auto; display: flex; align-items: center; min-height: 44px; white-space: nowrap; }
  .request-action-grid, .profile-read-grid, .swap-preview, .correction-compare, .calendar-actions { grid-template-columns: 1fr; }
  .employee-photo-control, .row.between { flex-wrap: wrap; }
  .table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .modal-bg { align-items: flex-end; padding: var(--s2); }
  .modal, .modal.wide { width: 100%; max-height: calc(100dvh - 16px); overflow-y: auto; padding: var(--s4); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal input:not([type=checkbox]):not([type=radio]), .modal select, .modal textarea, .modal button, .modal .btn { min-height: 44px; }
  .cal-grid { gap: 2px; }
  .cal-cell, .cal-cell.clickable { min-height: 58px; padding: 3px; font-size: 10px; }
  .cal-cell.cal-work .cal-shift { font-size: 11px; }
  .cal-ws { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini-month-card { padding: var(--s3); }
  .coach-panel { bottom: var(--s2); padding: var(--s3); }
  .allowance-policy-summary { grid-template-columns: 32px minmax(0, 1fr) auto; min-height: 68px; padding: var(--s3); }
  .allowance-policy-icon { width: 32px; height: 32px; }
  .allowance-policy-action > span { display: none; }
  .allowance-policy-glance { display: grid; }
  .allowance-policy-rule-grid { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .topbar .menu-ham { display: none; } .scrim { display: none; } }

@media print {
  .sidebar, .topbar, .next-banner button, .topline button { display: none !important; }
  .app-shell { display: block; }
  .card { box-shadow: none; }
}

/* ---------- styleguide (#/styleguide) ---------- */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s3); }
.sg-sw { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; font-size: 11.5px; }
.sg-sw .chip { height: 46px; } .sg-sw .cap { padding: 5px 8px; color: var(--muted); }
.sw-accent { background: var(--accent); } .sw-accent-hover { background: var(--accent-hover); } .sw-accent-weak { background: var(--accent-weak); }
.sw-ok { background: var(--ok); } .sw-warn { background: var(--warn); } .sw-danger { background: var(--danger); } .sw-info { background: var(--info); }
.sw-ink { background: var(--ink); } .sw-muted { background: var(--muted); } .sw-line { background: var(--line); }
.sw-bg { background: var(--bg); } .sw-surface2 { background: var(--surface-2); }
.sw-g50 { background: var(--gray-50); } .sw-g100 { background: var(--gray-100); } .sw-g200 { background: var(--gray-200); }
.sw-g300 { background: var(--gray-300); } .sw-g400 { background: var(--gray-400); } .sw-g500 { background: var(--gray-500); }
.sw-g600 { background: var(--gray-600); } .sw-g700 { background: var(--gray-700); } .sw-g800 { background: var(--gray-800); } .sw-g900 { background: var(--gray-900); }
.sg-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--s2); }
.sg-icons .cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 11px; color: var(--muted); }
.sg-icons .cell svg { width: 22px; height: 22px; stroke: var(--ink-2); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sg-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: var(--s2) 0; }

/* Store Calendar year-at-a-glance */
.mini-cal { display: grid; grid-template-columns: repeat(7, minmax(28px, 1fr)); gap: 4px; }
.mini-day { min-height: 34px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; background: var(--card); }
.note { border-top: 1px solid var(--line); padding: 10px 0; }
.note:first-child { border-top: 0; }

/* Grouped sidebar navigation */
.nav-section { margin: 0 0 var(--s2); }
.nav-section-label { padding: var(--s3) 11px var(--s1); color: color-mix(in srgb, var(--side-ink) 68%, transparent); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.nav-section-divider { display: none; height: 1px; margin: var(--s2) 10px; background: var(--side-bg-2); }
.app-shell.side-collapsed .nav-section-label { display: none; }
.app-shell.side-collapsed .nav-section:not(:first-child) .nav-section-divider { display: block; }
.app-shell.side-collapsed .nav-badge { position: absolute; right: 6px; }

/* Compact pattern-alert digest */
.pattern-alerts .pattern-group { padding-top: var(--s3); border-top: 1px solid var(--line); }
.pattern-alerts .pattern-group:first-of-type { padding-top: 0; border-top: 0; }
.pattern-head { margin-bottom: var(--s2); }
.compact-table th { padding: 7px 10px; }
.compact-table td { padding: 7px 10px; }
.pattern-info { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.compact-list { display: grid; gap: var(--s1); }
.compact-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.compact-row:last-child { border-bottom: 0; }

/* Store Calendar year-at-a-glance */
.year-cards { grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); }
.mini-month-card { padding: var(--s3); }
.mini-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; min-width: 0; }
.mini-dow { min-width: 0; text-align: center; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.mini-day { min-width: 0; min-height: 28px; padding: 3px 2px; border: 0; border-radius: var(--r-sm); font-size: 11.5px; background: transparent; text-align: center; box-shadow: none; }
.mini-day.mini-blank { background: transparent; }
.mini-num { font-variant-numeric: tabular-nums; }
.mini-day.mini-today { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.mini-day.mini-closure { background: var(--danger-weak); color: var(--danger); }
.mini-day.mini-critical { background: var(--warn-weak); color: var(--warn); }
.mini-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s2); }
.mini-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.mini-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mini-today-key { border: 2px solid var(--accent); }
.mini-closure-key { background: var(--danger-weak); }
.mini-critical-key { background: var(--warn-weak); }

/* Attendance week grid noise controls */
.badge-week { padding: 1px 6px; font-size: 10.5px; line-height: 1.4; }
.week-status { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 4px; min-height: 18px; }
.queue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; box-shadow: 0 0 0 2px var(--warn-weak); }

/* Inline labeled control for toplines */
.inline-field { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; }
.inline-field span { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.inline-field input { width: auto; }
