/* ---------------------------------------------------------------------------
 * Cyber Role Competency Generator — Phase 7 design system
 * Teal-based, flat, professional. All component styles reference the tokens
 * defined in :root so future phases stay consistent.
 * ------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces — near-black with subtle layering */
  --bg: #0b0f14;           /* page background */
  --panel: #121821;        /* card / panel surface */
  --panel-muted: #0e141c;  /* recessed surface */
  --line: #1f2a37;         /* default border */
  --line-strong: #2a3645;  /* hover/emphasis border */

  /* Text */
  --text: #e6edf3;         /* primary text — off-white */
  --text-muted: #8b96a6;   /* secondary text */
  --text-soft: #5f6b7d;    /* tertiary / placeholders */

  /* Brand — cyan/electric blue accent */
  --primary: #22d3ee;       /* cyan-400 */
  --primary-dark: #06b6d4;  /* cyan-500 — hover */
  --primary-fade: #0c2630;  /* very dark cyan wash for hover bg */
  --primary-soft: #134254;  /* dark cyan tint for borders */

  /* Semantic — tuned for dark mode contrast */
  --success: #4ade80;
  --success-bg: #0f2a1c;
  --warning: #fbbf24;
  --warning-bg: #2a1f0a;
  --danger: #f87171;
  --danger-bg: #2a1213;
  --info: #60a5fa;
  --info-bg: #0f1f33;
  --accent: #fb923c;       /* AI / generated — coral-orange */
  --accent-bg: #2a1810;

  /* Effects — minimal in dark mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Layout */
  --appbar-h: 60px;
  --shell-max: 1240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.003em;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: var(--s-3);
  background: var(--primary);
  color: #0b0f14;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  z-index: 100;
}

.skip-link:focus {
  top: 8px;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------------ */
/* App bar                                                                  */
/* ------------------------------------------------------------------------ */

.appbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.appbar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--s-6);
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #0b0f14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-name {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  gap: var(--s-1);
  flex: 1;
  min-width: 0;
}

.tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  background: var(--primary-fade);
  color: var(--primary);
}

.tab.active {
  background: var(--primary-fade);
  color: var(--primary);
  font-weight: 600;
}

.session {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
}

.session-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------------ */
/* Shell + page header                                                      */
/* ------------------------------------------------------------------------ */

.app-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--s-6) var(--s-6) var(--s-10);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5);
  margin: 0 0 var(--s-5);
}

.page-header .eyebrow {
  margin: 0 0 4px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--s-1);
  max-width: 64ch;
}

.results-header .results-status-block {
  flex-shrink: 0;
  display: flex;
  gap: var(--s-2);
  align-items: center;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.form-panel {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
}

.list-panel,
.results-panel {
  padding: var(--s-5);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.panel-header h2 {
  margin: 0;
}

/* ------------------------------------------------------------------------ */
/* Layout grids                                                             */
/* ------------------------------------------------------------------------ */

.auth-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5);
  max-width: 880px;
  margin: var(--s-6) auto 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: var(--s-5);
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}

.admin-maintenance {
  grid-column: 1 / -1;
}

/* ------------------------------------------------------------------------ */
/* Forms                                                                    */
/* ------------------------------------------------------------------------ */

label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
}

input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.18);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: var(--s-3);
}

.checkbox-group {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  background: var(--panel-muted);
}

.checkbox-group legend {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

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

button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #0b0f14;
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 38px;
  padding: 0 14px;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

button:hover {
  background: var(--primary-dark);
  color: #0b0f14;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:disabled:hover {
  background: var(--primary);
}

.ghost-button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}

.ghost-button:hover {
  background: var(--panel-muted);
  border-color: var(--line-strong);
}

.ghost-button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.danger-button {
  background: var(--danger);
  color: #1a0a0b;
}

.danger-button:hover {
  background: #ef4444;
  color: #1a0a0b;
}

.warning-button {
  background: var(--warning);
  color: #1a1207;
}

.warning-button:hover {
  background: #f59e0b;
  color: #1a1207;
}

/* ------------------------------------------------------------------------ */
/* Item lists (submissions, frameworks, requests, review queue)             */
/* ------------------------------------------------------------------------ */

.item-list {
  display: grid;
  gap: var(--s-3);
}

.list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  color: var(--text);
  min-height: 0;
  font-weight: 500;
  transition:
    background-color 100ms ease,
    border-color 100ms ease;
}

.list-item:hover {
  background: var(--primary-fade);
  border-color: var(--primary-soft);
}

.list-item strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.list-item span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.list-item small {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-item,
.record-block {
  display: grid;
  gap: var(--s-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
}

.admin-item p,
.record-block p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.record-block.uploaded {
  border-color: var(--primary-soft);
}

.record-block.real-data {
  border-left: 4px solid var(--primary);
}

.record-block.mock-fallback {
  border-left: 4px solid var(--warning);
  background: var(--warning-bg);
}

.record-block.ai-generated {
  border-left: 4px solid var(--accent);
  background: var(--accent-bg);
  color: var(--text);
}

.record-block.ai-generated strong,
.record-block.ai-generated p,
.record-block.ai-generated li {
  color: var(--text);
}

/* Heading line + action row used by JS renderers */
.item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.action-row button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.meta-line {
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill[data-status*="pending"] {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-pill[data-status*="reject"],
.status-pill[data-status*="error"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill[data-status*="ai"] {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ------------------------------------------------------------------------ */
/* Status banners (upload, maintenance, etc.)                               */
/* ------------------------------------------------------------------------ */

.upload-status {
  border: 1px solid var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  background: var(--primary-fade);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.upload-status[data-type="success"] {
  border-color: rgba(74, 222, 128, 0.3);
  border-left-color: var(--success);
  background: var(--success-bg);
  color: var(--text);
}

.upload-status[data-type="error"] {
  border-color: rgba(248, 113, 113, 0.3);
  border-left-color: var(--danger);
  background: var(--danger-bg);
  color: var(--text);
}

.upload-status[data-type="info"] {
  border-color: var(--primary-soft);
  border-left-color: var(--primary);
  background: var(--primary-fade);
  color: var(--text);
}

/* ------------------------------------------------------------------------ */
/* Results page                                                             */
/* ------------------------------------------------------------------------ */

.results-content {
  display: grid;
  gap: var(--s-5);
}

.results-content.empty-state {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-section {
  display: grid;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
}

.result-section:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.result-section h3 {
  font-size: 0.98rem;
  font-weight: 600;
}

.result-section ul {
  margin: 0;
  padding-left: 20px;
}

.result-section li {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.ai-analysis {
  display: grid;
  gap: var(--s-3);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-bg);
  color: var(--text);
  padding: var(--s-4);
}

.ai-analysis summary {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.ai-analysis p,
.ai-analysis li {
  color: var(--text);
}

.ai-analysis-title {
  margin-right: var(--s-3);
  color: var(--text);
}

.ai-analysis-pill {
  background: var(--accent);
  color: #1a0c04;
}

/* ------------------------------------------------------------------------ */
/* Reviewer feedback controls inside record blocks                          */
/* ------------------------------------------------------------------------ */

.feedback-history,
.feedback-controls {
  display: grid;
  gap: var(--s-2);
  border-top: 1px solid var(--line);
  padding-top: var(--s-3);
  margin-top: var(--s-2);
}

.feedback-history h4 {
  margin: 0;
  font-size: 0.85rem;
}

.feedback-history ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.feedback-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.feedback-input-grid,
.feedback-checkbox-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
}

/* ------------------------------------------------------------------------ */
/* Empty state                                                              */
/* ------------------------------------------------------------------------ */

.empty-state {
  color: var(--text-muted);
  margin: 0;
  padding: var(--s-4) var(--s-2);
  font-size: 0.92rem;
  text-align: center;
  background: var(--panel-muted);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}

/* ------------------------------------------------------------------------ */
/* Maintenance actions                                                      */
/* ------------------------------------------------------------------------ */

.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.maintenance-actions .danger-button {
  flex: 1 1 200px;
  min-width: 200px;
}

/* ------------------------------------------------------------------------ */
/* Toast                                                                    */
/* ------------------------------------------------------------------------ */

.toast {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  max-width: min(420px, calc(100vw - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  z-index: 50;
}

/* ------------------------------------------------------------------------ */
/* Mobile                                                                   */
/* ------------------------------------------------------------------------ */

@media (max-width: 880px) {
  .appbar-inner {
    padding: 0 var(--s-4);
    gap: var(--s-3);
  }

  .brand-name {
    display: none;
  }

  .primary-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .session-label {
    display: none;
  }

  .app-shell {
    padding: var(--s-4) var(--s-4) var(--s-6);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
  }

  .auth-layout,
  .workspace-grid,
  .admin-grid,
  .two-column,
  .feedback-input-grid,
  .feedback-checkbox-row {
    grid-template-columns: 1fr;
  }

  .admin-maintenance {
    grid-column: auto;
  }

  h1 {
    font-size: 1.35rem;
  }
}

/* ------------------------------------------------------------------------ */
/* Phase 7.5.5 — upload progress bar + nav pill                             */
/* ------------------------------------------------------------------------ */

.upload-progress {
  display: grid;
  gap: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-muted);
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-2);
}

.progress-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.2s ease;
}

.progress-bar-fill[data-status="failed"] {
  background: var(--danger);
}

.progress-bar-fill[data-status="cancelled"] {
  background: var(--warning);
}

.progress-bar-fill[data-status="done"] {
  background: var(--success);
}

.progress-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.progress-bar-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: capitalize;
}

.nav-upload-pill {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  margin-left: var(--s-3);
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.nav-upload-pill:hover {
  background: var(--accent);
  color: #0b0f14;
}

.nav-upload-pill[data-status="failed"] {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.nav-upload-pill[data-status="done"] {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

/* ------------------------------------------------------------------------ */
/* Phase 7.8 — Mapping card layout for the Results tab                       */
/* ------------------------------------------------------------------------ */

.mapping-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
}

.mapping-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.mapping-card-title {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  flex-wrap: wrap;
  min-width: 0;
}

.mapping-card-framework {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-muted);
}

.mapping-card-identifier {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.mapping-card-label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.mapping-card-meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.mapping-card-type {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: lowercase;
}

.mapping-card-description {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.mapping-card-scores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.mapping-card-score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: var(--panel-muted);
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.score-chip-label {
  color: var(--text-muted);
  font-weight: 500;
}

.score-chip-value {
  color: var(--text);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mapping-card-terms {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mapping-card-terms-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--s-1);
}

.mapping-card-term {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-fade);
  color: var(--primary);
  border: 1px solid var(--primary-soft);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mapping-card-footer {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.78rem;
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}

.mapping-card-source {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mapping-card-details {
  margin-top: var(--s-1);
}

.mapping-card-details > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  list-style: none;
}

.mapping-card-details > summary::-webkit-details-marker {
  display: none;
}

.mapping-card-details > summary::before {
  content: "▸ ";
  color: var(--text-soft);
  font-size: 0.7em;
}

.mapping-card-details[open] > summary::before {
  content: "▾ ";
}

.mapping-card-rationale {
  margin: var(--s-3) 0 0 0;
  padding: var(--s-3);
  background: var(--panel-muted);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.mapping-card-breakdown {
  margin: var(--s-3) 0 0 0;
  padding-left: var(--s-4);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px var(--s-4);
}

.mapping-card-breakdown li {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Status-pill confidence colors (high / medium / low) */
.status-pill[data-status="high"] {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill[data-status="medium"] {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-pill[data-status="low"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill[data-status="unknown"] {
  background: var(--panel-muted);
  color: var(--text-muted);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------------------ */
/* Phase 7.5 — LLM usage admin panel                                         */
/* ------------------------------------------------------------------------ */

.llm-usage-panel {
  display: grid;
  gap: var(--s-3);
}

.llm-usage-status {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.llm-budget-warning {
  margin: 0;
  padding: var(--s-3);
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: var(--text);
}

.llm-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3);
}

.llm-usage-card {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  display: grid;
  gap: 4px;
}

.llm-usage-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.llm-usage-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
}

.llm-usage-card-row span {
  color: var(--text-muted);
}

.llm-usage-card-row strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------------------------------ */
/* Phase 9 — Learning Objectives cards                                       */
/* ------------------------------------------------------------------------ */

.lo-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
}

.lo-card-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.lo-card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  padding: 2px 8px;
  background: var(--primary-fade);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-sm);
}

.lo-card-statement {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.5;
}

.lo-card-rationale {
  margin: 0;
  padding: var(--s-2) var(--s-3);
  background: var(--panel-muted);
  border-left: 3px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.lo-card-citations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.lo-card-citations-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--s-1);
}

.lo-card-citation {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-fade);
  color: var(--primary);
  border: 1px solid var(--primary-soft);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.78rem;
}

.lo-card-provider {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Bloom level pills — six colors that progress through cognitive demand */
.status-pill[data-bloom="remember"]   { background: var(--panel-muted); color: var(--text-muted); border: 1px solid var(--line); }
.status-pill[data-bloom="understand"] { background: var(--primary-fade); color: var(--primary); border: 1px solid var(--primary-soft); }
.status-pill[data-bloom="apply"]      { background: var(--success-bg); color: var(--success); }
.status-pill[data-bloom="analyze"]    { background: var(--warning-bg); color: var(--warning); }
.status-pill[data-bloom="evaluate"]   { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.status-pill[data-bloom="create"]     { background: var(--danger-bg); color: var(--danger); }

/* ------------------------------------------------------------------------ */
/* Phase 10 — Assessments cards + controls                                   */
/* ------------------------------------------------------------------------ */

.assessments-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
}

.assessments-status {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.assessments-status.hint {
  color: var(--text-muted);
}

.asmt-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
}

.asmt-card-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.asmt-card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  padding: 2px 8px;
  background: var(--primary-fade);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-sm);
}

.asmt-card-type {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.asmt-card-time {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.asmt-card-prompt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  padding: var(--s-3);
  background: var(--panel-muted);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--primary-soft);
}

.asmt-card-expected {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.asmt-card-rubric {
  font-size: 0.88rem;
}

.asmt-card-rubric strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.85rem;
}

.asmt-card-rubric ul {
  margin: 0;
  padding-left: var(--s-5);
  color: var(--text-muted);
}

.asmt-card-rubric li {
  margin-bottom: 2px;
}

.asmt-card-artifacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.asmt-card-artifacts-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--s-1);
}

.asmt-card-artifact {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.asmt-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.78rem;
}

/* Phase pills — pre/post are color-coded so reviewers can scan quickly */
.status-pill[data-phase="pre"]  { background: var(--panel-muted); color: var(--text-muted); border: 1px solid var(--line); }
.status-pill[data-phase="post"] { background: var(--success-bg); color: var(--success); }

/* ------------------------------------------------------------------------ */
/* Phase 8 — Export controls                                                 */
/* ------------------------------------------------------------------------ */

.export-controls-section {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
}

.export-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.export-button-row .ghost-button.small {
  /* slight upgrade in visibility — these are real CTAs */
  background: var(--panel);
  border: 1px solid var(--primary-soft);
  color: var(--text);
}

.export-button-row .ghost-button.small:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

/* ------------------------------------------------------------------------ */
/* Phase 11 — Curriculum Plan                                                */
/* ------------------------------------------------------------------------ */

.plan-subsection {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}

.plan-subsection h4 {
  margin: 0 0 var(--s-2) 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.plan-subsection .hint {
  margin: 0 0 var(--s-2) 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mod-card, .lab-card, .cap-card {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
}

.mod-card-seq {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mod-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.mod-card-labs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.plan-software-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.plan-software-list li {
  padding: 6px 10px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
}

.plan-software-source {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 6px;
}

.plan-software-source[data-source="from_role_intake"] {
  background: var(--success-bg);
  color: var(--success);
}

.plan-software-source[data-source="ai_suggested"] {
  background: var(--primary-fade);
  color: var(--primary);
}

.plan-software-usage {
  color: var(--text-soft);
  font-size: 0.78rem;
}

/* ------------------------------------------------------------------------ */
/* Phase 11.1 — Collapsible Results                                          */
/* ------------------------------------------------------------------------ */

/* Section-level wrapper. The <details> sits inside .result-section so the
   existing section spacing still applies. */
.collapsible-section {
  display: block;
}

.collapsible-section > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.collapsible-section > summary::-webkit-details-marker { display: none; }
.collapsible-section > summary::marker { content: ""; }

/* The triangle/disclosure indicator */
.collapsible-section > summary::before {
  content: "▶";
  display: inline-block;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  width: 12px;
  flex-shrink: 0;
}

.collapsible-section[open] > summary::before {
  transform: rotate(90deg);
}

.collapsible-section > summary:hover {
  background: var(--panel-muted);
  border-radius: var(--r-sm);
}

.collapsible-section-title {
  margin: 0;
  font-size: 1.05rem;
  flex-grow: 1;
}

.collapsible-count {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.collapsible-section-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.collapsible-section-body {
  padding-top: var(--s-2);
}

/* Individual card-level collapsible. Inherits .record-block styling
   from its retained class list, plus adds disclosure behavior. */
.collapsible-card {
  display: block;
}

.collapsible-card > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.collapsible-card > summary::-webkit-details-marker { display: none; }
.collapsible-card > summary::marker { content: ""; }

.collapsible-card > summary::before {
  content: "▶";
  display: inline-block;
  font-size: 0.55rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  width: 10px;
  flex-shrink: 0;
}

.collapsible-card[open] > summary::before {
  transform: rotate(90deg);
}

.collapsible-card > summary:hover {
  background: var(--panel-muted);
  border-radius: var(--r-sm);
}

.collapsible-card-body {
  padding-top: var(--s-1);
}

/* When a card is rendered as a <details>, drop the bottom border on the
   summary so it doesn't double-up with the body content's borders. */
.collapsible-card > summary,
.collapsible-section > summary {
  background: transparent;
}

/* Compact look when collapsed: a one-line summary should sit tight. */
.collapsible-card-header {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------------ */
/* Phase 12a Step 4a — Vendor catalogs admin panel                           */
/* ------------------------------------------------------------------------ */

.vendor-catalogs-summary {
  margin-top: var(--s-3);
}

.vendor-catalog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}

.vendor-catalog-card {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 120ms, background 120ms;
}

.vendor-catalog-card:hover {
  border-color: var(--line-strong);
  background: var(--panel);
}

.vendor-catalog-card.active {
  border-color: var(--primary);
  background: var(--primary-fade);
}

.vendor-catalog-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.vendor-catalog-count {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.vendor-catalog-count.empty {
  color: var(--text-soft);
  font-style: italic;
}

.vendor-catalog-timestamp {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.org-card .vendor-catalog-name {
  font-weight: 600;
}
.detail-view {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--s-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.detail-view #org-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
}
.org-users-section {
  margin-top: var(--s-3);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.inline-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.9rem;
}
.vendor-catalog-timestamp.empty {
  color: var(--text-soft);
  font-style: italic;
}

.vendor-catalogs-detail {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.vendor-detail-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.vendor-detail-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.vendor-detail-total {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.85rem;
  margin-left: 4px;
}

.vendor-detail-search {
  flex-grow: 1;
  min-width: 200px;
  max-width: 360px;
  margin-left: auto;
}

.vendor-detail-search input {
  width: 100%;
  padding: 6px 10px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.vendor-detail-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.vendor-course-list {
  display: grid;
  gap: var(--s-2);
}

.vendor-course-card {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  display: grid;
  gap: var(--s-2);
}

.vendor-course-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vendor-course-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.vendor-course-difficulty {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.vendor-course-difficulty[data-difficulty="beginner"] {
  color: var(--success);
  background: var(--success-bg);
}

.vendor-course-difficulty[data-difficulty="intermediate"] {
  color: var(--warning);
  background: var(--warning-bg);
}

.vendor-course-difficulty[data-difficulty="advanced"] {
  color: var(--danger);
  background: var(--danger-bg);
}

.vendor-course-hours {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.vendor-course-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.vendor-course-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.vendor-course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vendor-course-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: var(--primary-fade);
  color: var(--primary);
  border-radius: 12px;
}

.vendor-course-footer {
  margin-top: var(--s-1);
}

.vendor-course-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}

.vendor-course-link:hover {
  text-decoration: underline;
}

.vendor-detail-pager {
  margin-top: var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
}

.vendor-detail-pager-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.hint.error {
  color: var(--danger);
}

/* ------------------------------------------------------------------------ */
/* Phase 12a Step 4b — Vendor catalog upload modals                          */
/* ------------------------------------------------------------------------ */

/* The wrapper holds the card + upload button as siblings */
.vendor-catalog-card-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.vendor-catalog-upload-button {
  align-self: flex-start;
  margin-top: var(--s-1);
}

/* Modal backdrop — full-viewport overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  overflow-y: auto;
}

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

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.modal-close-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--s-2);
  border-radius: var(--r-sm);
}

.modal-close-button:hover {
  color: var(--text);
  background: var(--panel-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line);
}

.upload-form {
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.upload-form .hint {
  margin: 0;
}

.upload-form-label {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  font-size: 0.9rem;
  color: var(--text);
}

.upload-form-label span {
  font-weight: 600;
}

.upload-form-label input[type="file"] {
  padding: var(--s-2);
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.upload-form-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: 0;
}

.upload-form-fieldset legend {
  padding: 0 var(--s-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.upload-mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--s-2);
  row-gap: 2px;
  padding: var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 120ms;
}

.upload-mode-option:hover {
  background: var(--panel-muted);
}

.upload-mode-option input[type="radio"] {
  grid-row: 1 / 3;
  grid-column: 1;
  align-self: start;
  margin-top: 3px;
}

.upload-mode-title {
  grid-row: 1;
  grid-column: 2;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.upload-mode-desc {
  grid-row: 2;
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-recommended,
.badge-warning {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.badge-recommended {
  color: var(--success);
  background: var(--success-bg);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.upload-error {
  padding: var(--s-3);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  color: var(--danger);
  font-size: 0.88rem;
}

/* Success modal */

.upload-success-body {
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.upload-success-summary {
  margin: 0;
  color: var(--text);
}

.upload-success-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}

.upload-count-card {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: center;
}

.upload-count-card.zero {
  opacity: 0.5;
}

.upload-count-number {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.upload-count-card.zero .upload-count-number {
  color: var(--text-soft);
}

.upload-count-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.upload-warnings {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.upload-warnings-header {
  margin: 0;
  font-size: 0.95rem;
  color: var(--warning);
}

.upload-warnings-list {
  margin: 0;
  padding-left: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.upload-warnings-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.upload-warnings-toggle {
  align-self: flex-start;
}

.upload-no-warnings {
  margin: 0;
  font-size: 0.88rem;
  color: var(--success);
}

/* ------------------------------------------------------------------------ */
/* Phase 12a Step 4c — Vendor catalog clear (delete) modal                   */
/* ------------------------------------------------------------------------ */

/* Override the single-button alignment from 4b — now we have two action
   buttons (Upload + Clear) sitting side-by-side. */
.vendor-catalog-actions {
  display: flex;
  gap: var(--s-1);
  flex-wrap: wrap;
}

.vendor-catalog-upload-button,
.vendor-catalog-clear-button {
  margin-top: var(--s-1);
}

.danger-button.small {
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
}

.clear-modal-body {
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  color: var(--text);
}

.clear-modal-body p {
  margin: 0;
}

.clear-modal-body strong {
  color: var(--danger);
  font-weight: 600;
}

/* ------------------------------------------------------------------------ */
/* Phase 12b — Vendor training matrix                                        */
/* ------------------------------------------------------------------------ */

.vendor-training-cta {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: flex-start;
}

.vendor-training-matrix-wrap {
  overflow-x: auto;
}

.vendor-training-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.vendor-training-matrix th {
  text-align: left;
  padding: var(--s-2) var(--s-3);
  background: var(--panel-muted);
  border-bottom: 1px solid var(--line-strong);
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.vendor-training-matrix td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.vendor-training-matrix tbody tr:hover {
  background: var(--panel-muted);
}

.vendor-training-module-cell {
  min-width: 200px;
  max-width: 280px;
}

.vendor-training-module-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.vendor-training-module-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.vendor-training-rec-cell {
  min-width: 180px;
  max-width: 260px;
}

.vendor-training-rec-link {
  display: block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
}

.vendor-training-rec-link:hover {
  text-decoration: underline;
}

.vendor-training-rec-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.vendor-training-rec-empty {
  color: var(--text-soft);
  font-size: 1.2rem;
}

.vendor-training-footer {
  margin-top: var(--s-3);
}

/* ------------------------------------------------------------------------ */
/* Phase 12a Fix 2d — Framework code badge + hover popup                     */
/* ------------------------------------------------------------------------ */

.vendor-course-frameworks {
  position: relative;
  display: inline-flex;
  cursor: help;
  outline: none;
}

.vendor-course-frameworks-summary {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}

.vendor-course-frameworks:hover .vendor-course-frameworks-summary,
.vendor-course-frameworks:focus-visible .vendor-course-frameworks-summary {
  border-color: var(--info);
}

.vendor-course-frameworks-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 280px;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: var(--s-3);
  display: none;
  flex-direction: column;
  gap: var(--s-2);
}

.vendor-course-frameworks:hover .vendor-course-frameworks-popup,
.vendor-course-frameworks:focus-visible .vendor-course-frameworks-popup,
.vendor-course-frameworks:focus-within .vendor-course-frameworks-popup {
  display: flex;
}

.vendor-course-framework-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vendor-course-framework-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.vendor-course-framework-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vendor-course-framework-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  padding: 2px 6px;
  background: var(--panel-muted);
  color: var(--text);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

.vendor-course-framework-more {
  font-size: 0.7rem;
  padding: 2px 6px;
  color: var(--text-muted);
  font-style: italic;
}

/* ------------------------------------------------------------------------ */
/* Phase 12b extension — multiple recommendations per cell                   */
/* ------------------------------------------------------------------------ */

.vendor-training-rec-entry {
  display: block;
  padding-bottom: var(--s-1);
}

.vendor-training-rec-entry + .vendor-training-rec-entry {
  padding-top: var(--s-2);
  border-top: 1px dashed var(--line);
  margin-top: var(--s-2);
}

.vendor-training-rec-more {
  margin-top: var(--s-2);
}

.vendor-training-rec-toggle {
  background: transparent;
  border: none;
  padding: 2px 0;
  color: var(--primary);
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.vendor-training-rec-toggle:hover {
  text-decoration: underline;
}

.vendor-training-rec-more-list {
  margin-top: var(--s-2);
}

/* ------------------------------------------------------------------------ */
/* Phase 13d — Role templates admin UI                                       */
/* ------------------------------------------------------------------------ */

.panel-header-actions {
  display: flex;
  gap: var(--s-2);
  align-items: center;
}

.role-templates-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.role-templates-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.role-template-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.role-template-row.is-inactive {
  opacity: 0.6;
}

.role-template-row-main {
  flex: 1;
  min-width: 0;
}

.role-template-row-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 4px;
}

.role-template-inactive-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  background: var(--panel);
  color: var(--text-muted);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  margin-left: var(--s-2);
}

.role-template-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 4px;
}

.role-template-row-desc {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.role-template-row-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex-shrink: 0;
}

/* Modal — reused styles for the role template create/edit modal */
.role-template-modal {
  max-width: 640px;
  width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.role-template-modal .modal-body {
  overflow-y: auto;
  flex: 1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--s-3);
}

.form-field label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea {
  width: 100%;
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--panel);
  color: var(--text);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.form-field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-field-row {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.form-field-row .form-field {
  flex: 1;
}

.form-field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--s-2);
}

.form-field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.modal-error {
  background: var(--danger-bg, #fee);
  color: var(--danger, #c00);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--danger, #c00);
  font-size: 0.85rem;
  margin-top: var(--s-2);
}

/* ------------------------------------------------------------------------ */
/* Phase 13e — Intake template picker                                        */
/* ------------------------------------------------------------------------ */

.form-optional {
  font-weight: normal;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

#role-template-picker {
  width: 100%;
  padding: var(--s-2);
  font-size: 0.9rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}


/* ===========================================================================
 * UI Redesign (Phase results-dashboard) — Results Dashboard + Detail Pages
 * ===========================================================================
 * Added in UI.1 substep. Classes used by the new dashboard view and detail
 * pages that replace the old long-scroll results page. The old `result-section`
 * classes remain in the file above and continue to work; the new classes are
 * purely additive. Once UI.3 ships the new renderer, the old `result-section`
 * blocks become unused but stay in the file until cleanup.
 * ------------------------------------------------------------------------- */

/* ---- Breadcrumb ---- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.breadcrumb a:hover {
  color: var(--primary);
  background: var(--primary-fade);
}
.breadcrumb .sep {
  color: var(--text-soft);
  opacity: 0.5;
}
.breadcrumb .current {
  color: var(--text);
}

/* ---- Dashboard header ---- */

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.results-header-text {
  flex: 1;
  min-width: 280px;
}
.results-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.results-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.export-bar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.export-btn {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.export-btn:hover {
  border-color: var(--primary);
  background: var(--primary-fade);
}
.export-btn.primary {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--bg);
  font-weight: 500;
}
.export-btn.primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ---- Approval bar ---- */

.approval-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.approval-bar.pending {
  border-color: var(--warning);
  background: var(--warning-bg);
}
.approval-bar.approved {
  border-color: var(--success);
  background: var(--success-bg);
}
.approval-bar.rejected {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.approval-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}
.approval-bar-notes {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.pending { background: var(--warning); box-shadow: 0 0 0 4px rgba(251,191,36,0.15); }
.status-dot.approved { background: var(--success); box-shadow: 0 0 0 4px rgba(74,222,128,0.15); }
.status-dot.rejected { background: var(--danger); box-shadow: 0 0 0 4px rgba(248,113,113,0.15); }
.approval-bar-action {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 4px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.approval-bar-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Reviewer form (expanded state, replaces approval bar when active) */
.reviewer-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 24px;
}
.reviewer-form-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.reviewer-form textarea {
  width: 100%;
  min-height: 60px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  padding: 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  resize: vertical;
}
.reviewer-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ---- Role summary (new full-width card) ---- */

.role-summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 24px;
}
.role-summary-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.role-summary-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.role-summary-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.role-summary-card-meta .chip {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--text);
}
.role-summary-card p.description {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.role-summary-card-rows {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 16px;
  font-size: 12px;
  margin: 0;
}
.role-summary-card-rows dt {
  color: var(--text-soft);
}
.role-summary-card-rows dd {
  margin: 0;
  color: var(--text);
}
.tool-chip {
  display: inline-block;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text);
}

/* ---- Dashboard grid of section cards ---- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.section-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}
.section-card.no-drill {
  cursor: default;
}
.section-card:not(.no-drill):hover {
  border-color: var(--primary-soft);
  transform: translateY(-1px);
  background: var(--panel-elevated, var(--panel));
}
.section-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.section-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-card-count {
  font-size: 11px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex-shrink: 0;
}
.section-card-count .num {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-right: 2px;
}
.section-card-body {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}
.section-card-body ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.section-card-body li {
  display: flex;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.section-card-body li:last-child {
  border-bottom: none;
}
.section-card-body li .label {
  color: var(--text-soft);
  font-size: 11px;
  min-width: 70px;
  flex-shrink: 0;
}
.section-card-body li .val {
  color: var(--text);
  font-size: 12px;
}
.section-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--primary);
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.section-card.no-drill .section-card-footer {
  display: none;
}

/* ---- Info-icon tooltips ---- */

.info-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel-muted);
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  font-style: italic;
  font-family: serif;
}
.info-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.info-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
  color: var(--text);
  white-space: normal;
  width: 240px;
  text-align: left;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.info-icon[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ---- Severity pills (used in QC findings card) ---- */

.severity-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
}
.severity-pill.info { background: var(--info-bg); color: var(--info); }
.severity-pill.warning { background: var(--warning-bg); color: var(--warning); }
.severity-pill.error { background: var(--danger-bg); color: var(--danger); }

/* ---- AI-generated badge ---- */

.ai-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-block;
  margin-left: 4px;
}

/* ---- Detail page layout ---- */

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.detail-head-text {
  flex: 1;
  min-width: 280px;
}
.detail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.detail-subtitle {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Detail tables (used for Framework Mappings, etc) */
.detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 24px;
}
.detail-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  padding: 10px 14px;
  background: var(--panel-muted);
  border-bottom: 1px solid var(--line);
}
.detail-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text);
}
.detail-table tr:last-child td { border-bottom: none; }
.detail-table tr:hover td { background: var(--panel-muted); }
.detail-table code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 11px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--primary);
}

/* Score-bar visualization (in framework mappings detail table) */
.score-bar {
  width: 60px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  overflow: hidden;
}
.score-bar-fill {
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform-origin: left;
  /* JS sets transform: scaleX(<score>) inline */
}

/* Competency detail card (used in Competencies detail page) */
.comp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 12px;
}
.comp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.comp-card-id {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.comp-card-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.comp-card-prof {
  background: var(--primary-fade);
  color: var(--primary);
  border: 1px solid var(--primary-soft);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  text-transform: capitalize;
  flex-shrink: 0;
}
.comp-card-statement {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 8px 0 12px;
}
.comp-card-rows {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.comp-card-rows dt {
  color: var(--text-soft);
  font-size: 11px;
}
.comp-card-rows dd {
  margin: 0;
  color: var(--text);
}
.comp-card-rows code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 11px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--primary);
  margin-right: 4px;
}

/* ---- Footer notes (explanation blocks on detail pages) ---- */

.foot-note {
  margin-top: 32px;
  padding: 12px 16px;
  background: var(--panel-muted);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}
.foot-note strong {
  color: var(--text);
}

/* ---- Variables this depends on (define if missing) ---- */

:root {
  --panel-elevated: #161e2a;
  --line-stronger: #384556;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* End UI redesign additions */


/* === Stage 4 + Stage B styling (org users + approve picker) === */

/* --- Stage 4: org user list (mirrors .role-template-row*) --- */
.org-users-section {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.org-users-section > h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--s-3);
}
.org-user-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.org-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.org-user-row.is-inactive {
  opacity: 0.6;
}
.org-user-row-main {
  flex: 1;
  min-width: 0;
}
.org-user-row-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.org-user-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.org-user-row-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}
.org-user-role-select {
  min-height: 32px;
  padding: 0 var(--s-2);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.org-user-role-select:focus {
  outline: none;
  border-color: var(--primary-soft);
}

/* --- Stage B: inline approve org picker (replaces .action-row) --- */
.approve-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.approve-picker-select {
  min-height: 32px;
  padding: 0 var(--s-2);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  max-width: 260px;
}
.approve-picker-select:focus {
  outline: none;
  border-color: var(--primary-soft);
}
.approve-picker button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.85rem;
}


/* === delete-user inline confirmation styling === */
.delete-user-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  margin-top: var(--s-2);
  width: 100%;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--r-sm);
}
.delete-user-confirm-prompt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.delete-user-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}
.delete-user-choice input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 0;
}
/* The label content (text + reassign select) sits beside the radio. */
.delete-user-choice > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  flex: 1 1 auto;
  min-width: 0;
}
/* Override the global `select { width: 100% }` so the reassign dropdown sizes
   to content inside the confirm box instead of consuming the whole row. */
.delete-user-target {
  width: auto;
  max-width: 220px;
  padding: 4px 8px;
  font-size: 0.8rem;
}
.delete-user-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-1);
}


/* === competency source groups (readability) === */
.comp-card-rows dd .comp-source-group {
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-muted);
}
.comp-source-group-summary {
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style-position: inside;
}
.comp-source-group[open] .comp-source-group-summary {
  border-bottom: 1px solid var(--line);
}
.comp-source-group-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.comp-source-item {
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 4px 8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
}
.comp-source-item:last-child {
  border-bottom: none;
}
.comp-source-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--text);
}
.comp-card-rows dd {
  margin-bottom: var(--s-3);
}


/* Theme B — vendor course approve/reject decision controls */
.vt-decision-controls {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.vt-decision-btn {
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border, #ccc);
  background: transparent;
  color: var(--text-soft, #888);
  cursor: pointer;
}
.vt-decision-btn:hover { border-color: var(--accent, #4aa); }
.vt-decision-btn-approved.is-active {
  background: #1f6f43;
  border-color: #1f6f43;
  color: #fff;
}
.vt-decision-btn-rejected.is-active {
  background: #7a2530;
  border-color: #7a2530;
  color: #fff;
}
.vendor-training-rec-entry.vt-decision-rejected {
  opacity: 0.55;
}
.vendor-training-rec-entry.vt-decision-rejected .vendor-training-rec-link {
  text-decoration: line-through;
}
.vendor-training-rec-entry.vt-decision-approved {
  border-left: 3px solid #1f6f43;
  padding-left: 6px;
}
