/* =============================================================================
   hr.css - the HR portal component layer.

   Mode B throughout. Rules this file lives under, from DESIGN_SYSTEM.md:

     - NO COLOUR LITERALS. Every colour is a var() from tokens.css. There is no
       new palette here, and test/hr-tokens.test.mjs fails the build if one
       appears.
     - --accent is --ink, not brand red. The only brand red on any screen is the
       top rail and the logo lockup.
     - Red means one thing in this product: over capacity, or a conflict. There
       are no answer states in an HR tool, so --wrong is free, and it is spent
       on exactly that one meaning.
     - Section rhythm stops at --s-12. --s-16 and above are Mode A only.
     - Motion: 150ms ceiling, opacity / background-color / border-color / colour
       / box-shadow only. No entrance animation on a data table.
     - Radius system: controls --r-sm, panels --r-md, the one hero card --r-lg,
       pills and badges --r-full. Applied consistently, no exceptions.
     - All numbers are mono and tabular. A payroll column that does not align is
       a payroll column nobody trusts.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Reset and base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.hr-shell {
  min-width: 320px;
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: var(--lh-snug); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: inherit;
}

.hr-num,
.hr-code,
.hr-badge,
.hr-stat-value,
.hr-next-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* -----------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.hr-rail {
  height: 3px;
  background: var(--brand-gradient);
}

.hr-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 56px;
  padding: 0 var(--s-6);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hr-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  border-radius: var(--r-sm);
}

.hr-brand-mark { display: block; height: 22px; width: auto; }

.hr-brand-sep {
  width: 1px;
  height: 18px;
  background: var(--line-2);
}

.hr-brand-app {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-3);
}

.hr-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.hr-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.hr-identity-label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-select {
  min-height: var(--hit-sm);
  padding: 0 var(--s-2);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.hr-whoami {
  display: inline-flex;
  flex-direction: column;
  line-height: var(--lh-snug);
  text-align: right;
}

.hr-whoami-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }

.hr-whoami-role {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

/* Signed out: no sidebar column, nothing to navigate to. */
body.is-signed-out .hr-body { grid-template-columns: minmax(0, 1fr); }
body.is-signed-out .hr-nav { display: none; }

/* -----------------------------------------------------------------------------
   Sign in
   -------------------------------------------------------------------------- */

.hr-signin-wrap {
  display: flex;
  justify-content: center;
  padding: var(--s-12) var(--s-4);
}

.hr-signin {
  width: 100%;
  max-width: 380px;
  padding: var(--s-6);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-1);
}

.hr-signin-head { margin-bottom: var(--s-6); }

.hr-signin-mark { display: block; height: 26px; width: auto; margin-bottom: var(--s-4); }

.hr-signin-title { font-size: var(--fs-xl); letter-spacing: var(--tr-tight); }

.hr-signin-sub {
  margin: var(--s-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.hr-field { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-4); }

.hr-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }

.hr-input {
  min-height: var(--hit);
  padding: 0 var(--s-3);
  font: inherit;
  font-size: var(--fs-md);
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.hr-input::placeholder { color: var(--ink-3); }

.hr-help { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }

.hr-field-error {
  margin: 0 0 var(--s-4);
  padding: var(--s-2) var(--s-3);
  background: var(--wrong-wash);
  border: 1px solid var(--wrong-line);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--wrong);
}

.hr-signin-submit { width: 100%; min-height: var(--hit); }

.hr-signin-submit[disabled] { opacity: 0.6; cursor: default; }

/* -----------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.hr-nav {
  position: sticky;
  top: 59px;
  padding: var(--s-6) var(--s-4);
  border-right: 1px solid var(--line);
  background: var(--paper);
  min-height: calc(100dvh - 59px);
}

.hr-nav-group + .hr-nav-group { margin-top: var(--s-6); }

.hr-nav-title {
  margin-bottom: var(--s-2);
  padding: 0 var(--s-2);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-nav-list { margin: 0; padding: 0; list-style: none; }

.hr-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--hit-sm);
  padding: 0 var(--s-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

a.hr-nav-item:hover { background: var(--paper-3); color: var(--ink); }

.hr-nav-item.is-active {
  background: var(--paper-3);
  color: var(--ink);
  font-weight: 600;
}

.hr-nav-item.is-pending { color: var(--ink-4); cursor: default; }

.hr-nav-phase {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

/* -----------------------------------------------------------------------------
   Main
   -------------------------------------------------------------------------- */

.hr-main {
  width: 100%;
  max-width: var(--content-max);
  padding: var(--s-6);
  outline: none;
}

.hr-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.hr-page-title { font-size: var(--fs-2xl); letter-spacing: var(--tr-tight); }

.hr-page-sub {
  margin: var(--s-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.hr-week-nav { display: flex; gap: var(--s-2); }

.hr-attendance-action {
  display: block;
  margin-top: var(--s-2);
  white-space: nowrap;
}

.hr-button-small {
  min-height: var(--hit-sm);
  padding: 0 var(--s-2);
  font-size: var(--fs-xs);
}

.hr-attendance-bulk {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin: var(--s-4) 0;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.hr-attendance-bulk .hr-publish-title,
.hr-attendance-bulk .hr-publish-note { margin: 0; }

.hr-attendance-bulk-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
}

.hr-attendance-bulk-actions .hr-filter { min-width: 132px; }

/* -----------------------------------------------------------------------------
   Tone map. Every coloured component reads --tone, so a component never picks
   a colour itself and a new tone is one rule, not twelve.
   -------------------------------------------------------------------------- */

.hr-tone-neutral { --tone: var(--ink-3); --tone-wash: var(--paper-3); --tone-line: var(--line); }
.hr-tone-ok      { --tone: var(--ok);    --tone-wash: var(--ok-wash);    --tone-line: var(--ok-line); }
.hr-tone-warn    { --tone: var(--warn);  --tone-wash: var(--warn-wash);  --tone-line: var(--warn-line); }
.hr-tone-wrong   { --tone: var(--wrong); --tone-wash: var(--wrong-wash); --tone-line: var(--wrong-line); }
.hr-tone-info    { --tone: var(--info);  --tone-wash: var(--info-wash);  --tone-line: var(--info-line); }

/* -----------------------------------------------------------------------------
   Stat strip. Not cards: hairlines and space, so nothing reads as more
   important than the numbers themselves.
   -------------------------------------------------------------------------- */

.hr-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-5);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hr-stat-strip-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hr-stat { min-width: 0; }

.hr-stat-label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-stat-value {
  margin-top: var(--s-1);
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  color: var(--tone, var(--ink));
}

.hr-stat-value-sm { font-size: var(--fs-lg); }

.hr-stat-note {
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  min-height: 1em;
}

.hr-peak-note {
  margin: var(--s-3) 0 var(--s-6);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  max-width: var(--measure);
}

/* -----------------------------------------------------------------------------
   Columns
   -------------------------------------------------------------------------- */

.hr-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-6);
  align-items: start;
}

.hr-col-main { min-width: 0; }

.hr-col-side { position: sticky; top: 75px; }

/* -----------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.hr-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.hr-panel + .hr-panel { margin-top: var(--s-5); }

.hr-one-time-password {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3);
  margin-bottom: var(--s-3);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.hr-one-time-password code {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  overflow-wrap: anywhere;
}

.hr-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}

.hr-panel-title { font-size: var(--fs-base); }

.hr-panel-meta { font-size: var(--fs-xs); color: var(--ink-3); }

.hr-section-head {
  margin: var(--s-6) 0 var(--s-3);
  font-size: var(--fs-base);
}

.hr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Occupancy grid. Phase 2. One cell per 30 minutes per day, holding the number
   of classes running at once. Colour carries capacity and nothing else.
   -------------------------------------------------------------------------- */

.hr-grid-wrap { overflow-x: auto; }

.hr-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.hr-grid thead th {
  padding: var(--s-2) var(--s-1);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
}

.hr-slot-time {
  width: 52px;
  padding-right: var(--s-2);
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: var(--ink-4);
  white-space: nowrap;
}

.hr-slot {
  height: 22px;
  border: 1px solid var(--paper);
  text-align: center;
  vertical-align: middle;
}

.hr-slot-n {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
}

.hr-slot-empty { background: var(--paper-2); }
.hr-slot-neutral { background: var(--paper-3); color: var(--ink-2); }
.hr-slot-warn { background: var(--warn-wash); color: var(--warn); }
.hr-slot-wrong { background: var(--wrong-wash); color: var(--wrong); }

.hr-slot-break td {
  height: 14px;
  padding: 0;
  text-align: center;
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

.hr-slot-break span {
  display: inline-block;
  padding: 0 var(--s-2);
  background: var(--paper);
}

.hr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

.hr-legend-item { display: inline-flex; align-items: center; gap: var(--s-2); }

.hr-legend-item i {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
}

/* -----------------------------------------------------------------------------
   Account lanes. Phase 2. One row per account per day, classes drawn on a
   shared time axis so the shape of the day is readable at a glance.

   Accounts are identified by row position, never by colour. See the note at
   the top of views/occupancy.js.
   -------------------------------------------------------------------------- */

.hr-lanes { padding: var(--s-2) var(--s-4) var(--s-4); }

.hr-lane-day { padding: var(--s-4) 0; }

.hr-lane-day + .hr-lane-day { border-top: 1px solid var(--line); }

.hr-lane-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
  font-size: var(--fs-sm);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-2);
}

.hr-lane-day-peak {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-flat);
  text-transform: none;
  color: var(--ink-4);
}

.hr-lane-day-peak.is-over { color: var(--wrong); font-weight: 600; }

.hr-lane-ruler {
  position: relative;
  height: 14px;
  margin-left: 56px;
  border-bottom: 1px solid var(--line);
}

.hr-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
  white-space: nowrap;
}

.hr-lane {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.hr-lane-label { width: 48px; flex: none; }

.hr-lane-track {
  position: relative;
  flex: 1;
  height: 30px;
  background: var(--paper-2);
  border-radius: var(--r-xs);
}

.hr-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--s-2);
  min-width: 2px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.hr-block.is-tight-handover {
  border-left: 3px double var(--ink);
}

.hr-handover-warning {
  color: var(--ink-3);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.hr-block-code {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-block-time {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-block-blackout {
  background: var(--paper-2);
  border-style: dashed;
}

.hr-block-blackout .hr-block-code { color: var(--ink-4); font-weight: 400; }

.hr-lane-orphan .hr-lane-track { background: var(--wrong-wash); }

.hr-lane-orphan .hr-block {
  background: var(--wrong-wash);
  border-color: var(--wrong-line);
}

.hr-lane-orphan .hr-block-code { color: var(--wrong); }

/* -----------------------------------------------------------------------------
   Day groups and tables
   -------------------------------------------------------------------------- */

.hr-daygroup {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
}

.hr-daygroup + .hr-daygroup { margin-top: var(--s-4); }

.hr-daygroup-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-2);
}

.hr-daygroup-count {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-flat);
  text-transform: none;
  color: var(--ink-4);
}

.hr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.hr-table th {
  padding: var(--s-2) var(--s-4);
  text-align: left;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
}

.hr-table td {
  padding: var(--s-2) var(--s-4);
  vertical-align: top;
  color: var(--ink-2);
}

/* One hairline between rows, never top and bottom on every row. */
.hr-table tbody tr + tr td { border-top: 1px solid var(--line); }

.hr-row { transition: background-color var(--t-base) var(--ease); }

.hr-row:hover { background: var(--paper-2); }

.hr-row.is-unallocated { background: var(--wrong-wash); }

.hr-row.is-unallocated td { color: var(--ink); }

.hr-row.is-next { background: var(--paper-3); }

.hr-cell-time,
.hr-cell-day { white-space: nowrap; }

.hr-cell-time .hr-num,
.hr-cell-class .hr-code { display: block; color: var(--ink); }

.hr-cell-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

.hr-code { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tr-wide); }

.hr-cell-account { white-space: nowrap; }

/* -----------------------------------------------------------------------------
   ClassIn account badge.

   Identified by a mono label, not by colour. This scales past four accounts
   without inventing a fifth hue, and it survives colour blindness. The only
   place accounts are allowed a categorical tint is the occupancy grid, which
   is phase 2.
   -------------------------------------------------------------------------- */

.hr-badge {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px var(--s-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--paper-3);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  color: var(--ink);
  white-space: nowrap;
}

.hr-badge-sep { color: var(--ink-4); }

.hr-badge-empty {
  background: var(--wrong-wash);
  border-color: var(--wrong-line);
  color: var(--wrong);
  letter-spacing: var(--tr-flat);
}

/* -----------------------------------------------------------------------------
   Status pills
   -------------------------------------------------------------------------- */

.hr-pill {
  display: inline-block;
  padding: 1px var(--s-2);
  border: 1px solid var(--tone-line);
  border-radius: var(--r-full);
  background: var(--tone-wash);
  color: var(--tone);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Conflicts
   -------------------------------------------------------------------------- */

.hr-conflict-list { margin: 0; padding: 0; list-style: none; }

.hr-conflict {
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--tone-line);
}

.hr-conflict + .hr-conflict { border-top: 1px solid var(--line); }

.hr-conflict-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}

.hr-conflict-kind {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--tone);
}

.hr-conflict-when {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

.hr-conflict-who {
  margin-top: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}

.hr-conflict-msg {
  margin-top: var(--s-1);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.hr-conflict-meta {
  margin-top: var(--s-1);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

/* -----------------------------------------------------------------------------
   Teacher next-session card. The one piece of elevated furniture in the
   product, because it is the one thing that must be found in two seconds.
   -------------------------------------------------------------------------- */

.hr-next {
  margin-bottom: var(--s-5);
  padding: var(--s-5);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-1);
}

.hr-next-when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3);
}

.hr-next-day {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-3);
}

.hr-next-time {
  font-size: var(--fs-xl);
  letter-spacing: var(--tr-tight);
  color: var(--ink);
}

.hr-next-dur { font-size: var(--fs-xs); color: var(--ink-4); }

.hr-next-class {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  margin-top: var(--s-2);
  font-size: var(--fs-lg);
}

.hr-next-account {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.hr-next-account-label {
  display: block;
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-next-account-value {
  display: block;
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  color: var(--ink);
}

.hr-next-account.is-missing .hr-next-account-value { color: var(--wrong); }

.hr-next-account-note {
  display: block;
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

.hr-next-meta {
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--ink-4);
}

.hr-next-empty { text-align: left; }

/* -----------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.hr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hit-sm);
  padding: 0 var(--s-3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}

.hr-button:hover { background: var(--ink-2); }

.hr-button:active { transform: translateY(1px); }

.hr-button-quiet {
  background: var(--paper);
  border-color: var(--line-2);
  color: var(--ink);
  font-weight: 400;
}

.hr-button-quiet:hover { background: var(--paper-3); }

/* -----------------------------------------------------------------------------
   Phase 3: banners, tags, filters, publish diff
   -------------------------------------------------------------------------- */

.hr-banner {
  margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--tone-line);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--tone-wash);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}

.hr-strong { display: block; font-weight: 600; color: var(--ink); }

.hr-muted { color: var(--ink-4); }

.hr-over { color: var(--wrong); font-weight: 600; }

.hr-cell-num { white-space: nowrap; }

.hr-tag {
  display: inline-block;
  padding: 1px var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--paper-2);
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  white-space: nowrap;
}

.hr-row.is-clickable { cursor: pointer; }

.hr-table-wrap { overflow-x: auto; }

/* Payroll */
.hr-pay-period {
  display: grid;
  gap: var(--s-1);
  min-width: 11rem;
}

.hr-pay-period label,
.hr-pay-rule-controls label > span {
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.hr-pay-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.hr-pay-action-msg {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  min-height: 1.4em;
}

.hr-pay-issues {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--s-5);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--line);
}

.hr-pay-issue {
  background: var(--paper);
  min-height: 9.5rem;
  padding: var(--s-4);
}

.hr-pay-issue-head {
  align-items: center;
  display: flex;
  gap: var(--s-2);
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.hr-pay-issue h2,
.hr-pay-rule h3,
.hr-pay-public-rules h3 {
  font-size: var(--fs-sm);
  margin: 0;
}

.hr-pay-clear {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  margin: 0;
}

.hr-pay-issue-list {
  display: grid;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  max-height: 10rem;
  overflow: auto;
  padding: 0;
}

.hr-pay-issue-list li {
  display: grid;
  font-size: var(--fs-sm);
  gap: 0.125rem;
}

.hr-pay-issue-list span { color: var(--ink-3); font-size: var(--fs-xs); }
.hr-link-button { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-align: left; }
.hr-link-button:hover { text-decoration: underline; }

.hr-cell-note { color: var(--ink-3); display: block; font-size: var(--fs-xs); margin-top: 0.125rem; }
.hr-pay-table th:not(:first-child),
.hr-pay-table td:not(:first-child) { white-space: nowrap; }
.hr-pay-table,
.hr-pay-lines { min-width: 44rem; }

.hr-pay-slip-summary {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--s-4);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.hr-pay-slip-summary > div {
  background: var(--paper-2);
  display: grid;
  gap: var(--s-1);
  min-width: 0;
  padding: var(--s-3);
}

.hr-pay-slip-summary span { color: var(--ink-3); font-size: var(--fs-xs); }
.hr-pay-slip-summary strong { font-size: var(--fs-lg); }

.hr-pay-rules,
.hr-pay-public-rules,
.hr-pay-history-list { display: grid; gap: 1px; background: var(--line); }

.hr-pay-rule,
.hr-pay-public-rules article {
  align-items: center;
  background: var(--paper);
  display: flex;
  gap: var(--s-4);
  justify-content: space-between;
  padding: var(--s-3) 0;
}

.hr-pay-rule p,
.hr-pay-public-rules p { color: var(--ink-3); font-size: var(--fs-sm); margin: var(--s-1) 0 0; }
.hr-pay-rule-controls { align-items: end; display: flex; gap: var(--s-2); }
.hr-pay-rule-controls label { display: grid; gap: var(--s-1); }

.hr-pay-review { display: grid; gap: var(--s-2); margin: 0 0 var(--s-4); }
.hr-pay-review div { display: grid; grid-template-columns: 7rem 1fr; }
.hr-pay-review dt { color: var(--ink-3); }
.hr-pay-review dd { margin: 0; }
.hr-review-reject { margin-top: var(--s-3); }
.hr-pay-row-actions { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: flex-end; }

.hr-pay-history { background: var(--paper); }
.hr-pay-history summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr auto auto;
  padding: var(--s-3) 0;
}
.hr-pay-history-body { padding: var(--s-3) 0 var(--s-5); }

@media (max-width: 960px) {
  .hr-pay-issues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hr-pay-period { width: 100%; }
  .hr-pay-actions .hr-button { flex: 1 1 calc(50% - var(--s-2)); }
  .hr-pay-actions .hr-pill, .hr-pay-action-msg { flex-basis: 100%; }
  .hr-pay-issues { grid-template-columns: 1fr; }
  .hr-pay-issue { min-height: 0; }
  .hr-pay-slip-summary { grid-template-columns: 1fr; }
  .hr-pay-rule, .hr-pay-public-rules article { align-items: stretch; flex-direction: column; }
  .hr-pay-rule-controls { align-items: stretch; flex-direction: column; width: 100%; }
  .hr-pay-history summary { grid-template-columns: 1fr auto; }
  .hr-pay-history summary strong { grid-column: 1 / -1; }
}

.hr-badge.is-pinned { border-style: dashed; }

.hr-badge-pin {
  margin-left: var(--s-1);
  font-size: var(--fs-2xs);
  font-weight: 400;
  letter-spacing: var(--tr-flat);
  color: var(--ink-4);
}

.hr-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}

.hr-filter { display: flex; flex-direction: column; gap: var(--s-1); }

.hr-filter-label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-filter-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

.hr-publish {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding: var(--s-4);
  border: 1px solid var(--tone-line);
  border-radius: var(--r-md);
  background: var(--tone-wash);
}

.hr-publish-title { margin: 0; font-size: var(--fs-base); font-weight: 600; color: var(--ink); }

.hr-publish-note { margin: var(--s-1) 0 0; font-size: var(--fs-sm); color: var(--ink-2); }

.hr-diff-list {
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}

.hr-diff-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  padding: var(--s-1) 0;
}

.hr-diff-list li + li { border-top: 1px solid var(--tone-line); }

.hr-diff-where { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-3); }

.hr-diff-move { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink); }

.hr-diff-move s { color: var(--ink-4); }

/* -----------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

body.has-modal { overflow: hidden; }

.hr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--s-6) var(--s-4);
  overflow-y: auto;
  background: var(--backdrop);
}

.hr-modal {
  width: 100%;
  max-width: 480px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-3);
}

.hr-modal-lg { max-width: 640px; }

.hr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--line);
}

.hr-modal-title { font-size: var(--fs-lg); }

.hr-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--hit-sm);
  height: var(--hit-sm);
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-3);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease);
}

.hr-modal-close:hover { background: var(--paper-3); color: var(--ink); }

.hr-modal-body { padding: var(--s-4); }

.hr-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4);
  border-top: 1px solid var(--line);
}

.hr-modal-foot-msg { font-size: var(--fs-sm); color: var(--tone, var(--ink-3)); }

.hr-modal-foot-actions { display: flex; gap: var(--s-2); margin-left: auto; }

.hr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

.hr-field-msg { margin: 0; min-height: 1em; font-size: var(--fs-xs); color: var(--wrong); }

.hr-input[aria-invalid="true"] { border-color: var(--wrong); }

.hr-readonly {
  margin: 0;
  padding: var(--s-2) 0;
  font-size: var(--fs-md);
  color: var(--ink-2);
}

.hr-divider { margin: var(--s-4) 0; border: 0; border-top: 1px solid var(--line); }

.hr-check-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.hr-check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }

.hr-pattern-row { padding: var(--s-2) 0; }

.hr-pattern-row + .hr-pattern-row { border-top: 1px solid var(--line); }

.hr-pattern-cells { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2); }

.hr-pattern-cell { display: flex; flex-direction: column; gap: var(--s-1); }

.hr-pattern-cell .hr-input { min-height: var(--hit-sm); }

.hr-pattern-label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-pattern-end {
  flex: 1;
  padding-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
}

.hr-pattern-add { margin-top: var(--s-3); }

.hr-icon-button {
  width: var(--hit-sm);
  height: var(--hit-sm);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-3);
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

.hr-icon-button:hover { background: var(--paper-3); color: var(--ink); }

/* -----------------------------------------------------------------------------
   Phase 4 and 5: availability grid, matrix, roll, class cards

   The three preference levels are carried by FILL DENSITY on one hue, not by
   three different hues. They are ordered (ưu tiên beats rảnh beats nếu cần), so
   a sequential ramp is the honest encoding, and it leaves the state colours
   free to keep meaning what they mean everywhere else in the product.
   -------------------------------------------------------------------------- */

.hr-av-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}

.hr-av-mode {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--hit-sm);
  padding: 0 var(--s-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.hr-av-mode:has(input:checked) { background: var(--paper-3); border-color: var(--ink-3); font-weight: 600; }

.hr-av-hint { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-4); }

.hr-av-grid-wrap { overflow-x: auto; padding: var(--s-3) var(--s-4); }

.hr-av-grid { width: 100%; border-collapse: collapse; }

.hr-av-grid thead th {
  padding-bottom: var(--s-2);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-av-time {
  width: 48px;
  padding-right: var(--s-2);
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: var(--ink-4);
  vertical-align: top;
}

.hr-av-cell {
  height: 18px;
  border: 1px solid var(--paper);
  background: var(--paper-2);
  cursor: pointer;
  touch-action: none;
  transition: background-color var(--t-fast) var(--ease);
}

.hr-av-cell:hover { background: var(--paper-3); }

.hr-av-cell.is-preferred,
.hr-av-chip.is-preferred,
.hr-matrix-cell.is-preferred { background: var(--level-4); }

.hr-av-cell.is-available,
.hr-av-chip.is-available,
.hr-matrix-cell.is-available { background: var(--level-3); }

.hr-av-cell.is-if_needed,
.hr-av-chip.is-if_needed,
.hr-matrix-cell.is-if_needed { background: var(--level-2); }

.hr-av-chip.is-preferred,
.hr-av-chip.is-available { color: var(--paper); }

.hr-av-days { display: none; padding: var(--s-3) var(--s-4); }

.hr-av-day { border-bottom: 1px solid var(--line); }

.hr-av-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--hit);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
}

.hr-av-day-count { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-4); }

.hr-av-day-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-1);
  padding: var(--s-2) 0 var(--s-4);
}

.hr-av-chip {
  min-height: var(--hit-sm);
  padding: 0 var(--s-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  cursor: pointer;
  touch-action: none;
}

.hr-av-meta {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-4);
}

.hr-av-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--line);
}

.hr-av-status { margin-right: auto; font-size: var(--fs-sm); color: var(--ink-3); }

/* -- roll ---------------------------------------------------------------- */

.hr-roll {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  padding: 0 var(--s-4) var(--s-4);
}

.hr-roll-title {
  margin-bottom: var(--s-2);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--tone);
}

.hr-roll-list { margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }

.hr-roll-list li { padding: var(--s-1) 0; }

.hr-roll-list li + li { border-top: 1px solid var(--line); }

.hr-roll-meta { display: block; font-size: var(--fs-2xs); color: var(--ink-4); }

.hr-chase { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }

.hr-chase-note { margin: 0 0 var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); }

.hr-chase-text { width: 100%; margin-bottom: var(--s-2); font-size: var(--fs-sm); resize: vertical; }

.hr-chase-done { margin-left: var(--s-2); font-size: var(--fs-sm); color: var(--ok); }

/* -- matrix -------------------------------------------------------------- */

.hr-matrix-wrap { padding: var(--s-3) var(--s-4); overflow-x: auto; }

.hr-matrix-person { display: flex; gap: var(--s-4); padding: var(--s-3) 0; }

.hr-matrix-person + .hr-matrix-person { border-top: 1px solid var(--line); }

.hr-matrix-name { width: 180px; flex: none; font-size: var(--fs-sm); }

.hr-matrix { border-collapse: collapse; }

.hr-matrix-day {
  padding-right: var(--s-2);
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: var(--ink-4);
}

.hr-matrix-cell {
  width: 9px;
  height: 11px;
  border: 1px solid var(--paper);
  background: var(--paper-2);
}

.hr-legend-item i.hr-matrix-cell { width: 16px; height: 12px; border-radius: var(--r-xs); }

/* -- mismatches and cover ------------------------------------------------ */

.hr-mismatch-list { margin: 0; padding: 0; list-style: none; }

.hr-mismatch { padding: var(--s-3) var(--s-4); }

.hr-mismatch + .hr-mismatch { border-top: 1px solid var(--line); }

.hr-mismatch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
}

.hr-mismatch-when { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-4); }

.hr-mismatch-body { margin: var(--s-1) 0 var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); }

.hr-cover { padding: var(--s-2) var(--s-3); background: var(--paper-2); border-radius: var(--r-sm); }

.hr-cover-label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-cover-list { margin: var(--s-1) 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); }

.hr-cover-list li { padding: var(--s-1) 0; }

.hr-cover-meta { display: block; font-size: var(--fs-2xs); color: var(--ink-4); }

.hr-cover-warn { color: var(--warn); }

.hr-cover-none { margin: 0; font-size: var(--fs-sm); color: var(--ink-4); }

/* -- leave and cover requests ------------------------------------------- */

.hr-request-actions {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.hr-request-list { margin: 0; padding: 0; list-style: none; }

.hr-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4);
}

.hr-request-item + .hr-request-item { border-top: 1px solid var(--line); }
.hr-request-main { min-width: 0; }
.hr-request-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.hr-request-kind { font-size: var(--fs-xs); color: var(--ink-3); }
.hr-request-when { margin-top: var(--s-1); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.hr-request-reason { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.hr-request-review-actions { display: flex; flex: none; gap: var(--s-2); }

/* -- reports ------------------------------------------------------------- */

.hr-report-answer {
  margin: 0;
  padding: var(--s-4);
  border-bottom: 1px solid var(--tone-line);
  background: var(--tone-wash);
  font-size: var(--fs-sm);
  color: var(--tone);
}

/* -- teacher class cards ------------------------------------------------- */

.hr-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-4);
}

.hr-class-card {
  padding: var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.hr-class-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}

.hr-class-title { margin-top: var(--s-1); font-size: var(--fs-base); }

.hr-class-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin: var(--s-3) 0;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hr-class-facts dt {
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-4);
}

.hr-class-facts dd { margin: 0; font-size: var(--fs-sm); color: var(--ink); }

.hr-class-slots { margin: var(--s-2) 0 0; padding: 0; list-style: none; }

.hr-class-slots li { padding: var(--s-1) 0; font-size: var(--fs-sm); }

.hr-class-term { margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }

/* -----------------------------------------------------------------------------
   Empty, loading, error. Every screen ships all three.
   -------------------------------------------------------------------------- */

.hr-empty { padding: var(--s-6) var(--s-4); }

.hr-empty-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
}

.hr-empty-body {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: var(--measure);
}

.hr-skeleton {
  background: var(--paper-3);
  border-radius: var(--r-sm);
}

.hr-skeleton-title { width: 220px; height: 28px; }
.hr-skeleton-value { width: 72px; height: 30px; margin: var(--s-1) 0; }
.hr-skeleton-line { width: 160px; height: 12px; margin-top: var(--s-2); }
.hr-skeleton-short { width: 88px; }
.hr-skeleton-row { height: 36px; margin: var(--s-2) var(--s-4); }

/* Functional, not decorative: it reports that work is in progress. */
@media (prefers-reduced-motion: no-preference) {
  .hr-skeleton { animation: hr-pulse 1.1s var(--ease) infinite alternate; }
}

@keyframes hr-pulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}

.hr-error { padding: var(--s-5) var(--s-4); }

.hr-error-msg {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--wrong);
}

.hr-error-hint {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.hr-error-actions { display: flex; gap: var(--s-2); margin-top: var(--s-4); }

/* -----------------------------------------------------------------------------
   Responsive. Every multi-column layout declares its collapse here.
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .hr-columns { grid-template-columns: minmax(0, 1fr); }
  .hr-col-side { position: static; }
}

@media (max-width: 1023px) {
  .hr-body { grid-template-columns: minmax(0, 1fr); }

  .hr-nav {
    position: static;
    min-height: 0;
    padding: var(--s-3) var(--s-4);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--s-5);
    overflow-x: auto;
  }

  .hr-nav-group + .hr-nav-group { margin-top: 0; }
  .hr-nav-list { display: flex; gap: var(--s-1); }
  .hr-nav-item { white-space: nowrap; }
  .hr-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .hr-attendance-bulk,
  .hr-attendance-bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-attendance-bulk-actions .hr-filter { width: 100%; }

  .hr-topbar { flex-wrap: wrap; gap: var(--s-2); padding: var(--s-2) var(--s-4); }
  .hr-identity-label { display: none; }
  .hr-main { padding: var(--s-4); }
  .hr-page-head { align-items: flex-start; }
  .hr-page-title { font-size: var(--fs-xl); }
  .hr-week-nav { width: 100%; }
  .hr-week-nav .hr-button { flex: 1; }
  .hr-stat-strip,
  .hr-stat-strip-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
  .hr-next { padding: var(--s-4); }
  .hr-next-account-value { font-size: var(--fs-xl); }
  .hr-panel { overflow-x: auto; }

  .hr-table-week,
  .hr-table-week tbody {
    display: block;
    width: 100%;
  }

  .hr-table-week thead { display: none; }

  .hr-table-week .hr-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1.3fr);
    gap: var(--s-2) var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
  }

  .hr-table-week .hr-row:last-child { border-bottom: 0; }

  .hr-table-week .hr-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .hr-table-week .hr-cell-class,
  .hr-table-week .hr-cell-account,
  .hr-table-week .hr-row > td:last-child {
    grid-column: 1 / -1;
  }

  .hr-table-week .hr-handover-warning {
    margin-top: var(--s-2);
    white-space: normal;
  }

  /* A seven column grid cannot be hit accurately with a thumb, so the
     availability screen becomes a day by day accordion instead. */
  .hr-av-grid-wrap { display: none; }
  .hr-av-days { display: block; }
  .hr-av-meta { grid-template-columns: minmax(0, 1fr); }
  .hr-av-actions .hr-button { flex: 1; }
  .hr-av-status { width: 100%; margin-bottom: var(--s-2); }

  .hr-roll { grid-template-columns: minmax(0, 1fr); }
  .hr-matrix-person { flex-direction: column; gap: var(--s-2); }
  .hr-matrix-name { width: auto; }
  .hr-field-row { grid-template-columns: minmax(0, 1fr); }
  .hr-class-grid { grid-template-columns: minmax(0, 1fr); }
  .hr-request-item { align-items: stretch; flex-direction: column; }
  .hr-request-review-actions .hr-button { flex: 1; }
}

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