:root {
  --red: #b0463a;
  --bg: #f5f4f8;
  --card-bg: #ffffff;
  --border: #e0dee8;
  /* Borders that outline an interactive control (inputs, toggle buttons) need
     3:1 contrast against their background -- WCAG 1.4.11 Non-text Contrast.
     --border above is decorative only and stays lighter. */
  --field-border: #8a8794;
  --text: #2b2733;
  --text-muted: #6c6779;

  /* Brand palette */
  --brand: #6a4fb3;
  --brand-dark: #3d2a63;
  --hammer-red: #e2273d;
}

* { box-sizing: border-box; }

/* Honour the OS "Reduce motion" setting: no looping animations, near-instant
   transitions, no smooth-scroll (WCAG 2.3.3, and supports 2.2.2). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
/* Links sitting inside a sentence are distinguished by weight, not colour
   alone (WCAG 1.4.1) -- buttons/tabs/badges carry their own classes. */
p a:not([class]) { font-weight: 600; }

/* Keyboard-only "skip to main content" link (WCAG 2.4.1). Off-screen until
   focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--brand-dark);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* Present for screen readers, removed from the visual layout. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar {
  background: var(--brand-dark);
  border-bottom: 3px solid var(--hammer-red);
  padding: 0.85rem 1.5rem;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
}

.topbar .topbar-link {
  color: white;
  opacity: 0.9;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0;
}
.topbar .topbar-link:hover { opacity: 1; }

.hero {
  background: var(--brand-dark);
  color: white;
  padding: 1.5rem 1.5rem 2rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-action {
  text-align: right;
  flex-shrink: 0;
}

.hero-action p {
  margin: 0 0 0.5rem;
  max-width: 24ch;
  font-size: 0.85rem;
}

.hero-back {
  display: inline-block;
  color: #c9b8ea;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
}
.hero-back:hover { color: white; text-decoration: underline; }

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  color: white;
}

.hero p {
  margin: 0;
  color: #e6ddf5;
  font-size: 0.95rem;
  max-width: 70ch;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.action-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.action-card {
  display: flex;
  flex-direction: column;
}
.action-card p { flex-grow: 1; }

.track-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.track-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-top: 4px solid var(--track-accent, var(--brand));
  padding: 1.75rem 1.5rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.track-card-badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--track-accent, var(--brand));
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.track-card-icon { font-size: 2.4rem; margin-bottom: 0.75rem; }
.track-card-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.35rem; color: var(--text); }
.track-card-roles { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.track-card-description { color: var(--text-muted); font-size: 0.9rem; flex-grow: 1; margin-bottom: 1.25rem; }
.track-card-cta {
  font-weight: 700;
  color: var(--track-accent, var(--brand));
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.track-card-cta:hover { text-decoration: underline; }

/* Static attention ring -- no looping animation, so there is nothing that
   moves/blinks for more than 5s to pause (WCAG 2.2.2). The card also carries
   a text label, so the ring is not the only cue (WCAG 1.4.1). */
.action-card-needs-attention {
  box-shadow: 0 0 0 2px #a1560a, 0 0 12px 2px rgba(161, 86, 10, 0.28);
}

.nav-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.nav-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 64px;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
}

.nav-tile-secondary {
  background: white;
  border: 1px solid var(--field-border);
  color: var(--text);
}
.nav-tile-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }

.dashboard-tabs-wrap {
  background: var(--card-bg);
  padding: 0 1.5rem;
}
.dashboard-tabs {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dashboard-tab {
  display: inline-block;
  padding: 0.6rem 0.1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.dashboard-tab:hover { color: var(--brand-dark); }
.dashboard-tab.active { color: var(--brand-dark); border-bottom-color: var(--brand-dark); }
.dashboard-tab-cta { color: var(--brand-dark); }
.dashboard-tab-cta:hover { color: var(--brand); }

.tab-stamp-wrap { position: relative; }
.tab-status-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.6rem;
  transform: rotate(18deg);
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: white;
  pointer-events: none;
}
.tab-status-closed { color: #d21f1f; border: 1.5px solid #d21f1f; }
.tab-status-open { color: #1a7d37; border: 1.5px solid #1a7d37; }

.notification-card {
  background: var(--brand-dark);
  color: white;
  min-height: 90px;
  display: flex;
  align-items: center;
  box-shadow: 0 0 32px rgba(106, 79, 179, 0.45);
}

.stale-pipeline-alert {
  background: #fbe8c6;
  border: 1px solid #e0a428;
  padding: 0.9rem 1.25rem;
}
.stale-pipeline-alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-weight: 700;
  color: #6b4a08;
}
.stale-pipeline-alert-clear {
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: #6b4a08;
  padding: 0.3rem 0.5rem;
}
.stale-pipeline-alert-clear:hover { color: #4a3305; }
.notification-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.retention-chart-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.retention-chart-legend .swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.retention-row { margin-bottom: 1.1rem; }
.retention-row:last-child { margin-bottom: 0; }
.retention-row-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.retention-bar {
  display: flex;
  gap: 2px;
  height: 1.75rem;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}
.retention-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 2px;
}
.retention-bar-empty { padding: 0.4rem 0; font-size: 0.85rem; }

.stock-bar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr minmax(28px, 40px); align-items: center; gap: 0.6rem; margin-bottom: 0.65rem; }
.stock-bar-row:last-child { margin-bottom: 0; }
.stock-bar-label { font-size: 0.85rem; color: var(--text); }
.stock-bar-label .badge { margin-left: 0.4rem; }
.stock-bar-track { height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; }
.stock-bar-fill { height: 100%; border-radius: 7px; background: #2f6fb0; min-width: 2px; }
.stock-bar-fill.low-stock { background: #c0564a; }
.stock-bar-value { font-size: 0.85rem; text-align: right; color: var(--text-muted); font-weight: 600; }

.departures-bar-row { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 0.6rem; margin-bottom: 0.55rem; }
.departures-bar-row:last-child { margin-bottom: 0; }
.departures-bar-label { font-size: 0.85rem; color: var(--text); }
.departures-bar-track { height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; }
.departures-bar-fill { height: 100%; border-radius: 7px; background: #b3590f; min-width: 2px; }
.departures-bar-value { font-size: 0.85rem; text-align: right; color: var(--text-muted); font-weight: 600; }

.forecast-period-block { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.forecast-period-block:first-child { padding-top: 0; border-top: none; }
.forecast-period-heading { font-size: 0.95rem; color: var(--brand-dark); margin: 0 0 0.6rem; }
.forecast-bar-row { margin-bottom: 0.9rem; }
.forecast-bar-row:last-child { margin-bottom: 0; }
.forecast-bar-label { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.forecast-bar-track { position: relative; height: 20px; border-radius: 6px; background: var(--bg); }
.forecast-bar-fill { height: 100%; border-radius: 6px; background: #2f6fb0; }
.forecast-bar-fill.below-target { background: #b3590f; }
.forecast-target-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--brand-dark);
}
.forecast-action { font-size: 0.82rem; margin: 0.4rem 0 0; font-weight: 600; }
.forecast-action.ok { color: #3d6b2c; }
.forecast-action.needs-hire { color: #8a5b0a; }

.milestone-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.milestone-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.milestone-list li:last-child { border-bottom: none; }
.milestone-progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.3rem; }
.milestone-progress-track {
  background: var(--bg);
  border-radius: 999px;
  height: 0.6rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.milestone-progress-fill { height: 100%; border-radius: 999px; }
.notification-card h2 {
  color: white;
  opacity: 0.75;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.4rem;
}
.notification-card .notification-body { width: 100%; }
.notification-row { display: flex; align-items: center; gap: 1rem; }
.notification-see-more { flex-shrink: 0; margin-left: auto; }
.notification-pause { flex-shrink: 0; }
.notification-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
/* Shown instead of the rotating single line when the OS asks for reduced motion. */
.notification-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.notification-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.35rem 0;
}
.notification-list a { color: #fff; text-decoration: underline; }

.placeholder-card {
  border-style: dashed;
  background: #fbfaff;
}
.placeholder-card h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}
.placeholder-card p:last-child { margin-bottom: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
/* Below this width every stats grid stacks to one column, overriding any
   inline grid-template-columns, so nothing forces the page to scroll
   sideways (WCAG 1.4.10). */
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr !important; }
}

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  overflow-wrap: break-word;
  min-width: 0;
}

.stat-tile .value { font-size: 1.8rem; font-weight: 700; color: var(--brand-dark); }
.stat-tile .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; overflow-wrap: break-word; }
.stat-tile-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; text-transform: none; letter-spacing: normal; }
.stat-tile-sublabel { display: block; font-size: 0.55rem; font-weight: normal; letter-spacing: normal; margin-top: 0.1rem; }

a.stat-tile { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
a.stat-tile:hover { border-color: var(--brand); transform: translateY(-2px); }

.stats-overview { display: flex; flex-wrap: wrap; align-items: stretch; gap: 1.25rem; margin-bottom: 2rem; }

.stat-card-single, .stat-cluster, .stat-cluster-side {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bg);
  min-width: 0;
}
.stat-card-single .stat-tile, .stat-cluster .stat-tile, .stat-cluster-side .stat-tile { background: var(--card-bg); }

.stat-card-single { flex: 1 1 180px; display: flex; align-items: center; justify-content: center; }
.stat-card-single .stat-tile { width: 100%; }
.stat-cluster { flex: 3 1 320px; display: flex; flex-direction: column; gap: 1rem; }
.stat-cluster .label { white-space: normal; }
.stat-cluster-row { display: grid; gap: 1rem; }
.stat-cluster-row-4 { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.stat-cluster-row-3 { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.stat-cluster-side { flex: 1 1 160px; display: flex; flex-direction: column; gap: 1rem; }

.stat-tile-divider { border: none; border-top: 1px solid var(--border); margin: 0.6rem 0; }
.stat-tile-description { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin: 0; line-height: 1.35; text-transform: none; letter-spacing: normal; }

@media (max-width: 900px) {
  .stats-overview { flex-direction: column; }
  .stat-card-single { flex: none; }
  .stat-cluster-row-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-cluster-row-3 { grid-template-columns: repeat(1, 1fr); }
  .stat-cluster-side { flex-direction: row; }
}

.target-stat-tile { text-align: center; }
.target-stat-tile .label { margin-bottom: 0.4rem; }
.target-stat-line { font-size: 0.72rem; color: var(--text); margin-bottom: 0.15rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

/* A card holding a data table scrolls it sideways within its own box on
   narrow screens / high zoom, instead of clipping it or forcing the whole
   page to scroll (WCAG 1.4.10 Reflow). The min-width keeps columns legible
   rather than crushing them. */
.card:has(table) { overflow-x: auto; }
.card:has(table) table { min-width: 32rem; }

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

tr:hover td { background: #faf9fc; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-yes { background: #e4f0de; color: #3d6b2c; }
.badge-no { background: #f4ded9; color: #8a3a2c; }
.badge-warn { background: #fbe8c6; color: #8a5b0a; }
.badge-info { background: #dce6f5; color: #1e4b8f; }
.badge-neutral { background: #e5e2ee; color: #595566; }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem 1.5rem;
  margin-bottom: 1.25rem;
}
.view-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.view-value { font-size: 0.95rem; color: var(--text); }

.view-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.25rem; }
.view-actions-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .view-actions-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) { .view-actions-grid { grid-template-columns: 1fr; } }

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0;
}
.action-card h3 { margin-top: 0; }
.action-card p { flex: 1; }
.action-card .btn { margin-top: auto; }

.training-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  border-bottom: 1px solid var(--border);
}
.training-row:last-child { border-bottom: none; }
.training-row-incomplete { background: #f9e8e5; }
.training-row-name { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.training-row-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.missing-info-name {
  color: #b3261e;
  font-weight: 700;
}
.missing-info-flag {
  color: #b3261e;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-primary { background: var(--hammer-red); color: white; }
.btn-primary:hover { background: #c11f33; }
.btn-secondary { background: #e5e2ee; color: var(--text); }
.btn-brand { background: var(--brand-dark); color: white; }
.btn-brand:hover { background: var(--brand); }
.section-divider { border: none; border-top: 2px solid var(--border); margin: 1.25rem 0; }
.btn-danger { background: var(--red); color: white; }
.btn-link { background: transparent; color: var(--brand-dark); padding: 0.3rem 0; }

form .field { margin-bottom: 1rem; }

/* Django renders field errors as <ul class="errorlist" id="id_<field>_error">,
   the id its auto aria-describedby on the invalid input points at. Style it as
   plain red text (WCAG 3.3.1); colour meets 4.5:1 on white and is not the only
   cue -- the message text says what is wrong. */
ul.errorlist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  color: #b0463a;
  font-size: 0.85rem;
  font-weight: 600;
}
ul.errorlist li { margin: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1.25rem;
}
.info-item.span-all { grid-column: 1 / -1; }
.info-item label, .info-item .info-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.info-item span, .info-item p { margin: 0; font-size: 0.92rem; }

.card-compact { padding: 0.9rem 1.25rem; }
.card-compact h2 { margin-bottom: 0.6rem; }
form label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
/* Caption for a radio/checkbox group -- named via aria-labelledby, so it is not
   a <label> element (which would read as an orphaned form label). */
.group-label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
form input[type=text], form input[type=email], form input[type=date], form input[type=url],
form input[type=number], form input[type=password], form input[type=datetime-local],
form select, form textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
}

form input[readonly] {
  background: #eef0f3;
  color: #444;
  cursor: not-allowed;
}

form input[type=datetime-local] {
  padding: 0.85rem 0.6rem;
  font-size: 1.05rem;
}

.password-field-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.password-field-wrap input[type=password], .password-field-wrap input[type=text] {
  padding-right: 3.4rem;
}
.password-toggle-btn {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  background: none;
  border: none;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}
.password-toggle-btn:hover { text-decoration: underline; }

.score-radio-group > div {
  display: flex;
  gap: 0.5rem;
}
.score-radio-group input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.score-radio-group label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: white;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.score-radio-group label:has(input:checked) {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}
form .checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
form .checkbox-row label { margin: 0; font-weight: 500; }
form .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
form .two-col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.work-exp-block { border-top: 1px solid #e5e2ee; padding-top: 1rem; margin-top: 1rem; }
.work-exp-block:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.field ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.field ul li { margin-bottom: 0.35rem; font-weight: normal; }
.field ul input[type="radio"], .field ul input[type="checkbox"] { margin-right: 0.5rem; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-grid-2.wizard-single-col { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }

.wizard-tracker {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.wizard-tracker-step {
  flex: 1 1 0;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  text-align: center;
}
.wizard-tracker-icon { font-size: 1.4rem; line-height: 1; }
.wizard-tracker-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.wizard-tracker-step.active { border-color: var(--brand-dark); background: var(--brand-dark); }
.wizard-tracker-step.active .wizard-tracker-label { color: #fff; }
.wizard-tracker-step.done { border-color: var(--brand); }
.wizard-tracker-step.done .wizard-tracker-label { color: var(--brand-dark); }

@media (max-width: 800px) {
  .wizard-tracker { flex-wrap: wrap; }
  .wizard-tracker-step { min-width: 90px; }
}

.stacked-column { display: flex; flex-direction: column; }

.form-section-title { font-size: 1.3rem; margin: 0 0 1rem; color: var(--brand-dark); }
.form-subheading { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.6rem; color: var(--text); }
.form-subheading:first-child { margin-top: 0; }

fieldset.field-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1rem 0.75rem;
  margin: 0 0 1rem;
}
fieldset.field-group legend {
  padding: 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
form .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 1rem 0; }

.toggle-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}
.toggle-btn-group input[type=checkbox],
.toggle-btn-group input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: white;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.toggle-btn-group input:checked + .toggle-btn {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}
/* The real radio/checkbox is visually hidden, so put the keyboard focus ring
   on the button the user actually sees (WCAG 2.4.7). */
.toggle-btn-group input:focus-visible + .toggle-btn,
.score-radio-group label:has(input:focus-visible) {
  outline: 3px solid var(--brand-dark);
  outline-offset: 2px;
}

.cross-trained-section { margin-top: 0.75rem; }
.cross-trained-heading {
  color: #8f4e12;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}
.toggle-btn-orange { border-color: #d97b1f; color: #8f4e12; }
.toggle-btn-group input:checked + .toggle-btn-orange { background: #a8571a; border-color: #a8571a; color: white; }
.badge-orange { background: #fbe3c6; color: #8f4e12; }

.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.modal-unmatched-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.modal-unmatched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  font-weight: 600;
}

form select.btn-select {
  width: auto;
  background: #e5e2ee;
  font-weight: 600;
  cursor: pointer;
}

.uniform-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.uniform-main-btn {
  justify-content: center;
  border-radius: 8px 8px 0 0;
}
.uniform-not-needed {
  display: flex;
}
/* Compact secondary control, but still a >=24px pointer target (WCAG 2.5.8). */
.toggle-btn-sm {
  min-height: 24px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}
.uniform-not-needed .toggle-btn-sm {
  flex: 1;
  justify-content: center;
  border-radius: 0 0 8px 8px;
}
.uniform-item:has(.uniform-not-needed input:checked) .uniform-main-btn {
  position: relative;
  color: var(--text-muted);
  background: white;
  border-color: var(--border);
}
.uniform-item:has(.uniform-not-needed input:checked) .uniform-main-btn::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: 50%;
  border-top: 2px solid #d21f1f;
  transform: rotate(-8deg);
}
.equip-action-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.equip-action-group form {
  display: flex;
}
.equip-issue-btn {
  flex: 1;
  width: 100%;
  text-align: center;
  border-radius: 8px 8px 0 0;
}
.equip-not-needed-btn {
  flex: 1;
  border-radius: 0 0 8px 8px;
  min-height: 24px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.inline-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.inline-select-chip .inline-select-label {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.evaluation-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fbfaff;
}

.checklist-list { list-style: none; margin: 0; padding: 0; }
.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.checklist-row:last-child { border-bottom: none; }
.checklist-checkbox {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0;
  /* >=24px pointer target (WCAG 2.5.8) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
}
.checklist-label { font-weight: 600; }
.checklist-row-done .checklist-label { color: var(--text-muted); text-decoration: line-through; }

.decision-followup-card {
  border: 2px solid #e08a1e;
  background: #fff6ea;
}
.decision-followup-card h2 {
  color: #b5620c;
}

.pipeline-card-header {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.clickable-card { cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.clickable-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(61, 42, 99, 0.12); }
tr.clickable-card:hover { background: var(--bg); }

.stage-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stage-mini-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: white;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.stage-btn-active {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}
.stage-btn-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}
.interviewing-picker {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.interviewing-picker input[type=date],
.interviewing-picker input[type=datetime-local] {
  padding: 0.35rem;
  border: 1px solid var(--field-border);
  border-radius: 6px;
}

.messages { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.messages li { padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; background: #e4f0de; color: #3d6b2c; }
.messages li.error { background: #f4ded9; color: #8a3a2c; }

body.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.login-banner {
  background: var(--brand-dark);
  border-bottom: 4px solid var(--hammer-red);
  color: white;
  padding: 2rem 1.5rem;
}

.login-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.login-banner-logo {
  height: 64px;
  width: auto;
  flex-shrink: 0;
  background: white;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

.login-banner-text h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.6rem;
  color: white;
}

.login-banner-text p {
  margin: 0;
  color: #e6ddf5;
  font-size: 0.95rem;
  max-width: 70ch;
}

.login-body {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .login-body { grid-template-columns: 1fr; }
  .login-banner-inner { flex-direction: column; text-align: center; }
}

.login-info-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-card h2 {
  color: var(--brand-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.info-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text);
}
.info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-item strong { color: var(--brand-dark); }

.login-form-column .login-card {
  position: sticky;
  top: 1.5rem;
}

.login-card h2 {
  text-align: center;
  color: var(--brand-dark);
  margin-top: 0;
}

.login-reset-note {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-google:hover { border-color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.login-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.empty-state { color: var(--text-muted); padding: 2rem; text-align: center; }

/* A table that shows about 5 rows, then scrolls -- header stays put. */
.scroll-list-5 {
  max-height: 14.5rem;
  overflow-y: auto;
  border: 1px solid var(--field-border);
  border-radius: 6px;
}
.scroll-list-5 table { margin: 0; }
.scroll-list-5 thead th {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

/* ── Two-step sign-in (mfa app) ─────────────────────────────────────── */
.messages li.warning { background: #fbe8c6; color: #8a5b0a; }
.mfa-page { max-width: 760px; }
.mfa-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.mfa-card { margin-bottom: 1rem; }
.mfa-card h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.mfa-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.mfa-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem;
  border: 1px solid #e5e2ee; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.mfa-item-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; }
.mfa-item-actions summary { list-style: none; }
.mfa-item-actions summary::-webkit-details-marker { display: none; }
.mfa-inline-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.mfa-small { font-size: 0.85rem; }
.mfa-remember { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin-bottom: 1rem; }
.mfa-remember input { width: auto; min-width: 24px; min-height: 24px; }
.mfa-other-ways { margin-top: 1.25rem; }
.mfa-other-ways summary { cursor: pointer; color: var(--brand-dark); padding: 0.3rem 0; }
.mfa-other-ways form { margin-top: 0.5rem; }
.mfa-other-ways form .btn { width: 100%; text-align: left; }
.mfa-link-button { border: none; background: none; cursor: pointer; padding: 0; min-height: 24px; }
.mfa-steps { padding-left: 1.25rem; margin: 0; }
.mfa-steps > li { margin-bottom: 1.25rem; }
.mfa-steps > li > strong { display: block; margin-bottom: 0.25rem; }
.mfa-qr { max-width: 220px; margin: 1rem auto; background: #fff; padding: 0.5rem; }
.mfa-qr svg { width: 100%; height: auto; display: block; }
.mfa-secret { display: block; padding: 0.6rem; background: #f3f1f7; border-radius: 6px; letter-spacing: 0.05rem; word-break: break-all; }
.mfa-codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.mfa-codes code { display: block; text-align: center; padding: 0.5rem; background: #f3f1f7; border-radius: 6px; font-size: 1rem; }
.mfa-events { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; color: var(--text-muted); }
@media print {
  .mfa-item-actions, .topbar, .site-header { display: none !important; }
}

/* ── Activity log ───────────────────────────────────────────────────── */
.activity-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; align-items: end; }
.activity-filters .field { margin-bottom: 0; }
.activity-filter-buttons { display: flex; gap: 0.5rem; }
