/* ==========================================================================
   Shared components - buttons, forms, tables, cards, status, alerts, modals
   ==========================================================================

   Every selector here is a class the application ALREADY uses. Phase B
   standardises how these components look, not what they are called: the
   JavaScript assigns `.btn btn-primary`, `.data-table`, `.status-pill
   status-good`, `.form-field`, `.cohort-table` and others directly, so
   renaming them would break behaviour for a cosmetic gain.

   New roles the system was missing (tertiary, destructive, warning,
   icon-only, loading, compact table action, the full form-state set,
   alerts, page headers) are added as modifiers alongside them.

   Load order: this file sits BEFORE main.css, so any page-specific rule
   still wins. Sections that moved here were DELETED from main.css - no
   component is defined twice, and no `!important` is used to force
   adoption.
   ========================================================================== */

/* ==========================================================================
   1. PAGE HEADER
   One pattern: title, subtitle, metadata, actions, filters. Stacks below
   the md breakpoint instead of letting actions crush the title.
   ========================================================================== */

/* BUILD 1. Both approved renderings open a page the same way: a large
   bold title, one line of supporting copy beneath it, and the page actions
   on the right of the same band. The actions align to the TITLE's baseline
   rather than the block's top, which is what stops a two-line subtitle
   dragging them out of line with the heading they belong to. */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5) var(--space-7);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.page-header-text {
  min-width: 0;
}

.page-header h1 {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
  font-size: var(--type-display-size);
  line-height: var(--type-display-line);
  font-weight: var(--type-display-weight);
  letter-spacing: var(--type-display-tracking);
  color: var(--brand-primary);
}

.page-header-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-body-size);
}

.page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-3);
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.page-header-meta strong {
  color: var(--text-secondary);
  font-weight: var(--font-weight-label);
}

/* Existing hero pattern, aligned to the same rhythm. */
.hero h1 {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
}

.hero p {
  margin: 0 0 var(--space-8);
  font-size: var(--type-body-size);
  color: var(--text-muted);
}

.hero-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .page-header,
  .hero-with-action {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions .btn {
    flex: 1 1 auto;
  }
}

/* ==========================================================================
   2. BUTTONS
   Nine roles. Every one has hover, active, focus, disabled; all reach the
   44px touch minimum via min-height.
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

/* Primary - the brand anchor. White on #1D4484 measures 9.49:1. */
.btn-primary {
  background: var(--brand-primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
}

.btn-primary:active {
  background: var(--brand-primary-active);
}

/* Secondary - outlined. Uses --border-strong (3.24:1) rather than the
   decorative border, because the border IS the control here. */
.btn-secondary {
  background: var(--surface-default);
  border-color: var(--border-strong);
  color: var(--brand-primary);
}

.btn-secondary:hover {
  background: var(--brand-primary-subtle);
  border-color: var(--brand-primary);
}

.btn-secondary:active {
  background: var(--brand-light-surface);
}

/* Tertiary - text only, for low-emphasis actions beside a primary. */
.btn-tertiary {
  background: none;
  border-color: transparent;
  color: var(--brand-primary);
  padding-inline: var(--space-3);
}

.btn-tertiary:hover {
  background: var(--brand-primary-subtle);
  text-decoration: underline;
}

/* Destructive - Cherry Limeade. White on it measures 4.63:1. Reserved for
   actions that delete or cannot be undone; never an ordinary save. */
.btn-destructive {
  background: var(--status-danger-strong);
  color: var(--text-inverse);
}

.btn-destructive:hover {
  background: var(--status-danger-strong-hover);
}

.btn-destructive:active {
  background: var(--status-danger-strong-active);
}

/* Warning - amber surface with brand text (6.13:1). For actions that are
   reversible but consequential, e.g. re-running an import. */
.btn-warning {
  background: var(--status-warning-surface);
  border-color: var(--status-warning-text);
  color: var(--brand-primary);
}

.btn-warning:hover {
  background: var(--status-warning-surface-hover);
}

/* Icon-only - square, and REQUIRES an aria-label in markup. The rule
   cannot enforce that, so it is stated wherever the class is used. */
.btn-icon {
  min-width: 40px;
  padding: var(--space-3);
}

/* Loading - keeps its label (never replaced by a bare spinner, which
   destroys the accessible name) and blocks interaction. */
.btn[aria-busy="true"] {
  opacity: 0.75;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--disabled-surface);
  border-color: transparent;
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* Compact action for use inside table rows, where 40px would bloat the
   row. Still 32px, still focusable, still labelled. */
.btn-compact {
  min-height: 32px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--type-caption-size);
}

.btn-lg {
  min-height: 48px;
  padding: var(--space-4) var(--space-7);
  font-size: var(--type-body-size);
  border-radius: var(--radius-lg);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   3. FORMS
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

/* A field that spans the whole form rather than one of the three columns.
   For the one case where a column-width control is the wrong shape: a
   multi-line notes box reads as a narrow ribbon in a third of the grid.
   Collapses with the grid itself below the md breakpoint, where every
   field is already full width. */
.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
}

/* Inputs use --border-strong (3.24:1). The old decorative border measured
   1.22:1, which cannot satisfy WCAG 1.4.11 for a UI component. */
.form-field input,
.form-field select,
.form-field textarea,
.filters-bar select,
.search-input {
  padding: var(--space-3) var(--space-4);
  min-height: var(--control-height);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: var(--type-body-sm-size);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-default);
  transition: border-color var(--motion-fast) var(--motion-ease);
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: var(--brand-primary-muted);
}

.form-field textarea {
  min-height: 96px;
  resize: vertical;
}

.form-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  align-self: flex-start;
  accent-color: var(--brand-primary);
}

.form-field input[type="radio"] {
  accent-color: var(--brand-primary);
}

/* Required: the asterisk is decorative and hidden from assistive tech -
   the accessible requirement comes from the `required` attribute, not the
   glyph. */
.form-field label .required-marker {
  color: var(--status-danger-text);
  margin-left: 2px;
}

.form-field-helper {
  font-size: var(--type-helper-size);
  color: var(--text-muted);
}

/* Validation. Colour is never the only signal - the message text is
   always present, and aria-invalid carries it to assistive tech. */
.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"],
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--status-danger-text);
  background: var(--status-danger-surface-safe);
}

.form-error {
  color: var(--status-danger-text);
  font-size: var(--type-helper-size);
  font-weight: var(--font-weight-label);
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
  background: var(--disabled-surface);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.form-field input[readonly],
.form-field textarea[readonly] {
  background: var(--surface-sunken);
  border-color: var(--border-default);
}

.field-value {
  font-size: var(--type-body-size);
  padding: var(--space-3) 0;
}

.input-narrow {
  width: 90px;
}

.mt-spaced {
  margin-top: var(--space-4);
}

/* Validation summary - an error list at the top of a form, each entry
   linking to its field. */
.form-error-summary {
  border: 1px solid var(--status-danger-text);
  background: var(--status-danger-surface-safe);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.form-error-summary h2 {
  font-size: var(--type-card-title-size);
  color: var(--status-danger-text);
  margin: 0 0 var(--space-3);
}

.form-error-summary ul {
  margin: 0;
  padding-left: var(--space-6);
}

/* --------------------------------------------------------- filters bar */

/* BUILD 1. The Directory rendering groups search and filters into one
   bounded band above the table rather than leaving them loose on the page.
   Frosted is approved for a filter container; the controls inside it stay
   opaque, because they are editable. */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--surface-frosted);
  border: 1px solid var(--surface-frosted-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-control);
  backdrop-filter: blur(var(--frost-blur));
}

@supports not (backdrop-filter: blur(1px)) {
  .filters-bar {
    background: var(--surface-frosted-opaque);
  }
}

.search-input {
  flex: 1 1 240px;
  min-width: 200px;
}

/* When the bar stacks, `flex: 1 1 240px` grows along the COLUMN - which is
   the height - and the search field inflates to fill whatever the tallest
   sibling leaves. The row basis is right in a row and wrong in a column,
   so it is reset where the direction changes.

   `min-width` goes too: a 200px floor inside a 430px viewport that has
   already spent 32px on gutters is what pushes the bar past the edge.
   Build 1 found this by rendering the page at 430px rather than by
   reading the rule. */
@media (max-width: 768px) {
  .filters-bar > * {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
  }
}

/* Inline cell editing - one value, edited on the row it belongs to.
   Used by the weekly High Fives column, which was previously edited from a
   separate control above the table with its own week selector. */

.high-fives-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.high-fives-cell .input-narrow {
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
}

.high-fives-status {
  font-size: var(--type-caption-size);
  color: var(--text-muted);
  white-space: normal;
}

.high-fives-status.is-error {
  color: var(--status-danger-text);
  font-weight: var(--font-weight-label);
}

/* ==========================================================================
   4. TABLES
   ========================================================================== */

.table-card {
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  /* The containing block for the table's .sr-only labels (position:
     absolute), so they scroll with the table instead of widening the page. */
  position: relative;
}

.data-table,
.cohort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-table-body-size);
  line-height: var(--type-table-body-line);
}

.data-table th,
.cohort-table th {
  text-align: left;
  font-size: var(--type-table-header-size);
  font-weight: var(--type-table-header-weight);
  text-transform: uppercase;
  letter-spacing: var(--type-table-header-tracking);
  color: var(--text-secondary);
  background: var(--brand-primary-subtle);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td,
.cohort-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

/* The drill-down modal's table is denser - it sits inside a constrained
   panel rather than a full-width card. */
.cohort-table th,
.cohort-table td {
  padding: var(--space-3) var(--space-3);
}

.data-table tbody tr:last-child td,
.cohort-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover,
.cohort-table tbody tr:hover {
  background: var(--brand-primary-subtle);
}

/* Selected row carries a left rule as well as a tint. */
.data-table tbody tr[aria-selected="true"],
.data-table tbody tr.selected {
  background: var(--brand-light-surface);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.clickable-row {
  cursor: pointer;
}

/* Sticky header for long datasets. The table container scrolls, the
   header stays. */
.table-card--sticky {
  max-height: 70vh;
  overflow-y: auto;
}

.table-card--sticky .data-table th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

/* Sortable headers are buttons in markup; aria-sort carries the state. */
.data-table th[aria-sort] {
  cursor: pointer;
}

.data-table th[aria-sort="ascending"]::after,
.cohort-table th[aria-sort="ascending"]::after {
  content: " \2191";
}

.data-table th[aria-sort="descending"]::after,
.cohort-table th[aria-sort="descending"]::after {
  content: " \2193";
}

/* Density modifier for dense operational tables. */
.data-table--compact th,
.data-table--compact td {
  padding: var(--space-3) var(--space-4);
}

/* Totals / summary rows. */
.data-table tfoot td,
.data-table tr.is-total td,
.data-table tr.is-summary td {
  font-weight: var(--font-weight-subhead);
  border-top: 2px solid var(--border-strong);
  background: var(--surface-sunken);
}

.data-table-empty {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--text-muted);
}

/* Numeric columns align right and share figure widths. */
.data-table .num,
.cohort-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Below md the table scrolls horizontally inside its card rather than
   hiding columns. HR data must stay comparable across columns, and a
   card-per-row transform destroys that; no value is ever hidden. */
@media (max-width: 768px) {
  .table-card {
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================================================
   5. CARDS AND SURFACES
   White working surfaces; dark blue provides hierarchy rather than fill.
   Shadows are restrained - no glassmorphism, no gradients on cards.
   ========================================================================== */

/* .chart-card is deliberately absent: it belongs to the report family and
   is defined once, in reports.css. */
.card,
.tile {
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card {
  padding: var(--space-6) var(--space-7);
}

.card-title {
  font-size: var(--type-card-title-size);
  font-weight: var(--type-card-title-weight);
  margin: 0 0 var(--space-3);
}

/* -------- home tiles -------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-10);
}

.tile {
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}

.tile:hover {
  box-shadow: var(--shadow-menu);
  border-color: var(--brand-primary);
}

.tile-label {
  font-size: var(--type-metric-label-size);
  color: var(--text-muted);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--type-metric-label-tracking);
}

.tile-value {
  font-size: var(--type-metric-value-size);
  line-height: var(--type-metric-value-line);
  font-weight: var(--type-metric-value-weight);
  color: var(--brand-primary);
}

/* A tile that is also a filter. The Interviews cards each name a question
   somebody wants to ACT on - reading "Pending feedback: 7" and then hunting
   the filter bar for those seven is a worse page - so they are buttons.
   Rendered as a button element so they are keyboard-reachable and announced
   as controls; these rules only undo the browser's button chrome, because
   the tile's own look is already correct. */
.tile-action {
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.tile-action[aria-pressed="true"] {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-menu);
}

/* The applied card is marked by its border AND by aria-pressed, never by
   colour alone. */
.tile-note {
  font-size: var(--type-caption-size, var(--type-body-size));
  color: var(--text-muted);
}

/* The caption drawn INTO an exported chart image.
   Present only for the instant html2canvas is rasterising - it is inserted
   before the capture and removed after - so it never appears on screen.
   Styled for a projector rather than a browser: large enough to read from
   the back of a room, and on white because that is the export's
   background. */
.chart-export-caption {
  padding: 0 0 12px;
  border-bottom: 2px solid var(--brand-primary);
  margin-bottom: 12px;
}

.chart-export-caption p {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 15px;
}

.chart-export-caption p:first-child {
  font-size: 22px;
  font-weight: var(--font-weight-subhead);
  color: var(--brand-primary);
}

.chart-export-caption p:not(:first-child) {
  font-size: 13px;
  color: var(--text-muted);
}

/* A labelled control in the filter bar - a date input needs its label
   visible, unlike the selects, whose first option names them. Stacked so
   the label does not push the control out of the row's alignment. */
.filter-field {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1, 2px);
  min-width: 0;
}

.filter-field > span {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
}

/* A checkbox that sits in the filter bar beside the selects, aligned with
   them rather than baseline-floating above them. */
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tile-value.coming-soon {
  font-size: var(--type-body-size);
  font-weight: var(--font-weight-label);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
}

/* -------- Home workspace cards --------
   One card per workspace the viewer can reach, and nothing else on the page.
   Each card is a single link - the whole surface opens the workspace's first
   permitted page - so there is exactly one action per card and no nested
   list of pages competing with it.

   Equal weight by construction: every card is the same component in the
   same grid track, three across at most, two at intermediate widths and one
   on small screens. The icon tile, the title and the "Open" affordance sit
   on a fixed rhythm so a two-word description and a twelve-word one still
   align their actions along the bottom. */

.workspace-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.workspace-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: var(--space-4) var(--space-5);
  min-height: 10rem;
  padding: var(--space-6);
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  text-decoration: none;
  transition: box-shadow var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}

.workspace-card:hover {
  box-shadow: var(--shadow-menu);
  border-color: var(--brand-primary);
}

.workspace-card:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.workspace-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--brand-primary-surface);
  color: var(--brand-primary);
}

/* The sidebar's own glyphs, recoloured for a light surface. */
.workspace-card-icon .nav-icon {
  grid-column: auto;
  width: 22px;
  height: 22px;
  color: inherit;
}

.workspace-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.workspace-card-title {
  font-size: var(--type-card-title-size);
  line-height: var(--type-card-title-line);
  font-weight: var(--font-weight-headline);
  color: var(--brand-primary);
}

.workspace-card-description {
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-line);
  color: var(--text-secondary);
}

.workspace-card-action {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  color: var(--link-default);
}

.workspace-card-arrow {
  transition: transform var(--motion-fast) var(--motion-ease);
}

.workspace-card:hover .workspace-card-arrow {
  transform: translateX(3px);
}

@media (max-width: 1100px) {
  .workspace-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-card-arrow {
    transition: none;
  }
}

/* A small uppercase group label inside a section ("Filters", "Columns").
   Named for the Home quick-nav it first served; the Report Builder still
   uses it. */
.quicknav-group {
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--type-metric-label-tracking);
  color: var(--text-secondary);
  margin: var(--space-6) 0 var(--space-4);
}

.quicknav-group:first-of-type {
  margin-top: 0;
}


/* -------- warning / empty-state cards -------- */

.card--warning {
  border-left: 3px solid var(--status-warning-text);
  background: var(--surface-default);
}

.card--empty,
.empty-state {
  padding: var(--space-9) var(--space-7);
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-default);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state h2,
.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   6. STATUS
   Every status carries a surface, a text colour AND a glyph, so meaning
   never depends on colour alone. The glyph is inserted by CSS because the
   existing markup is `.status-pill status-good` with a text label already
   inside it - the label remains the accessible name.
   ========================================================================== */

.status-pill,
.cohort-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-subhead);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--status-neutral-surface);
  color: var(--status-neutral-text);
}

.status-pill.status-good,
.cohort-status.retained {
  background: var(--status-success-surface);
  color: var(--brand-primary);
}

.status-pill.status-good::before,
.cohort-status.retained::before {
  content: "\2713";
}

.status-pill.status-caution {
  background: var(--status-warning-surface);
  color: var(--brand-primary);
}

.status-pill.status-caution::before {
  content: "\25B2";
}

.status-pill.status-concern,
.cohort-status.departed {
  background: var(--status-danger-surface-safe);
  color: var(--status-danger-text);
}

.status-pill.status-concern::before,
.cohort-status.departed::before {
  content: "\2715";
}

/* UX Refresh req 8: the EMPLOYEE status label carries no icon.
   "Active" lost its check mark and "Terminated" lost its X.

   A modifier rather than deleting the glyph from .status-good and
   .status-concern outright, because those two classes are shared: the
   Automation surface uses them for "Enabled" and "Failed", and the export
   builder for a blocked column. Removing the glyph globally would have
   changed three unrelated surfaces to satisfy a requirement about one.

   Colour is still not the only cue - the WORD is. "Active" and "Terminated"
   are rendered as text inside the pill, which is what WCAG 1.4.1 asks for;
   the glyph was a second belt, not the only one. */
.status-pill.status-plain::before {
  content: none;
}

.status-pill.status-info {
  background: var(--status-info-surface);
  color: var(--brand-primary);
}

.status-pill.status-info::before {
  content: "i";
  font-style: italic;
}

.status-pill.status-pending {
  background: var(--status-pending-surface);
  color: var(--brand-primary);
}

.status-pill.status-pending::before {
  content: "\25CB";
}

.status-pill.status-complete {
  background: var(--status-success-surface);
  color: var(--brand-primary);
}

.status-pill.status-complete::before {
  content: "\2713";
}

.status-pill.status-inactive,
.status-pill.status-archived {
  background: var(--status-neutral-surface);
  color: var(--status-neutral-text);
}

.status-pill.status-inactive::before {
  content: "\25CB";
}

.status-pill.status-archived::before {
  content: "\25A1";
}

/* ==========================================================================
   7. ALERTS AND FEEDBACK
   ========================================================================== */

.alert {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-primary);
  background: var(--status-info-surface);
  color: var(--brand-primary);
  margin-bottom: var(--space-6);
}

.alert-title {
  font-weight: var(--font-weight-subhead);
  margin: 0 0 var(--space-2);
}

.alert p {
  margin: 0;
}

.alert--success {
  background: var(--status-success-surface);
  border-left-color: var(--status-success-text);
}

.alert--warning {
  background: var(--status-warning-surface);
  border-left-color: var(--status-warning-text);
}

.alert--error {
  background: var(--status-danger-surface-safe);
  border-left-color: var(--status-danger-text);
  color: var(--status-danger-text);
}

.alert--info {
  background: var(--status-info-surface);
  border-left-color: var(--brand-primary);
}

/* Loading and no-results. Skeletons shimmer only when motion is allowed -
   the guard in base.css neutralises the animation otherwise. */
.skeleton {
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  min-height: 1em;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.55;
  }
}

.is-loading {
  color: var(--text-muted);
  font-size: var(--type-body-sm-size);
}

/* ==========================================================================
   8. MODALS
   The existing markup and JavaScript are unchanged - .modal-backdrop,
   .modal, .modal-header, .modal-body, .modal-close, .modal-wide and the
   [hidden] toggle all keep working exactly as they did.
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-5);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--surface-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-wide {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-default);
}

.modal-header h2 {
  margin: 0;
  font-size: var(--type-card-title-size);
  font-weight: var(--font-weight-subhead);
  color: var(--brand-primary);
}

/* 44px target, and the × is decorative - aria-label carries the name. */
.modal-close {
  background: none;
  border: none;
  font-size: var(--type-section-size);
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
}

.modal-close:hover {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
}

.modal-body {
  padding: var(--space-4) var(--space-7) var(--space-7);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-7);
  border-top: 1px solid var(--border-default);
}

.modal-summary {
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

/* Full-height sheet on small screens so a long form is usable. */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal,
  .modal-wide {
    max-width: none;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ==========================================================================
   9. RESPONSIVE GRIDS
   ========================================================================== */

@media (max-width: 960px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tile-grid {
    grid-template-columns: 1fr;
  }
}


/* Label/value facts about one thing. Same reasoning as .modal-summary-facts,
   which this deliberately mirrors rather than reuses - that one is sized for
   a modal. */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0;
  font-size: var(--type-body-sm-size);
}

.detail-grid dt {
  color: var(--text-muted);
  font-weight: var(--font-weight-label);
}

.detail-grid dd {
  margin: 0;
  color: var(--text-primary);
}

/* Shown before every action, so an operator never has to remember which rule
   they clicked. */
.action-context {
  border-left: 3px solid var(--border-strong);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0;
  background: var(--surface-sunken);
}


.report-eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--type-caption-size);
}

/* ---------------------------------------------------------------------------
   Coming-soon destinations (Phase B)

   Three destinations - /hr/15five, /recruiting and /tools - are placeholder
   pages. Navigation now says so before the click rather than after it.

   The marker is a WORD, not a colour or an opacity change. A muted link is
   ambiguous (disabled? visited? unavailable to me?) and is invisible to
   anyone who cannot distinguish the two greys. "Coming soon" is unambiguous
   at any contrast, and survives forced-colors mode, which is why the reduced
   opacity below is a secondary cue and never the only one.
   --------------------------------------------------------------------------- */

.nav-status {
  display: inline-block;
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-label);
  letter-spacing: 0.02em;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--status-neutral-surface);
  color: var(--status-neutral-text);
  white-space: nowrap;
}

/* The sidebar is dense, so its marker is the smaller of the two. */
.nav-item.nav-coming-soon .nav-status,
.nav-subitem.nav-coming-soon .nav-status {
  font-size: calc(var(--type-caption-size) * 0.9);
}


@media (forced-colors: active) {
  /* The pill's background is dropped in forced-colors mode; the word is what
     carries the meaning, so give it a border to keep it legible as a unit. */
  .nav-status {
    border: 1px solid currentColor;
  }
}


/* A past pay period is still a live link - it is dimmed, not disabled. */
.data-table tbody tr.is-past td {
  color: var(--text-muted);
}

/* The employee picker on the payroll note form.

   It is a listbox of buttons under a text input, not a <datalist>: the
   options are fetched as somebody types and each one has to carry an id the
   form submits, which a datalist's string value cannot do. It is positioned
   in flow rather than absolutely, so it pushes the form down instead of
   covering the field below it - on a short form that is the less surprising
   behaviour and it needs no collision handling. */

.employee-picker-results {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-default);
}

.employee-picker-option {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 0;
  background: none;
  font: inherit;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.employee-picker-option:hover,
.employee-picker-option:focus-visible {
  background: var(--surface-sunken);
}

/* ---------------------------------------------------------------------------
   Payroll Build 2 - assignment and reopen state

   STATE IS NOT COLOUR ALONE, here as elsewhere. An unassigned task carries
   the word "Unassigned"; an unresolved reopen carries "Not yet" in its own
   column. The tints below are a second signal, never the only one.
   --------------------------------------------------------------------------- */

/* An unassigned task is not an error - it is work nobody has picked up yet -
   so it is marked with attention rather than alarm. */
.badge-open {
  background: var(--status-warning-surface);
  color: var(--brand-primary);
}

/* A reopened payroll that was never completed again is unfinished work. */
.data-table tbody tr.is-unresolved td {
  background: var(--status-warning-surface);
}

.payroll-assignee {
  flex: 0 0 auto;
  max-width: 14rem;
}

/* The task row now carries two controls (assignee, status) rather than one,
   so it wraps on a narrow screen instead of squeezing the title. */
@media (max-width: 900px) {
  

  .payroll-assignee {
    flex: 1 1 100%;
  }
}

/* ---------------------------------------------------------------------------
   Benefits Reconciliation

   SORTABLE HEADERS ARE REAL BUTTONS. A clickable <th> is reachable by a
   mouse and nothing else; a button inside it is reachable by keyboard and
   announced by a screen reader, and `aria-sort` on the header says which
   way. The arrow is drawn from that attribute rather than from a class, so
   the visual state and the announced state cannot disagree.
   --------------------------------------------------------------------------- */

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.table-sort:hover {
  color: var(--brand-primary);
}

.data-table th[aria-sort] .table-sort {
  color: var(--brand-primary);
}

.data-table th[aria-sort="ascending"] .table-sort::after { content: "\2191"; }
.data-table th[aria-sort="descending"] .table-sort::after { content: "\2193"; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* A button that reads as a link inside a table cell: the employee name
   opens the line's detail, and styling it as a button would put a control
   in every row of a data table. */
.btn-link-plain {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brand-primary);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.btn-link-plain:hover {
  color: var(--brand-primary-hover);
}

.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-5);
}

.detail-list dt {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
}

.detail-list dd {
  margin: 0;
  color: var(--text-primary);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-default);
}

.activity-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
}

/* The chart's figures, collapsed by default. It is the accessible
   equivalent of the line rather than a duplicate of it: anybody who cannot
   read the chart reads the numbers, and the numbers are exact. */
.chart-table {
  margin-top: var(--space-4);
}

.chart-table summary {
  cursor: pointer;
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
}

/* The Report Builder's column picker. Thirty-six checkboxes in one flat
   list is unreadable; grouped into the catalogue's own sections, each
   group reads as a short list somebody can scan. The groups come from the
   server, so a field moved between them moves here too. */
.field-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.field-group {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0;
  min-width: 0;
}

.field-group legend {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
  padding: 0 var(--space-2);
}

.field-choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--type-body-sm-size);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 0;
}

.field-choice span {
  overflow-wrap: anywhere;
}

/* A report can run to twenty thousand rows and thirty-six columns. The
   table scrolls inside its card rather than stretching the page sideways,
   which would push the filters and the export buttons off screen. */
.table-scroll {
  overflow-x: auto;
  max-height: 60vh;
  overflow-y: auto;
}

.pager {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   Vendor Management (HR Operations Build 2)

   STATE IS NOT COLOUR ALONE. Every status pill carries its own word, and
   the tints below are a second signal - the rule this file applies to
   payroll assignment, benefits variance and recruiting stages alike.
   --------------------------------------------------------------------------- */

/* Two definition lists side by side on a wide screen, stacked on a narrow
   one. `.detail-grid` is a dl layout rather than a section wrapper, so this
   is its missing outer counterpart. */
.detail-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Contract information runs to seven rows of short values; two columns of
   pairs reads better than one tall column beside empty space. */
.detail-list-wide {
  grid-template-columns: max-content 1fr max-content 1fr;
}

@media (max-width: 900px) {
  .detail-list-wide {
    grid-template-columns: max-content 1fr;
  }
}

/* Active is the unremarkable case and gets the neutral pill `.badge`
   already provides. The other two are states somebody should notice. */
.vendor-status-under-review {
  background: var(--status-warning-surface);
  color: var(--status-warning-text);
}

.vendor-status-inactive {
  background: var(--status-neutral-surface);
  color: var(--status-neutral-text);
}

/* The upload control. A real <input type="file"> kept in `.sr-only` with a
   <label> styled as the button, so the control is the native one - it stays
   keyboard reachable and announces itself correctly - while looking like
   every other button on the page. */
.upload-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  font-size: var(--type-body-sm-size);
}

/* The label is acting as the button, so it needs the focus ring the real
   control would have drawn. */
.upload-row input[type="file"]:focus-visible + .muted,
.upload-row input[type="file"]:focus-visible ~ label {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Notes are prose somebody typed, including their line breaks. Without
   pre-wrap a paragraph of them collapses into one run-on line. */
.vendor-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text-primary);
}

.breadcrumb {
  margin: 0 0 var(--space-2);
  font-size: var(--type-body-sm-size);
}

/* The counterpart to `.form-error` - a confirmation that something saved,
   in the same position so the eye does not have to hunt for either. */
.form-success {
  background: var(--status-success-surface);
  color: var(--status-success-text);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
  font-size: var(--type-body-sm-size);
}

/* ==========================================================================
   BUILD 1 - SHARED COMPONENTS THE NEW SHELL INTRODUCES
   ==========================================================================

   Components the approved renderings show that the application had no
   treatment for. Each one is a SHARED definition: no page-specific variant,
   no second spelling.

   Nothing here is a control. These are surfaces and layouts that existing
   markup opts into - a page that does not use them is unaffected, which is
   what lets Build 2 convert archetypes one at a time.
   ========================================================================== */


/* ---- table toolbar ------------------------------------------------------

   The band between a filter bar and a table: a result count on the left,
   per-table actions on the right. The Directory rendering puts its result
   count exactly here. */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.table-count {
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

/* ---- pagination ---------------------------------------------------------

   Numbered, with the current page as a filled square - the Directory
   rendering's footer. `aria-current="page"` carries the state for a screen
   reader; the fill is the visual half of the same fact. */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-page {
  display: grid;
  place-items: center;
  min-width: var(--control-height-sm);
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast) var(--motion-ease);
}

.pagination-page:hover {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
}

.pagination-page[aria-current="page"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-inverse);
}

/* ---- tab bar ------------------------------------------------------------

   Underlined tabs on a frosted strip, as the Executive Summary rendering
   shows. The underline is a box-shadow rather than a border so switching
   tabs cannot shift the row by a pixel.

   NOTE: this styles a tab bar a page already has. Build 1 adds no tab bar
   to any page, and invents none of the section tabs the renderings show. */

/* BUILD 2: `.workspace-tabs` joins this selector rather than keeping its
   own near-identical rules in employee.css. The Employee Profile and the
   Requisition Detail are archetypes - two tab treatments across two
   archetypes is exactly the page-specific fork this build forbids. */
.tab-bar,
.workspace-tabs {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  margin-bottom: var(--space-7);
  padding: var(--space-2);
  overflow-x: auto;
  background: var(--surface-frosted);
  border: 1px solid var(--surface-frosted-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--frost-blur));
}

@supports not (backdrop-filter: blur(1px)) {
  .tab-bar,
  .workspace-tabs {
    background: var(--surface-frosted-opaque);
  }
}

.tab-bar a,
.tab-bar button,
.workspace-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--motion-fast) var(--motion-ease),
    background var(--motion-fast) var(--motion-ease);
}

.tab-bar a:hover,
.tab-bar button:hover,
.workspace-tab:hover {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
}

/* `aria-current="true"` is included deliberately. The workspace bar uses it
   for an entry that is a sub-AREA rather than a page - "Payroll" points at
   that area's first page, so claiming `page` would assert something false
   to a screen reader. It is still the selected entry and must look like
   one; without this it was the only active tab in the product that was not
   visually marked. */
.tab-bar [aria-selected="true"],
.tab-bar [aria-current="page"],
.tab-bar [aria-current="true"],
.workspace-tab.is-active {
  background: var(--surface-default);
  color: var(--brand-primary);
  box-shadow: inset 0 -3px 0 0 var(--focus-ring);
}

/* ---- section surface ----------------------------------------------------

   The default content block on the new canvas. White and opaque: it carries
   tables, forms and long text, which the build's translucency split puts on
   the opaque side. */

.surface-card {
  padding: var(--space-7);
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---- loading state ------------------------------------------------------

   A real state, not a skeleton: the application has no loading architecture
   that could populate skeleton shapes, and inventing one would be a
   decorative control. This is the honest version - a labelled region that
   announces itself.

   The spinner is the one animation Build 1 adds, it is small, and it stops
   entirely under prefers-reduced-motion. */

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-10) var(--space-7);
  color: var(--text-muted);
  font-size: var(--type-body-sm-size);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand-primary);
  border-radius: var(--radius-pill);
  animation: shell-spin 720ms linear infinite;
}

@keyframes shell-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }
}

/* ==========================================================================
   BUILD 2 - ARCHETYPE COMPONENT LAYER
   ==========================================================================

   Build 1 gave the platform a shell and a component foundation. Build 2
   makes four pages the canonical examples the rest of the platform will
   inherit from, and everything it needed is defined HERE rather than on
   those pages - a page-specific fork would defeat the point of having
   archetypes at all.

   THE DENSITY RULE THIS BUILD WAS GIVEN: do not achieve elegance by
   removing visible information. Every change below either tightens a row,
   groups fields that belong together, or raises a heading out of a wall of
   text. None of it hides a control behind a click.

   The Directory rendering is the authority for the table and identity
   treatments; the Executive Summary rendering for the dashboard ones.
   ========================================================================== */


/* ---- identity cell ------------------------------------------------------

   The Directory rendering's first column: an avatar, the person's name in
   brand blue, and a quieter second line. Two facts in the vertical space
   the old single line already occupied, which is density gained rather
   than spent.

   SHARED, not employee-specific. A vendor's primary contact and a
   candidate's name are the same shape of thing, and Build 3 will point
   them here. */

.identity-cell {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.identity-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.identity-name {
  font-weight: var(--font-weight-label);
  color: var(--brand-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-meta {
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-body);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The avatar inside a table row is smaller than the one on a profile. Both
   come from avatar.js, which sizes by class rather than by page. */
.identity-cell .employee-avatar,
.identity-cell .avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  font-size: var(--type-caption-size);
}


/* ---- table density ------------------------------------------------------

   The Directory rendering's rows are tighter than the platform's were. The
   cell padding drops one step on the vertical axis and holds on the
   horizontal, which is what keeps columns separated while fitting more
   rows on a screen.

   `--space-3` vertical is 8px against the previous 12px: roughly four more
   rows per laptop screen without touching the font size, which is where
   density is actually won. */

.data-table--dense th,
.data-table--dense td {
  padding: var(--space-3) var(--space-5);
}

/* A row carrying an identity cell needs a little more than a row of dates,
   because the avatar sets the floor. Stated once here rather than per
   page. */
.data-table--dense td:has(.identity-cell) {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

/* Hover is the scanning aid. It is a tint rather than a border so the row
   does not move, and it is paired with the pointer only where the row
   actually goes somewhere. */
.data-table tbody tr.clickable-row {
  cursor: pointer;
}

.data-table tbody tr.clickable-row:hover {
  background: var(--brand-primary-subtle);
}

/* A clickable row must be reachable by keyboard. The row itself is not
   focusable - the NAME inside it is a real link - so the focus ring lands
   on the link and the row tints to show which one it belongs to. */
.data-table tbody tr:focus-within {
  background: var(--brand-primary-subtle);
}


/* ---- sticky table header ------------------------------------------------

   The Directory lists the whole workforce in one table. Past about twenty
   rows the header scrolls away and every column becomes a guess.

   `.table-card--sticky` already existed for exactly this and was unused on
   the Directory. What is new is the scroll container: the card gets a
   max height so the HEADER has something to stick to, because a sticky
   header inside a card that is as tall as its content never sticks. */

.table-card--sticky {
  max-height: calc(100vh - 20rem);
  overflow-y: auto;
}

.table-card--sticky .data-table thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  /* Opaque. A translucent header over scrolling rows is unreadable, and
     this is the one place the build's frosted-surface allowance is
     explicitly withheld. */
  background: var(--brand-primary-subtle);
  box-shadow: inset 0 -1px 0 0 var(--border-default);
}


/* ---- page header, archetype form ---------------------------------------

   The renderings open every page the same way, and Build 2 makes that one
   component rather than four similar ones: an optional eyebrow, the
   title, one line of supporting copy, and the actions on the right.

   The eyebrow is what lets a page say what KIND of thing it is without
   spending a heading on it. */

.page-eyebrow {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--type-metric-label-size);
  font-weight: var(--font-weight-label);
  letter-spacing: var(--type-metric-label-tracking);
  text-transform: uppercase;
  color: var(--brand-primary-muted);
}

/* A row of facts under a page title - headcount, as-of date, record id.
   Replaces the paragraph of prose each page used to carry. */
.page-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-4);
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

.page-fact {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}

.page-fact strong {
  font-weight: var(--font-weight-label);
  color: var(--text-primary);
}


/* ---- section header -----------------------------------------------------

   A titled band inside a surface, with room for one action on the right.
   Both renderings use it above every table and every chart. */

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.section-header h2,
.section-header h3 {
  margin: 0;
  font-size: var(--type-section-size);
  line-height: var(--type-section-line);
  font-weight: var(--type-section-weight);
  color: var(--brand-primary);
}

.section-header p {
  margin: var(--space-2) 0 0;
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

.section-header-text {
  min-width: 0;
}


/* ---- detail list --------------------------------------------------------

   The profile and the requisition both show twenty or more read-only
   fields. As one long column they are unscannable; as a responsive
   two-to-four column grid of label/value pairs they are a reference card.

   This is where Build 2's density requirement is most visible: the SAME
   fields, in a third of the vertical space, with nothing hidden. */

.detail-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.detail-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4) var(--space-6);
  margin: 0;
}

.detail-pair {
  min-width: 0;
}

.detail-pair dt,
.detail-pair-label {
  margin: 0 0 var(--space-1);
  font-size: var(--type-metric-label-size);
  font-weight: var(--font-weight-label);
  letter-spacing: var(--type-metric-label-tracking);
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-pair dd,
.detail-pair-value {
  margin: 0;
  font-size: var(--type-body-sm-size);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}


/* ---- workflow / activity timeline --------------------------------------

   The requisition's audit trail and the profile's history are the same
   shape: a time-ordered list of what happened and who did it. One
   treatment, defined once.

   The rail is a border on the list rather than a pseudo-element per row,
   so a single item does not render a stub of line below it. */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-6);
  border-left: 2px solid var(--border-default);
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--space-5) var(--space-5);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(var(--space-5) * -1 - 5px);
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--surface-default);
}

.timeline-when {
  display: block;
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.timeline-what {
  display: block;
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  color: var(--text-primary);
}

.timeline-who {
  font-weight: var(--font-weight-body);
  color: var(--text-muted);
}


/* ---- workflow layout ----------------------------------------------------

   The requisition detail and the profile both want a wide working column
   and a narrower column of standing context. One grid, stacking below the
   lg breakpoint so the context lands under the work rather than beside a
   squeezed version of it. */

.workspace-split {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.workspace-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-5));
}

@media (max-width: 1100px) {
  .workspace-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-aside {
    position: static;
  }
}


/* ---- status pill, archetype form ---------------------------------------

   Tightened to the rendering's proportions: a shorter pill with a heavier
   label. The WORD remains the signal - these never carry colour alone -
   and the existing semantic classes are untouched, so every status across
   the platform inherits the new shape without a single page changing. */

.status-pill,
.cohort-status {
  padding: var(--space-1) var(--space-3);
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-subhead);
  line-height: 1.5;
  white-space: nowrap;
}


/* ---- metric strip -------------------------------------------------------

   The Executive Summary rendering's KPI row, in the compact form a report
   section wants: no icon plate, four to six across, each a label, a value
   and one line of context.

   Distinct from `.kpi-card` deliberately - that is the hero form with an
   icon, this is the in-section form - and both read from the same tokens
   so they cannot drift apart. */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.metric-cell {
  padding: var(--space-5);
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.metric-cell-label {
  display: block;
  font-size: var(--type-metric-label-size);
  font-weight: var(--font-weight-label);
  letter-spacing: var(--type-metric-label-tracking);
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-cell-value {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--type-metric-value-size);
  line-height: var(--type-metric-value-line);
  font-weight: var(--type-metric-value-weight);
  color: var(--brand-primary);
}

.metric-cell-note {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

/* ==========================================================================
   BUILD 3 - PLATFORM ROLLOUT
   ==========================================================================

   Builds 1 and 2 established the shell and four archetypes. Build 3 applies
   them to the rest of the application, and the way it does that is by
   PROMOTION rather than by editing forty-eight templates.

   `.summary-section` appears in 26 of them. `.tile` and `.tile-grid` appear
   in 14. Those classes are already the right structural markers - a titled
   block of work, and a row of headline numbers - they were simply styled
   like the pre-transformation product. Giving them the archetype treatment
   here converts every page that uses them at once, with no markup churn and
   no opportunity for twenty-six slightly different interpretations.

   That is also what the build asked for in its own words: consolidate
   rather than add, and do not create a fifth visual language.

   WHAT MOVED HERE FROM WHERE
     - `.summary-section` surface   <- compat.css block 8 (now deleted)
     - `.summary-section` spacing   <- main.css legacy rule (now deleted)
     - `.summary-section h2`        <- main.css legacy rule (now deleted)
     - `.tile` metric treatment     <- aligned with `.metric-cell`

   Nothing below is a new visual idea. Every value is one Build 1 or Build 2
   already approved, applied to a class that did not yet reach it.
   ========================================================================== */


/* ---- the section surface ------------------------------------------------

   The Executive HR Summary archetype's section: an opaque white card on the
   pale canvas, carrying a dark-blue title and whatever the page puts below.

   OPAQUE, not frosted. These blocks hold tables, charts, forms and long
   explanatory copy, which the translucency split put firmly on the solid
   side in Build 1.

   This was compat.css block 8, which existed because the pages assumed a
   white page behind them and the new canvas is blue. It stops being a
   collision fix and becomes the platform's section component. */

.summary-section {
  margin-bottom: var(--space-6);
  padding: var(--space-7);
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* The archetype's section heading, so a title reads the same on Payroll as
   it does on the Executive HR Summary. */
.summary-section > h2,
.summary-section > h3 {
  margin: 0 0 var(--space-4);
  font-size: var(--type-section-size);
  line-height: var(--type-section-line);
  font-weight: var(--type-section-weight);
  letter-spacing: 0;
  color: var(--brand-primary);
}

/* The sentence beneath a section title. Pages write this as a `.muted`
   paragraph directly after the heading. */
.summary-section > h2 + p.muted,
.summary-section > h3 + p.muted {
  margin: calc(var(--space-4) * -1) 0 var(--space-5);
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

/* A table card inside a section would be a white card on a white card. The
   inner chrome is dropped and the table keeps every one of its own rules -
   sorting, stickiness and density are untouched. */
.summary-section > .table-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* A section whose entire body is one table should not pay twice for
   padding. The card supplies the inset; the table runs to its edges. */
.summary-section.is-table-only {
  padding-bottom: 0;
}


/* ---- dashboard tiles ----------------------------------------------------

   `.tile` and `.tile-grid` are the pre-transformation dashboard card. They
   are already used on fourteen pages as "a headline number with a label",
   which is exactly what `.metric-cell` is, so they are brought onto the
   same treatment rather than left as a second one.

   The grid becomes responsive. It was a hard `repeat(4, 1fr)`, which on a
   laptop squeezed four cards into a column width meant for three and on a
   phone produced four unreadable slivers. */

.tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.tile {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  gap: var(--space-2);
}

/* The hover lift goes. It was the old dashboard-card affordance and it
   suggested the whole tile was clickable, which on most of these pages it
   is not. Where a tile really is a link, the link inside it carries the
   affordance. */
.tile:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--border-default);
}

.tile-label {
  font-size: var(--type-metric-label-size);
  letter-spacing: var(--type-metric-label-tracking);
}

.tile-value {
  font-size: var(--type-metric-value-size);
  line-height: var(--type-metric-value-line);
}


/* ---- table density, platform-wide ---------------------------------------

   The Employee Directory archetype governs every table. Its row rhythm
   becomes the default rather than an opt-in, so a table on Payroll, Leave
   Tracking or Benefits has the same scanning speed as the Directory.

   `.data-table--dense` is kept as an alias rather than removed: it is the
   name Build 2 shipped, several pages pass it explicitly, and removing a
   class to achieve purity is churn with no visible benefit. */

.data-table th,
.cohort-table th,
.data-table td,
.cohort-table td {
  padding: var(--space-3) var(--space-5);
}

/* The one exception, unchanged: the drill-down modal's table is denser
   still, because it sits inside a constrained panel. */
.cohort-table th,
.cohort-table td {
  padding: var(--space-3) var(--space-3);
}


/* ---- page headers, platform-wide ----------------------------------------

   Build 2 gave `.page-header h1` the display treatment. Everything else
   about the header - the subtitle, the action placement - was already
   shared. What was missing is the band below a header on pages that put
   their filters there, which now gets the same rhythm everywhere. */

.page-header + .filters-bar {
  margin-top: 0;
}

/* A page whose first element after the header is a section should not have
   the header's bottom margin doubled by the section's own. */
.page-header + .summary-section {
  margin-top: 0;
}


/* ==========================================================================
   CONSOLIDATED PRODUCT CORRECTION
   ==========================================================================

   Components added by the consolidation. Each is built from tokens Build 1
   approved and from the shared section, table and modal components; none
   is a new visual language. */


/* ---- small buttons ------------------------------------------------------

   Row-level controls inside a list (move, rename, remove). The shared
   button at the shared small control height. */

.btn-sm {
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  font-size: var(--type-label-size);
}


/* ---- confirmation dialog ------------------------------------------------

   static/js/confirm-dialog.js builds this on the shared modal markup. Only
   the message and its list need rules of their own. */

.confirm-dialog-message {
  margin: var(--space-4) 0 var(--space-3);
  font-size: var(--type-body-size);
  color: var(--text-primary);
}

.confirm-dialog-details {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-7);
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
}

.confirm-dialog .modal-footer {
  flex-wrap: wrap;
}


/* ---- the lightweight checklist ------------------------------------------

   One list for Payroll and the Employee Profile: a checkbox, the label,
   who checked it and when, and the row's controls. Dense, like the
   Directory - one line per item where the label allows. */

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-default);
}

.checklist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border-default);
}

.checklist-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  cursor: pointer;
}

.checklist-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand-primary);
}

.checklist-label {
  font-size: var(--type-body-sm-size);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.checklist-item.is-checked .checklist-label {
  color: var(--text-secondary);
}

.checklist-meta {
  font-size: var(--type-caption-size);
  color: var(--text-muted);
  white-space: nowrap;
}

.checklist-controls {
  display: inline-flex;
  gap: var(--space-1);
}

.checklist-control--danger {
  color: var(--status-danger-text);
}

.checklist-rename {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
}

.checklist-rename input {
  flex: 1 1 auto;
  min-width: 0;
}

.checklist-add {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.checklist-add input {
  flex: 1 1 auto;
  min-width: 0;
}

.checklist-lock-note {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--status-info-surface);
  color: var(--brand-primary);
  font-size: var(--type-body-sm-size);
}

.checklist-override {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .checklist-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .checklist-meta {
    white-space: normal;
    padding-left: calc(18px + var(--space-3));
  }

  .checklist-controls {
    padding-left: calc(18px + var(--space-3));
  }
}


/* ---- Payroll ------------------------------------------------------------

   The period bar: previous, the selector and next on one line, the
   current-period marker beside them, and the period's facts below. */

.payroll-period-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
}

.payroll-period-select {
  flex: 0 1 22rem;
  min-width: 0;
  margin: 0;
}

.payroll-period-select select {
  width: 100%;
}

.payroll-period-facts {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
}

.payroll-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.payroll-actions .form-field {
  margin: 0;
}

.payroll-manage > summary {
  cursor: pointer;
  list-style: revert;
}

.payroll-manage > summary h2 {
  display: inline;
  margin: 0;
  font-size: var(--type-section-size);
  font-weight: var(--type-section-weight);
  color: var(--brand-primary);
}

.payroll-manage-body {
  margin-top: var(--space-5);
}

.payroll-manage-body h3 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--type-card-title-size);
  color: var(--brand-primary);
}

.payroll-manage-body h3:first-child {
  margin-top: 0;
}

@media (max-width: 640px) {
  .payroll-period-nav > .btn {
    flex: 1 1 0;
  }

  .payroll-period-select {
    flex: 1 1 100%;
    order: -1;
  }
}


/* ---- vendor scope badge ---------------------------------------------------

   Which team owns a vendor, on HR's directory where both appear. Navy for
   HR and light blue for Office Management - the two structural brand
   colours, so neither reads as a status. The word is always present. */

.vendor-scope-hr {
  background: var(--brand-primary-surface);
  color: var(--brand-primary);
}

.vendor-scope-office-management {
  background: var(--brand-light-surface);
  color: var(--text-on-light-blue);
}


/* ---- Office Management --------------------------------------------------

   A section's own control (the Starting Soon window) sits in the section
   header beside the title; the anniversary range is a filter band of two
   labelled dates and one action. */

.section-header-control {
  margin: 0;
  min-width: 10rem;
}

.anniversary-range {
  align-items: flex-end;
}

.anniversary-range .form-field {
  margin: 0;
}

.office-attention {
  margin: var(--space-5) 0 var(--space-3);
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
}


/* ---- information tooltip -------------------------------------------------

   static/js/info-tip.js. A small circled "i" button beside a label; its
   definition shows on hover, on keyboard focus and on tap, and is announced
   through aria-describedby. Hidden by default and never the only place a
   figure appears. */

.info-tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: var(--space-2);
}

.info-tip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--brand-primary-muted);
  border-radius: var(--radius-pill);
  background: var(--surface-default);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: var(--font-weight-headline);
  font-style: italic;
  line-height: 1;
  cursor: help;
}

.info-tip-button:hover,
.info-tip.is-open .info-tip-button {
  background: var(--brand-primary-surface);
}

.info-tip-button:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 2px;
}

.info-tip-text {
  display: none;
  position: absolute;
  z-index: var(--z-raised);
  left: 50%;
  bottom: calc(100% + var(--space-2));
  transform: translateX(-50%);
  width: max-content;
  max-width: 18rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-inverse);
  color: var(--text-inverse);
  box-shadow: var(--shadow-menu);
  font-size: var(--type-caption-size);
  font-style: normal;
  font-weight: var(--font-weight-body);
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
}

.info-tip.is-open .info-tip-text {
  display: block;
}


/* ---- Executive Recruiting Summary ----------------------------------------

   The Executive HR Summary archetype: titled sections on opaque surfaces,
   each holding one to two compact panels. The grids put the two most-read
   surfaces side by side and give the movement chart most of its row. */

.exec-section > h2 {
  margin-bottom: var(--space-5);
}

.exec-grid {
  display: grid;
  gap: var(--space-6) var(--space-7);
  align-items: start;
}

.exec-grid--overview {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.exec-grid--halves {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.exec-grid--movement {
  grid-template-columns: minmax(16rem, 0.7fr) minmax(0, 2.3fr);
}

.exec-panel {
  min-width: 0;
}

.exec-panel-title {
  margin: 0 0 var(--space-3);
  font-size: var(--type-card-title-size);
  font-weight: var(--type-card-title-weight);
  color: var(--brand-primary);
}

.exec-panel-unit {
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-body);
  color: var(--text-muted);
}

.exec-table {
  width: 100%;
}

.exec-table th[scope="row"] {
  font-weight: var(--font-weight-label);
  color: var(--text-primary);
  white-space: nowrap;
}

.exec-value {
  font-weight: var(--font-weight-headline);
  color: var(--brand-primary);
}

/* Vacancy Summary (Recruiting Historical Import Build): a label and its
   number read as a pair. The table is as wide as its content rather than
   the panel, and the value column is narrow and right-aligned, so
   "Open Positions" and its count are never a panel-width apart. Only this
   table carries the modifier - Recruiting Efficiency is unchanged. */
.exec-table.exec-table--vacancy {
  width: auto;
  min-width: 16rem;
  max-width: 100%;
}

.exec-table--vacancy th[scope="row"] {
  padding-right: var(--space-6);
}

/* No percentage width here: a % cell makes an auto-width table grow to
   the panel again. Content-sized, the value column is already narrow. */
.exec-table--vacancy td.exec-value {
  white-space: nowrap;
  text-align: right;
}

.exec-trend-row th,
.exec-trend-row td {
  color: var(--text-secondary);
  font-style: italic;
}

.exec-trend {
  display: inline-block;
  margin-left: var(--space-2);
  font-weight: var(--font-weight-headline);
}

.exec-trend--better {
  color: var(--chart-positive);
}

.exec-trend--worse {
  color: var(--status-warning-text);
}

.exec-trend--flat {
  color: var(--text-muted);
}

.exec-note {
  margin: var(--space-3) 0 0;
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.exec-current {
  margin: var(--space-4) 0 0;
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  color: var(--brand-primary);
}

.exec-chart {
  position: relative;
  width: 100%;
}

.exec-chart--retention {
  height: 15rem;
}

.exec-chart--movement {
  height: 20rem;
}

.exec-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.exec-figures li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.exec-figure-label {
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-label);
  color: var(--text-secondary);
}

.exec-figure-value {
  flex-basis: 100%;
  font-size: var(--type-card-title-size);
  font-weight: var(--font-weight-headline);
  color: var(--brand-primary);
}

.exec-figure-detail {
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.exec-req-title {
  display: block;
  font-weight: var(--font-weight-label);
  color: var(--text-primary);
}

.exec-req-number {
  display: block;
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.exec-tab-panel {
  margin-top: var(--space-4);
}

.exec-tab-panel > .exec-note {
  margin: 0 0 var(--space-3);
}

.tab-count {
  margin-left: var(--space-1);
  font-weight: var(--font-weight-body);
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .exec-grid--overview,
  .exec-grid--halves,
  .exec-grid--movement {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .exec-figures {
    grid-template-columns: minmax(0, 1fr);
  }

  .exec-table th[scope="row"] {
    white-space: normal;
  }
}


/* ---- Retention -----------------------------------------------------------

   The milestone table, then up to three donut cards that reflow by the
   width available rather than into a fixed grid. Each card is a titled
   surface with its ring and a legend of buttons - category, count and share
   of the full cohort - that open the same drill-down the ring does. */

.retention-table {
  max-width: 40rem;
}

.retention-milestone {
  display: block;
  font-weight: var(--font-weight-label);
}

.retention-cohort {
  display: block;
  margin: 0;
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-body);
  color: var(--text-muted);
}

.retention-result {
  font-weight: var(--font-weight-headline);
  color: var(--brand-primary);
  white-space: nowrap;
}

.retention-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-6);
}

.retention-card {
  margin-bottom: 0;
}

.retention-card > h2 {
  margin-bottom: var(--space-1);
}

.retention-ring {
  position: relative;
  height: 15rem;
  margin: var(--space-5) 0;
}

/* A zero-eligible cohort: the same footprint as a ring, holding a statement
   rather than a chart, so the three cards stay aligned. */
.retention-ring-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

.retention-empty {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Office People Search home address (UI Polish Build): the record's own
   lines ("Street" / "City, State ZIP"), wrapped rather than one long run. */
.data-table td.cell-address {
  white-space: pre-line;
  min-width: 14rem;
}

/* ---------- Retention drill-down dialog (UI Polish Build) ----------
   Shared by HR Retention and the Executive Recruiting Summary. Sized to the
   screen and FIXED in height, so changing tabs never resizes it; nothing in
   it scrolls in ordinary use:
     * every segment tab shows at once - a wrapping grid, never a sideways
       scroll; long labels wrap, the count stays beside them;
     * the table is fixed-layout and wraps within the dialog's width;
     * a long segment is paged (retention-charts.js sizes the page to the
       window) instead of scrolling the dialog.
   The body keeps overflow:auto only as a last resort for a window too short
   for even a minimal page - it is never hidden or clipped. */
/* Two classes: main.css (loaded later) re-declares .modal-wide at 900px. */
.modal.modal-drilldown {
  max-width: min(1280px, calc(100vw - 2 * var(--space-5)));
  height: min(880px, calc(100vh - 2 * var(--space-5)));
  max-height: none;
}

.modal-drilldown .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-5);
}

.retention-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) var(--space-7) 0;
  padding: var(--space-2);
  background: var(--surface-frosted-opaque);
  border: 1px solid var(--surface-frosted-border);
  border-radius: var(--radius-lg);
}

.retention-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  font: inherit;
  font-size: var(--type-body-sm-size);
  font-weight: var(--font-weight-label);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.retention-tab-label {
  white-space: normal;
  overflow-wrap: anywhere;
}

.retention-tab-count {
  flex: 0 0 auto;
  min-width: 2ch;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill, 999px);
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
  text-align: center;
}

.retention-tab:hover {
  border-color: var(--border-default);
}

/* The active tab cannot be missed: filled, outlined and announced. */
.retention-tab[aria-selected="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-inverse);
}

.retention-tab[aria-selected="true"] .retention-tab-count {
  background: var(--surface-elevated);
}

.retention-drilldown-table {
  flex: 0 1 auto;
  overflow: visible;
}

.retention-drilldown-table .data-table {
  table-layout: fixed;
  width: 100%;
}

/* Scoped to the dialog's own column classes (retention-charts.js), so no
   other table's single-line value cells are touched. */
.retention-drilldown-table th.w-8,
.retention-drilldown-table th.w-9,
.retention-drilldown-table th.w-10,
.retention-drilldown-table th.w-11,
.retention-drilldown-table th.w-12,
.retention-drilldown-table th.w-14,
.retention-drilldown-table th.w-20,
.retention-drilldown-table th.w-22,
.retention-drilldown-table th.w-23,
.retention-drilldown-table td.w-8,
.retention-drilldown-table td.w-9,
.retention-drilldown-table td.w-10,
.retention-drilldown-table td.w-11,
.retention-drilldown-table td.w-12,
.retention-drilldown-table td.w-14,
.retention-drilldown-table td.w-20,
.retention-drilldown-table td.w-22,
.retention-drilldown-table td.w-23 {
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  vertical-align: top;
}

/* Each column's SHARE of the width (retention-charts.js names them). */
.retention-drilldown-table .w-8 { width: 8%; }
.retention-drilldown-table .w-9 { width: 9%; }
.retention-drilldown-table .w-10 { width: 10%; }
.retention-drilldown-table .w-11 { width: 11%; }
.retention-drilldown-table .w-12 { width: 12%; }
.retention-drilldown-table .w-14 { width: 14%; }
.retention-drilldown-table .w-20 { width: 20%; }
.retention-drilldown-table .w-22 { width: 22%; }
.retention-drilldown-table .w-23 { width: 23%; }

/* Headings break between words (and hyphenate a long one), never mid-letter. */
.retention-drilldown-table .data-table th {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

.retention-drilldown-table .data-table {
  font-size: var(--type-body-sm-size);
}

.retention-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
}

.retention-pager-status {
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

/* A phone: the dialog is the full-screen sheet; each employee becomes a
   short labelled block instead of a nine-column row, so nothing goes
   sideways. */
@media (max-width: 640px) {
  .modal.modal-drilldown {
    height: 100vh;
    max-width: 100vw;
  }

  .retention-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: var(--space-3) var(--space-4) 0;
  }

  .retention-drilldown-table .data-table,
  .retention-drilldown-table .data-table tbody,
  .retention-drilldown-table .data-table tr,
  .retention-drilldown-table .data-table td {
    display: block;
    width: 100%;
  }

  .retention-drilldown-table .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .retention-drilldown-table .data-table tr {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-default);
  }

  .retention-drilldown-table .data-table td {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: var(--space-2);
    border: 0;
    padding: var(--space-1) var(--space-3);
  }

  .retention-drilldown-table .data-table td::before {
    content: attr(data-label);
    font-weight: var(--font-weight-label);
    color: var(--text-muted);
  }
}

.retention-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-default);
}

.retention-legend-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto 3.5rem;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-bottom: 1px solid var(--border-default);
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--type-body-sm-size);
  text-align: left;
  cursor: pointer;
}

.retention-legend-item:hover:not(:disabled) {
  background: var(--brand-primary-subtle);
}

.retention-legend-item:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: -2px;
}

.retention-legend-item:disabled {
  color: var(--text-muted);
  cursor: default;
}

.retention-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
}

.retention-legend-count,
.retention-legend-share {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.retention-legend-share {
  color: var(--text-secondary);
}


/* ---- Employee Profile checklists ----------------------------------------

   Onboarding and offboarding, one card each. A completed checklist is a
   collapsed <details>; its summary row carries the title, a status and the
   checked count, so the record reads at a glance without opening it. */

.employee-checklist + .employee-checklist {
  margin-top: var(--space-5);
}

.employee-checklist-details > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  cursor: pointer;
}

.employee-checklist-title {
  margin: 0;
}

.employee-checklist-progress {
  font-size: var(--type-body-sm-size);
}

.employee-checklist-meta {
  margin: var(--space-3) 0 var(--space-4);
  font-size: var(--type-caption-size);
}

.employee-checklist-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}


/* ---------- Executive Passkeys administration (Security Build 1) ---------- */

.passkey-access {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

.passkey-access-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.passkey-subheading {
  font-size: var(--type-body-size);
  margin: 0 0 var(--space-3);
}

.passkey-table td {
  vertical-align: middle;
}

.passkey-revoked td {
  color: var(--text-muted);
}

.passkey-actions {
  white-space: nowrap;
}

.passkey-actions .btn + .btn,
.passkey-rename-field + .btn,
.passkey-rename-field ~ .btn + .btn {
  margin-left: var(--space-2);
}

.passkey-danger {
  color: var(--status-danger-text);
}

.passkey-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.passkey-enrollment-note {
  flex-basis: 100%;
  margin: 0;
}

.passkey-link-field {
  width: 100%;
  margin-bottom: var(--space-3);
}

.passkey-rename-field {
  max-width: 16rem;
}

@media (max-width: 640px) {
  .passkey-actions {
    white-space: normal;
  }

  .passkey-account-actions .btn {
    width: 100%;
  }
}


/* ---------- Benefits Reconciliation imports (Build 1) ---------- */

.benefits-import-types {
  border: 0;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.benefits-import-type {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.benefits-not-implemented {
  margin-left: var(--space-2);
}

.benefits-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.benefits-reverse {
  display: grid;
  gap: var(--space-3);
  max-width: 32rem;
  margin-top: var(--space-5);
}

.benefits-match {
  display: grid;
  gap: var(--space-2);
  min-width: 14rem;
}

.benefits-match-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.benefits-excluded-list {
  margin: 0;
}

/* A SHA-256 has no break points; let it wrap inside its column. */
.benefits-document-facts dd {
  overflow-wrap: anywhere;
}

/* ---------- Benefits Reconciliation vendor imports (Build 2) ---------- */

.benefits-subheading {
  margin: var(--space-5) 0 var(--space-3);
}

.benefits-finding-list {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.benefits-inline-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 var(--space-3);
}

.benefits-inline-action input {
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 32rem;
}

/* ---------- Benefits Reconciliation workspace (Build 4) ---------- */

.benefits-workflow {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: var(--space-5);
}

.benefits-cell {
  display: grid;
  gap: var(--space-1);
  min-width: 11rem;
  justify-items: start;
}

.benefits-cell-pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.benefits-definitions {
  margin-top: var(--space-3);
}

.benefits-definitions dd {
  margin: 0 0 var(--space-2);
}

/* ---------- Benefits Reconciliation matching hotfix ---------- */

.benefits-person {
  display: grid;
  /* The track never grows past the card: a wide row drilldown scrolls in
     its own .table-card instead of widening the page on a phone. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.benefits-person-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
}

/* ---------- Benefits matching-efficiency hotfix ---------- */

.benefits-person-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
}

.benefits-person-choice select {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 18rem;
}

.benefits-person-rows {
  max-width: 100%;
}

/* A checkbox in an action row keeps its own size; only text inputs stretch. */
.benefits-inline-action input[type="checkbox"] {
  flex: none;
}

.benefits-bulk-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  background: var(--surface-default);
  border-bottom: 1px solid var(--border-default);
}

.benefits-match-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}

.benefits-match-summary dd {
  margin: 0;
  font-weight: 600;
}


/* ---------- Office Management task board (UI Polish Build) ----------
   Four fixed columns side by side on a desktop, two on a tablet, one on a
   phone - never a sideways scroll. A card being dragged dims; the column
   it would land in is outlined. */
.task-new-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  align-items: end;
}

.task-new-actions {
  display: flex;
  justify-content: flex-end;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

@media (max-width: 1100px) {
  .task-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .task-board {
    grid-template-columns: minmax(0, 1fr);
  }
}

.task-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
}

.task-column.is-drop-target {
  border-color: var(--brand-primary);
}

.task-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  font-size: var(--type-body-size);
  color: var(--brand-primary);
}

.task-column-count {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--brand-primary-subtle);
  font-size: var(--type-caption-size);
}

.task-column-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 3rem;
}

.task-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.is-dragging {
  opacity: 0.5;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.task-card-title {
  margin: 0;
  font-size: var(--type-body-size);
}

.task-card-description,
.task-card-progress {
  margin: 0;
  font-size: var(--type-body-sm-size);
  color: var(--text-muted);
}

.task-items {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-item-text {
  flex: 1 1 auto;
  min-width: 0;
}

.task-item-text.is-done {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-add,
.task-card-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.task-add input,
.task-item-edit,
.task-card-title-edit {
  flex: 1 1 8rem;
  min-width: 0;
}


/* ---------- Close Requisition (UI Polish Build) ----------
   Green apple is the approved brand colour (--frazil-green-apple). White on
   it measures about 2.3:1, so the label is the dark primary text (about
   7:1) - a positive action, deliberately not styled like Delete. */
.btn-apple {
  background: var(--frazil-green-apple);
  border: 1px solid var(--frazil-green-apple);
  color: var(--text-primary);
}

.btn-apple:hover,
.btn-apple:focus-visible {
  filter: brightness(0.92);
}

.btn-apple:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.close-group {
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.close-group legend {
  margin-bottom: var(--space-3);
  font-weight: var(--font-weight-subhead);
  color: var(--brand-primary);
}

.close-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}


/* ---- Recruiting Historical Import ------------------------------------------ */

.import-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.import-upload .form-field {
  margin: 0;
  min-width: 0;
}

.import-note {
  margin-top: var(--space-3);
  font-size: var(--type-body-sm-size);
}

.import-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-6);
}

.import-fact dt {
  font-size: var(--type-caption-size);
  color: var(--text-muted);
}

.import-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.import-panel {
  min-width: 0;
}

/* The import page's tables hold sentences ("9 (Filled 3, Open 3 ...)"):
   they wrap rather than widen the page. Scoped to the page's own cell class
   (recruiting-historical-import.js), never to every .data-table cell. */
.data-table th.import-cell,
.data-table td.import-cell {
  white-space: normal;
  overflow-wrap: anywhere;
}

.import-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.import-filters .form-field {
  margin: 0;
  min-width: 12rem;
}

.import-findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.import-finding {
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface-default);
  min-width: 0;
}

.import-finding--blocking {
  border-left-color: var(--status-danger-text);
}

.import-finding--review {
  border-left-color: var(--status-warning-text);
}

.import-finding-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-body-sm-size);
}

.import-finding-code {
  font-weight: var(--font-weight-label);
  text-transform: capitalize;
}

.import-finding-message {
  margin: var(--space-2) 0 0;
  overflow-wrap: anywhere;
}

.import-finding-values {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.import-finding-resolution {
  margin: var(--space-2) 0 0;
  font-size: var(--type-body-sm-size);
  color: var(--text-secondary);
}

.import-resolve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.import-resolve select {
  max-width: 100%;
  min-width: 0;
}

.import-seat-input {
  width: 7rem;
}

.import-commit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.import-commit .form-field {
  margin: 0;
  min-width: min(20rem, 100%);
}

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


/* ---- Recruiting Candidate Workspace -------------------------------------- */

.candidate-stage-tiles {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.candidate-header {
  align-items: flex-start;
}

.candidate-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}

.candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.candidate-tracker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
}

.candidate-tracker-step {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  font-size: var(--type-body-sm-size);
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface-default);
}

.candidate-tracker-step.is-done {
  color: var(--text-primary);
  background: var(--surface-sunken);
}

.candidate-tracker-step.is-current {
  color: var(--text-inverse);
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  font-weight: var(--font-weight-subhead);
}

.candidate-required-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.candidate-suggestion,
.candidate-waiting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}

.candidate-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
}

.candidate-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.candidate-section-actions {
  margin-top: var(--space-3);
}

.candidate-interviews {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.candidate-interview {
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface-default);
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-interview.needs-outcome {
  border-left-color: var(--status-warning-text);
}

.candidate-interview-title {
  margin: 0 0 var(--space-2);
  font-size: var(--type-card-title-size);
}

.candidate-interview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.candidate-file-label {
  position: relative;
  cursor: pointer;
}

.interviews-all-heading {
  margin-top: var(--space-6);
}

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

  .candidate-tracker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .candidate-tracker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Benefits guided month workflow and Accounting ---------- */

.benefits-month-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.benefits-month-state {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

.benefits-month-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
}

.benefits-month-card {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  justify-items: start;
  min-width: 0;
  padding: var(--space-3);
  background: var(--surface-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.benefits-month-card h3,
.benefits-checklist h3,
.benefits-accounting-control h3 {
  margin: 0;
}

.benefits-month-facts {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  margin: 0;
  min-width: 0;
}

.benefits-month-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.benefits-checklists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
}

.benefits-checklist ul,
.benefits-blockers,
.benefits-advanced-links {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
}

.benefits-checklist ul {
  list-style: none;
  padding-left: 0;
}

.benefits-check-mark {
  display: inline-block;
  width: 1.25em;
}

.benefits-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-default);
}

.benefits-source-row select {
  min-width: 0;
  max-width: 100%;
}

.benefits-payroll-checks {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  min-width: 0;
}

.benefits-check-option {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
}

.benefits-check-option input[type="checkbox"] {
  flex: none;
}

.benefits-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.benefits-hr-item,
.benefits-accounting-control {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  min-width: 0;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.benefits-hr-item p {
  margin: 0;
}

.benefits-advanced-calc {
  max-width: 100%;
}

/* ---- Adjustment Ledger and Employee Impact ------------------------------

   HR's carrier-adjustment lifecycle and the forensic employee view. Wide
   tables scroll inside `.table-scroll`; nothing here sets a page width. */

.benefits-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}

.benefits-filter-bar .form-field {
  min-width: 0;
  max-width: 100%;
}

.benefits-filter-bar select,
.benefits-filter-bar input[type="search"] {
  max-width: 100%;
}

.benefits-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.benefits-sort {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
}

.benefits-sign-note {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--border-default);
  background: var(--surface-default);
}

.benefits-drill-vendor,
.benefits-drill-benefit,
.benefits-thread {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.benefits-drill-vendor {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.benefits-drill-benefit {
  padding-left: var(--space-3);
}

.benefits-thread {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.benefits-thread-lines {
  min-width: 0;
}
