:root {
  --hr-surface: #ffffff;
  --hr-soft: #f5f7fb;
  --hr-border: #d8dee8;
  --hr-border-accent: #9ec5fe;
  --hr-muted: #5c6678;
  --hr-text: #1f2937;
  --hr-admin: #495057;
  --hr-user: #0d6efd;
  --hr-brand: #174ea6;
  --hr-shell-admin-bg: #3f4752;
  --hr-focus: #ffbf47;
  --hr-highlight-bg: #fff3cd;
  --hr-highlight-current-bg: #ffc107;
  --hr-highlight-current-ring: #856404;
  --hr-qual-essential: #174ea6;
  --hr-qual-asset: #6f42c1;
  --hr-qual-organizational: #fd7e14;
  --hr-qual-operational: #6c757d;
  --hr-qual-conditions: #495057;
  --hr-qual-official-language: #0dcaf0;
  /* Links: Bootstrap's default #0d6efd is just under 4.5:1 on the light-grey panels;
     this darker blue meets WCAG 2.1 AA contrast on white and on #f5f7fb / #f8f9fa. */
  --bs-link-color: #0a58ca;
  --bs-link-color-rgb: 10, 88, 202;
  --bs-link-hover-color: #084298;
  --bs-link-hover-color-rgb: 8, 66, 152;
}

/* The HTML `hidden` attribute must win over Bootstrap display utilities
   (e.g. `d-flex` is `display: flex !important`), otherwise scripts that set
   el.hidden = true leave the element visible. */
[hidden] {
  display: none !important;
}

/* Attest icon tile in dark navigation bars (the white tile keeps the mark legible). */
.hr-brand-mark {
  border-radius: 0.4rem;
  background: #fff;
  flex-shrink: 0;
}

body.hr-app {
  color: var(--hr-text);
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28rem),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
}

.hr-shell {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.hr-shell-user {
  background: var(--hr-brand);
}

.hr-shell-admin {
  background: var(--hr-shell-admin-bg);
}

.hr-shell .navbar-brand {
  letter-spacing: -0.01em;
}

.hr-nav {
  gap: 0.35rem;
}

.hr-nav a {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.1;
}

.hr-nav a:not(.btn) {
  color: rgba(255, 255, 255, 0.82);
}

.hr-nav a:hover,
.hr-nav a.hr-active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--hr-surface);
}

.hr-nav a.text-dark:hover,
.hr-nav a.text-dark.hr-active {
  background: rgba(0, 0, 0, 0.08);
}

.hr-admin-nav a.btn {
  border-radius: 999px;
}

.hr-admin-nav a.hr-active,
.hr-admin-nav a.btn-light {
  color: #212529;
  background: var(--hr-surface);
  border-color: var(--hr-surface);
}

.hr-page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hr-page-kicker {
  color: var(--hr-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.hr-page-title {
  margin: 0;
  letter-spacing: -0.02em;
}

.hr-page-subtitle {
  color: var(--hr-muted);
  margin: 0.25rem 0 0;
  max-width: 62rem;
}

.hr-card {
  border: 1px solid rgba(216, 222, 232, 0.95);
  border-radius: 0.75rem;
  box-shadow: 0 0.4rem 1.2rem rgba(15, 23, 42, 0.05);
}

.hr-card .card-header {
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

.hr-guidance {
  border: 1px solid var(--hr-border);
  border-left: 4px solid var(--hr-user);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
}

.hr-guidance summary {
  cursor: pointer;
  list-style: none;
}

.hr-guidance summary::-webkit-details-marker {
  display: none;
}

.hr-guidance summary::after {
  content: attr(data-show-label, "Show details");
  float: right;
  color: var(--hr-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.hr-guidance[open] summary::after {
  content: attr(data-hide-label, "Hide details");
}

.hr-action-card {
  border: 1px solid var(--hr-border);
  border-radius: 0.75rem;
  background: var(--hr-surface);
}

.hr-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--hr-border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

textarea.hr-auto-translating,
input.hr-auto-translating {
  background-image: linear-gradient(
    90deg,
    rgba(13, 110, 253, 0.06) 0%,
    rgba(13, 110, 253, 0.12) 50%,
    rgba(13, 110, 253, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: hr-translate-pulse 1.2s ease-in-out infinite;
}

@keyframes hr-translate-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.hr-table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.9rem;
}

.hr-table-search {
  max-width: 28rem;
}

.hr-muted-box {
  border: 1px solid var(--hr-border);
  border-radius: 0.6rem;
  background: var(--hr-soft);
  padding: 0.75rem 0.9rem;
}

.hr-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hr-status-strip .badge {
  font-weight: 600;
}

.hr-bilingual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hr-long-select {
  min-height: 2.4rem;
}

.hr-admin-table td,
.hr-admin-table th {
  vertical-align: middle;
}

.hr-criterion-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.hr-empty-state {
  border: 1px dashed var(--hr-border);
  border-radius: 0.75rem;
  background: var(--hr-surface);
  padding: 1.25rem;
  color: var(--hr-muted);
  text-align: center;
}

/* Full-width workspace (Screening, SOMC Builder, Assessment Guide, admin tables, etc.) */
.hr-page-main,
.scr-page-main {
  max-width: none;
}

.hr-page-shell {
  max-width: none;
}

/* Workspace shell (sidebar + module content) — readable edge gutters */
.hr-workspace-gutter-x {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (min-width: 768px) {
  .hr-workspace-gutter-x {
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 1200px) {
  .hr-workspace-gutter-x {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 1400px) {
  .hr-workspace-gutter-x {
    padding-left: max(2.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(2.5rem, env(safe-area-inset-right, 0px));
  }
}

.workspace-container {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 56px);
  margin: 0;
  width: 100%;
}

.workspace-sidebar {
  width: 320px;
  background: #fff;
  border-right: 1px solid var(--hr-border, #dee2e6);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.workspace-sidebar-toggle {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  line-height: 1;
  border: 1px solid var(--hr-border, #dee2e6);
  background: #fff;
  color: #495057;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-sidebar-toggle:hover {
  background: #e9ecef;
  color: #212529;
}

.workspace-sidebar-toggle-expand {
  display: none;
  position: sticky;
  top: 0.75rem;
  align-self: flex-start;
  z-index: 5;
  margin: 0.75rem 0 0 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--hr-border, #dee2e6);
  background: #fff;
  color: #495057;
  border-radius: 0.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.workspace-sidebar-toggle-expand:hover {
  background: #e9ecef;
}

.workspace-container.workspace-sidebar-collapsed .workspace-sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.workspace-container.workspace-sidebar-collapsed .workspace-sidebar-toggle-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f8f9fa;
}

.workspace-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hr-border, #dee2e6);
  background: #f8f9fa;
}

.workspace-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.workspace-header-top h6 {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.workspace-header h6,
.workspace-header small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.workspace-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.workspace-nav .nav-link {
  color: #495057;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  display: block;
  text-decoration: none;
}

.workspace-nav .nav-link:hover:not(.disabled) {
  background: #e9ecef;
}

.workspace-nav .nav-link.active {
  color: #1a4fb0; /* WCAG AA: #0d6efd was 3.79:1 on this #e9ecef active background */
  background: #e9ecef;
  border-left-color: #1a4fb0;
}

.workspace-nav .nav-link.disabled {
  color: #adb5bd;
  pointer-events: none;
  cursor: not-allowed;
}

.workspace-phase-label {
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.workspace-lock-hint {
  font-size: 0.68rem;
  font-weight: normal;
  line-height: 1.2;
}

/* Phase progress stepper */
.workspace-phase-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--hr-border, #dee2e6);
  background: #f8f9fa;
  gap: 0;
}

.workspace-phase-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 0;
}

.workspace-phase-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: 62%;
  width: 76%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}

.workspace-phase-node.complete:not(:last-child)::after { background: #198754; }
.workspace-phase-node.active:not(:last-child)::after   { background: #0d6efd; }

.workspace-phase-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.workspace-phase-node.active   .workspace-phase-chip { border-color: #0d6efd; background: #0d6efd; color: #fff; }
.workspace-phase-node.complete .workspace-phase-chip { border-color: #198754; background: #198754; color: #fff; }
.workspace-phase-node.locked   .workspace-phase-chip { border-color: #adb5bd; background: #e9ecef; color: #6c757d; font-size: 0.55rem; }

.workspace-phase-lbl {
  font-size: 0.58rem;
  text-align: center;
  margin-top: 3px;
  color: #495057; /* WCAG AA: darker grey for this small (0.58rem) label */
  line-height: 1.15;
  max-width: 3.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* WCAG AA (small text needs 4.5:1): darkened from #0d6efd / #198754. */
.workspace-phase-node.active   .workspace-phase-lbl { color: #1a4fb0; font-weight: 600; }
.workspace-phase-node.complete .workspace-phase-lbl { color: #0f5132; }

/* Continue / next-step bar */
.workspace-continue-bar {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--hr-border, #dee2e6);
  background: #fff;
}

.workspace-continue-bar .btn {
  font-size: 0.8rem;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.workspace-toolbar {
  padding: 0.75rem 0 0.85rem;
  border-bottom: 1px solid var(--hr-border, #dee2e6);
  background: #fff;
}

.workspace-toolbar > .hr-workspace-gutter-x {
  width: 100%;
}

.workspace-priority-box {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--hr-border, #dee2e6);
  background: #fff8e7;
}

.workspace-content-area {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: visible;
  background: #fff;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.workspace-content-area .container-fluid,
.workspace-content-area .row {
  max-width: 100%;
}

.scr-review-layout .scr-review-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0;
  height: calc(100vh - 18rem);
  min-height: 32rem;
  border-top: 1px solid var(--hr-border);
}

@media (min-width: 1200px) {
  .scr-review-layout .scr-review-grid {
    grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr) minmax(0, 1.35fr);
    height: calc(100vh - 18rem);
    min-height: 32rem;
  }

  .scr-review-pane {
    max-height: calc(100vh - 16rem);
  }

  .scr-review-evidence-text {
    max-height: min(28rem, calc(100vh - 22rem));
  }

  .scr-raw-data-text {
    max-height: min(36rem, calc(100vh - 20rem));
  }

  .scr-review-actions {
    overflow-y: auto;
  }
}

@media (min-width: 1600px) {
  .scr-review-layout .scr-review-grid {
    grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

.scr-review-candidates {
  border-right: 1px solid var(--hr-border);
  background: var(--hr-soft);
  padding: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.scr-review-candidates .scr-candidate-list-panel {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
}

.scr-review-pane {
  padding: 0.75rem 1rem;
  overflow-y: auto;
  max-height: 28rem;
}

.scr-review-pane + .scr-review-pane {
  border-left: 1px solid var(--hr-border);
}

.scr-review-placeholder {
  grid-column: 2 / 4;
  padding: 2rem 1rem;
  color: var(--hr-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scr-review-evidence-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.45;
  background: var(--hr-surface);
  border: 1px solid var(--hr-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  max-height: 18rem;
  overflow-y: auto;
}

.scr-raw-data-text {
  max-height: 28rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

.scr-raw-highlight {
  background-color: var(--hr-highlight-bg);
  padding: 0 0.05em;
  border-radius: 2px;
}

.scr-raw-highlight-current {
  background-color: var(--hr-highlight-current-bg);
  box-shadow: 0 0 0 1px var(--hr-highlight-current-ring);
}

.scr-review-actions {
  grid-column: 2 / 4;
  border-top: 1px solid var(--hr-border);
  padding: 0.75rem 1rem;
  background: var(--hr-surface);
  overflow-y: auto;
}

.scr-psc-status-unreviewed { background-color: var(--bs-secondary, #6c757d); }
.scr-psc-status-screened_in { background-color: var(--bs-success, #198754); }
.scr-psc-status-screened_out { background-color: var(--bs-danger, #dc3545); }
.scr-psc-status-flagged { background-color: var(--bs-orange, #fd7e14); }

.scr-candidate-link .badge {
  font-size: 0.7rem;
  font-weight: 500;
}

.scr-candidate-link.active .badge.text-bg-secondary,
.scr-candidate-link.active .badge.text-bg-warning {
  filter: brightness(0.92);
}

.scr-candidate-stream-pick {
  text-decoration: none;
  border-radius: 0.25rem;
}

.scr-candidate-stream-pick:hover {
  background-color: rgba(13, 110, 253, 0.08);
}

.scr-candidate-stream-row-active {
  outline: 1px solid var(--hr-user);
  outline-offset: 2px;
}

#scr-review-stream-toolbar .btn-group .btn {
  white-space: normal;
  text-align: left;
}

.scr-candidate-streams {
  font-size: 0.8rem;
}

.scr-candidate-stream-row {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid transparent;
}

.scr-candidate-link.active .scr-candidate-stream-row {
  background: rgba(255, 255, 255, 0.9);
}

.scr-candidate-stream-row-active {
  border-color: var(--hr-user);
  background: rgba(13, 110, 253, 0.06);
}

.scr-candidate-stream-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.scr-candidate-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.scr-candidate-metric .badge {
  font-size: 0.68rem;
  font-weight: 500;
}

.scr-candidate-final-panel {
  margin-top: 0.65rem;
  padding: 0.65rem 0.5rem 0.5rem;
  border-top: 1px dashed var(--hr-border);
  background: transparent;
}

.scr-candidate-link.active .scr-candidate-final-panel {
  border-top-color: var(--hr-border-accent);
}

.scr-candidate-final-panel .btn {
  font-size: 0.78rem;
}

@media (max-width: 991.98px) {
  .scr-review-layout .scr-review-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .scr-review-candidates {
    border-right: none;
    border-bottom: 1px solid var(--hr-border);
    max-height: 14rem;
  }

  .scr-review-pane + .scr-review-pane {
    border-left: none;
    border-top: 1px solid var(--hr-border);
  }

  .scr-review-placeholder {
    grid-column: 1;
  }

  .scr-review-actions {
    grid-column: 1;
  }
}

.hr-skip-link {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 1050;
  padding: 0.35rem 0.75rem;
  background: var(--hr-surface);
  border: 2px solid var(--hr-brand);
  border-radius: 0.25rem;
  color: var(--hr-brand);
  font-weight: 600;
  text-decoration: none;
}

.hr-skip-link:focus {
  outline: 3px solid var(--hr-focus);
  outline-offset: 2px;
}

.hr-gc-footer {
  border-top: 1px solid var(--hr-border);
  background: rgba(255, 255, 255, 0.92);
}

.somc-section-card.somc-qual-essential {
  border-left-color: var(--hr-qual-essential);
}

.somc-section-card.somc-qual-asset {
  border-left-color: var(--hr-qual-asset);
  background: linear-gradient(90deg, rgba(111, 66, 193, 0.04), transparent 12rem);
}

.somc-section-card.somc-qual-organizational {
  border-left-color: var(--hr-qual-organizational);
}

.somc-section-card.somc-qual-operational {
  border-left-color: var(--hr-qual-operational);
}

.somc-section-card.somc-qual-conditions,
.somc-section-card.somc-qual-official_language {
  border-left-color: var(--hr-qual-conditions);
}

.badge.somc-qual-badge-essential { background-color: var(--hr-qual-essential); }
.badge.somc-qual-badge-asset { background-color: var(--hr-qual-asset); }
.badge.somc-qual-badge-organizational { background-color: var(--hr-qual-organizational); }
.badge.somc-qual-badge-operational { background-color: var(--hr-qual-operational); }
.badge.somc-qual-badge-conditions { background-color: var(--hr-qual-conditions); }
.badge.somc-qual-badge-official_language { background-color: var(--hr-qual-official-language); color: #000; }

.scr-not-screened-panel {
  border: 1px dashed var(--hr-border);
  border-radius: 0.5rem;
  background: var(--hr-soft);
  padding: 0.75rem 1rem;
}

.scr-ev-tab[aria-selected="true"] {
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .hr-nav {
    width: 100%;
  }

  .hr-nav a {
    padding: 0.4rem 0.55rem;
  }

  .hr-bilingual-grid {
    grid-template-columns: 1fr;
  }

  .hr-guidance summary::after {
    float: none;
    display: block;
    margin-top: 0.25rem;
  }
}

.hr-go-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1050;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.hr-go-to-top:hover {
  background-color: var(--bs-primary-dark, #0b5ed7);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.hr-go-to-top.show { display: flex; }

/*
 * WET-BOEW ships Bootstrap 3 modal/fade rules (.fade { opacity:0 }, .fade.in).
 * Bootstrap 5 uses .fade.show instead of .in. Without these overrides, BS5 modals
 * can show only the grey backdrop with an invisible dialog.
 */
.modal.fade.show,
.modal.show {
  opacity: 1;
  visibility: visible;
}
.modal.fade.show .modal-dialog,
.modal.show .modal-dialog {
  transform: none;
  opacity: 1;
  visibility: visible;
}
.modal-backdrop.show,
.modal-backdrop.fade.show {
  opacity: 0.5;
}

/* ============================================================================
   2026 UI REFRESH
   A cohesive presentation layer that modernizes the whole app at once: a calmer
   palette, tighter/consistent buttons, softer cards, refined form controls,
   and gentle micro-interactions. Loaded last, so it overrides Bootstrap/WET and
   the earlier hr-ui rules. Purely visual — no markup or behaviour changes.
   ========================================================================== */
:root {
  /* Calmer, slightly cool neutral scale (not pure Bootstrap greys) */
  --hr-surface: #ffffff;
  --hr-soft: #f5f7fb;
  --hr-canvas: #eef2f7;
  --hr-sunken: #f8fafc;
  --hr-border: #e5e9f0;
  --hr-border-strong: #d5dbe6;
  --hr-text: #1b2432;
  --hr-muted: #5b6675;
  --hr-faint: #8a94a4;

  /* Refined, trustworthy primary (desaturated from Bootstrap #0d6efd) */
  --hr-user: #2f5bd0;
  --hr-user-hover: #2749ad;
  --hr-brand: #1e3f8f;
  --hr-primary-soft: rgba(47, 91, 208, 0.09);

  /* Remap Bootstrap's own primary so text-primary / bg-primary / border-primary
     and any var(--bs-primary) consumers (e.g. dashboard funnel bars) all pick up
     the refined blue — one change harmonizes every primary-coloured element. */
  --bs-primary: #2f5bd0;
  --bs-primary-rgb: 47, 91, 208;
  --bs-link-color: #2749ad;
  --bs-link-hover-color: #1e3f8f;

  /* Semantic colours, desaturated for a professional 2026 tone */
  --hr-success: #157f56;
  --hr-success-hover: #106647;
  /* Darkened from #b06e0c (4.1:1) so white button text and amber text on light
     panels both meet WCAG 2.1 AA (>= 4.5:1). */
  --hr-warning: #9a5f00;
  --hr-warning-hover: #7a4a00;
  --hr-danger: #c33f2d;
  --hr-danger-hover: #a63424;

  /* Soft, layered shadows — the core of the modern feel */
  --hr-shadow-xs: 0 1px 2px rgba(20, 30, 48, 0.05);
  --hr-shadow-sm: 0 1px 3px rgba(20, 30, 48, 0.07), 0 1px 2px rgba(20, 30, 48, 0.04);
  --hr-shadow-md: 0 4px 14px rgba(20, 30, 48, 0.09);
  --hr-shadow-lg: 0 12px 32px rgba(20, 30, 48, 0.12);

  /* Radius scale */
  --hr-radius-sm: 7px;
  --hr-radius-md: 12px;
  --hr-radius-lg: 16px;
}

body.hr-app {
  background: var(--hr-canvas) !important;
  color: var(--hr-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.002em;
}

/* --- Typography polish ---------------------------------------------------- */
h1, .h1, h2, .h2, h3, .h3 { letter-spacing: -0.012em; color: var(--hr-text); }
/* A navbar brand often carries .h1; the heading colour above turned it dark-on-dark
   on coloured/dark navbars. Restore the navbar's own brand colour (light on dark). */
.navbar .navbar-brand, .navbar .navbar-brand.h1 { color: var(--bs-navbar-brand-color); }
.text-muted { color: var(--hr-muted) !important; }

/* --- Buttons: tighter, cohesive, clear hierarchy ------------------------- */
.btn {
  --bs-btn-padding-y: 0.44rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.9rem;
  --bs-btn-font-weight: 560;
  --bs-btn-border-radius: var(--hr-radius-sm);
  line-height: 1.25;
  letter-spacing: 0.005em;
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .04s ease;
}
.btn:active { transform: translateY(0.5px); }
.btn-lg {
  --bs-btn-padding-y: 0.58rem;
  --bs-btn-padding-x: 1.15rem;
  --bs-btn-font-size: 0.98rem;
}
.btn-sm {
  --bs-btn-padding-y: 0.28rem;
  --bs-btn-padding-x: 0.66rem;
  --bs-btn-font-size: 0.8rem;
}

.btn-primary {
  --bs-btn-bg: var(--hr-user); --bs-btn-border-color: var(--hr-user);
  --bs-btn-hover-bg: var(--hr-user-hover); --bs-btn-hover-border-color: var(--hr-user-hover);
  --bs-btn-active-bg: var(--hr-user-hover); --bs-btn-active-border-color: var(--hr-user-hover);
  box-shadow: var(--hr-shadow-xs);
}
.btn-primary:hover { box-shadow: var(--hr-shadow-sm); }
.btn-success {
  --bs-btn-bg: var(--hr-success); --bs-btn-border-color: var(--hr-success);
  --bs-btn-hover-bg: var(--hr-success-hover); --bs-btn-hover-border-color: var(--hr-success-hover);
  --bs-btn-active-bg: var(--hr-success-hover); --bs-btn-active-border-color: var(--hr-success-hover);
}
.btn-warning {
  --bs-btn-bg: var(--hr-warning); --bs-btn-border-color: var(--hr-warning);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-hover-bg: var(--hr-warning-hover); --bs-btn-hover-border-color: var(--hr-warning-hover);
  --bs-btn-active-bg: var(--hr-warning-hover); --bs-btn-active-border-color: var(--hr-warning-hover);
}
.btn-danger {
  --bs-btn-bg: var(--hr-danger); --bs-btn-border-color: var(--hr-danger);
  --bs-btn-hover-bg: var(--hr-danger-hover); --bs-btn-hover-border-color: var(--hr-danger-hover);
}
/* Outline / secondary actions read as quiet, not competing with primaries */
.btn-outline-secondary {
  --bs-btn-color: var(--hr-muted); --bs-btn-border-color: var(--hr-border-strong);
  --bs-btn-hover-bg: var(--hr-soft); --bs-btn-hover-border-color: var(--hr-border-strong);
  --bs-btn-hover-color: var(--hr-text);
  --bs-btn-active-bg: var(--hr-soft); --bs-btn-active-color: var(--hr-text); --bs-btn-active-border-color: var(--hr-border-strong);
}
.btn-outline-primary {
  --bs-btn-color: var(--hr-user); --bs-btn-border-color: var(--hr-user);
  --bs-btn-hover-bg: var(--hr-user); --bs-btn-hover-border-color: var(--hr-user);
  --bs-btn-active-bg: var(--hr-user-hover); --bs-btn-active-border-color: var(--hr-user-hover);
}

/* --- Cards: lighter borders, soft shadow, refined radius ------------------ */
.card, .hr-card {
  border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-md);
  box-shadow: var(--hr-shadow-sm);
  background: var(--hr-surface);
}
.card { --bs-card-border-color: var(--hr-border); }
.shadow-sm { box-shadow: var(--hr-shadow-sm) !important; }
.shadow { box-shadow: var(--hr-shadow-md) !important; }
.card .card-header, .hr-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--hr-border);
  font-weight: 600;
  letter-spacing: -0.005em;
}
/* Soften nested boxes: cards inside cards lose their heavy chrome */
.card .card, .hr-card .card {
  box-shadow: none;
  border-color: var(--hr-border);
  background: var(--hr-sunken);
}

/* --- Guidance panels: drop the dated thick left bar for a soft tint ------- */
.hr-guidance {
  border: 1px solid var(--hr-border);
  border-left: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-md);
  background: var(--hr-primary-soft);
}

/* --- Form controls: crisp, refined, no heavy inset ----------------------- */
.form-control, .form-select {
  border-color: var(--hr-border-strong);
  border-radius: var(--hr-radius-sm);
  padding: 0.46rem 0.7rem;
  font-size: 0.92rem;
  color: var(--hr-text);
  background-color: var(--hr-surface);
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: var(--hr-faint); }
.form-control:focus, .form-select:focus {
  border-color: var(--hr-user);
  box-shadow: 0 0 0 3px var(--hr-primary-soft);
}
.form-control:disabled, .form-select:disabled,
.form-control[readonly] {
  background-color: var(--hr-sunken);
  color: var(--hr-muted);
}
.form-label { font-weight: 600; font-size: 0.86rem; color: var(--hr-text); margin-bottom: 0.35rem; }

/* --- Badges & chips ------------------------------------------------------- */
.badge { font-weight: 600; letter-spacing: 0.01em; border-radius: 999px; padding: 0.34em 0.68em; }
/* Inline code / reference-code chips: refined neutral-blue instead of WET pink */
code, .hr-ref-chip, .hr-reference-code {
  color: var(--hr-user);
  background: var(--hr-primary-soft);
  border-radius: var(--hr-radius-sm);
  padding: 0.08rem 0.42rem;
  font-weight: 600;
}

/* --- Dashboard funnel bars: refined primary + softer track --------------- */
.sd-funnel-bar { background: var(--hr-user) !important; border-radius: 5px; }
.sd-funnel-bar-wrap { background: var(--hr-soft) !important; border-radius: 5px; }

/* --- Top navigation shell: sophisticated slate, quiet nav buttons -------- */
.hr-shell-user, .hr-shell.hr-shell-user { background: #1b2330 !important; }
.hr-shell .navbar-brand { font-weight: 650; letter-spacing: -0.01em; }
.hr-shell .btn-outline-light {
  --bs-btn-border-color: rgba(255,255,255,0.28);
  --bs-btn-color: #eef2f7;
  --bs-btn-hover-bg: rgba(255,255,255,0.12);
  --bs-btn-hover-border-color: rgba(255,255,255,0.4);
}

/* --- Analytics numbers: refined, calmer, tabular ------------------------- */
#sd-analytics-card { background: var(--hr-surface) !important; border: 1px solid var(--hr-border); }
#sd-analytics-active, #sd-analytics-cands, #sd-analytics-pass {
  font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--hr-text) !important;
}
.display-4, .display-5 { font-weight: 700; letter-spacing: -0.02em; }

/* --- Tables: lighter, more breathable ------------------------------------ */
.table { --bs-table-border-color: var(--hr-border); }
.table > :not(caption) > * > * { padding: 0.6rem 0.75rem; }
/* Exclude dark theads (table-dark supplies its own light text; a forced muted
   colour here dropped contrast to ~2.6:1). Darkened for colour-tinted headers. */
.table thead:not(.table-dark) th {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: #3f4857; font-weight: 700; border-bottom-color: var(--hr-border-strong);
}

/* --- Workspace sidebar: fix status-badge clipping, refine spacing -------- */
.workspace-sidebar .badge,
.workspace-sidebar [class*="badge"] {
  white-space: normal;
  line-height: 1.25;
  text-align: left;
  display: inline-block;
  max-width: 100%;
}

/* --- Focus visibility (kept strong for accessibility) -------------------- */
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
a:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--hr-user);
  outline-offset: 2px;
}

/* --- Dashboard "how this works" first-run orientation card --------------- */
.sd-flow-card { background: var(--hr-primary-soft); border-color: var(--hr-border); }
.sd-flow-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.85rem 1rem;
}
.sd-flow-step { display: flex; gap: 0.6rem; align-items: flex-start; }
.sd-flow-step > div { display: flex; flex-direction: column; }
.sd-flow-num {
  flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--hr-user); color: #fff; font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.sd-flow-label { font-weight: 650; font-size: 0.9rem; color: var(--hr-text); }
.sd-flow-desc { font-size: 0.8rem; color: var(--hr-muted); line-height: 1.4; margin-top: 0.1rem; }
@media (max-width: 800px) {
  .sd-flow-steps { grid-template-columns: 1fr; gap: 0.7rem; }
}

/* --- SOMC inline criterion edit ------------------------------------------ */
.somc-edit { line-height: 1; }
.somc-editing { background: var(--hr-sunken); border-radius: var(--hr-radius-sm); }
.somc-inline-edit {
  background: var(--hr-surface);
  border: 1px solid var(--hr-border-strong);
  border-radius: var(--hr-radius-sm);
  padding: 0.75rem 0.85rem;
  margin-top: 0.6rem;
}
.somc-inline-edit textarea { resize: vertical; }
.somc-inline-edit .form-check-inline { margin-right: 1.1rem; }

/* --- Accessibility (WCAG 2.1 AA) ----------------------------------------- */
/* The admin nav carries Bootstrap's bg-secondary (#6c757d), whose !important
   beat the intended darker shell — that dropped light nav text below 4.5:1.
   Force the darker shell so the light text clears AA (~8:1). */
.navbar.hr-shell-admin { background-color: var(--hr-shell-admin-bg) !important; }
/* Keyboard access for horizontally-scrollable tables (scrollable-region-focusable). */
.table-responsive[tabindex], .sd-cand-wrap[tabindex] { outline-offset: 2px; }
