/* ==========================================================================
   HTMS Phase 3A — Training Catalog, Training Detail, Import Center
   Built on top of design-system.css + components.css + dashboard.css tokens.
   ========================================================================== */

/* ==========================================================================
   TRAINING CATALOG — card/table hybrid
   ========================================================================== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.training-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.training-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-500);
  opacity: 0.9;
}
.training-card.inactive::before { background: var(--slate-500); }
.training-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-default); }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.tc-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-50); color: var(--accent-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.training-card.inactive .tc-icon { background: var(--slate-50); color: var(--slate-500); }
.tc-code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 11px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.02em; }
.tc-name { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin-top: 3px; line-height: 1.3; }
.tc-category { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--accent-600); font-weight: 600; background: var(--accent-50); padding: 3px 9px; border-radius: var(--radius-pill); margin-top: 8px; }
.tc-desc { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.55; flex: 1; }
.tc-meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-tertiary); padding-top: var(--sp-3); border-top: 1px solid var(--border-subtle); }
.tc-meta-row .tc-provider { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-secondary); }
.tc-stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tc-stat { text-align: center; background: var(--surface-muted); border-radius: var(--radius-md); padding: 8px 4px; }
.tc-stat .tcs-value { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-primary); }
.tc-stat .tcs-label { font-size: 9.5px; color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.tc-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-footer .btn { flex: 1; }

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

/* View toggle (card / table) */
.view-toggle-group { display: inline-flex; background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.view-toggle-btn { border: none; background: transparent; width: 32px; height: 28px; border-radius: 7px; color: var(--text-tertiary); font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all var(--dur-fast) var(--ease); }
.view-toggle-btn.active { background: var(--surface-card); color: var(--accent-600); box-shadow: var(--shadow-xs); }

/* ==========================================================================
   TRAINING DETAIL — mini analytics dashboard
   ========================================================================== */
.training-detail-header {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.tdh-left { display: flex; gap: var(--sp-4); align-items: flex-start; min-width: 0; }
.tdh-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0;
}
.tdh-code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 11.5px; color: rgba(255,255,255,0.55); font-weight: 600; letter-spacing: 0.03em; }
.tdh-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; margin-top: 4px; }
.tdh-badges { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tdh-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.1); }
.tdh-badge.status-active { background: rgba(26,157,99,0.18); color: #6ee7ab; border-color: rgba(26,157,99,0.25); }
.tdh-badge.status-inactive { background: rgba(194,54,54,0.18); color: #f2a3a3; border-color: rgba(194,54,54,0.25); }
.tdh-desc { font-size: 13px; color: rgba(255,255,255,0.65); max-width: 620px; line-height: 1.6; margin-top: 12px; }
.tdh-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tdh-actions .btn-secondary { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); color: #fff; }
.tdh-actions .btn-secondary:hover { background: rgba(255,255,255,0.14); }

.mini-kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
@media (max-width: 1300px) { .mini-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .mini-kpi-strip { grid-template-columns: repeat(2, 1fr); } .training-detail-header { flex-direction: column; } }

.analytics-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-5); margin-bottom: var(--sp-5); align-items: start; }
.analytics-grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin-bottom: var(--sp-5); align-items: start; }
@media (max-width: 1100px) { .analytics-grid-2, .analytics-grid-2b { grid-template-columns: 1fr; } }

.participation-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.participation-row:last-child { margin-bottom: 0; }
.participation-row .p-name { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); width: 168px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participation-row .p-track { flex: 1; height: 9px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.participation-row .p-fill { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--accent-400), var(--accent-600)); transition: width 0.6s var(--ease); }
.participation-row .p-value { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text-primary); width: 40px; text-align: right; flex-shrink: 0; }

/* ==========================================================================
   IMPORT CENTER — corporate migration wizard
   ========================================================================== */
.import-tabs { display: flex; gap: 4px; background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 4px; margin-bottom: var(--sp-5); width: fit-content; }
.import-tab-btn { border: none; background: transparent; padding: 9px 18px; font-size: 13px; font-weight: 600; color: var(--text-tertiary); border-radius: 8px; display: flex; align-items: center; gap: 8px; transition: all var(--dur-fast) var(--ease); flex-shrink: 0; white-space: nowrap; }
.import-tab-btn.active { background: var(--surface-card); color: var(--accent-600); box-shadow: var(--shadow-xs); }
.import-tab-btn:hover:not(.active) { color: var(--text-secondary); }

/* Stepper */
.wizard-steps { display: flex; align-items: center; margin-bottom: var(--sp-6); overflow-x: auto; padding-bottom: 2px; }
.wizard-step { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wizard-step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-muted); border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--text-tertiary);
  transition: all var(--dur-fast) var(--ease); flex-shrink: 0;
}
.wizard-step-label { font-size: 12.5px; font-weight: 600; color: var(--text-tertiary); white-space: nowrap; transition: color var(--dur-fast) var(--ease); }
.wizard-step.active .wizard-step-circle { background: var(--accent-500); border-color: var(--accent-600); color: #fff; box-shadow: 0 0 0 4px var(--accent-50); }
.wizard-step.active .wizard-step-label { color: var(--accent-600); }
.wizard-step.done .wizard-step-circle { background: var(--emerald-500); border-color: var(--emerald-600); color: #fff; }
.wizard-step.done .wizard-step-label { color: var(--emerald-600); }
.wizard-step-connector { width: 44px; height: 2px; background: var(--border-strong); margin: 0 10px; flex-shrink: 0; }
.wizard-step.done + .wizard-step-connector-done, .wizard-step-connector.done { background: var(--emerald-400); }

.wizard-panel { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: var(--sp-6); min-height: 360px; }
.wizard-panel-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.wizard-panel-subtitle { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: var(--sp-5); }
.wizard-footer { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border-subtle); }

/* Upload dropzone */
.import-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  padding: var(--sp-10) var(--sp-6);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3);
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
}
.import-dropzone:hover, .import-dropzone.drag-over { border-color: var(--accent-400); background: var(--accent-50); }
.import-dropzone .dz-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-50); color: var(--accent-600); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.import-dropzone .dz-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.import-dropzone .dz-sub { font-size: 12.5px; color: var(--text-tertiary); }
.import-dropzone .dz-formats { display: flex; gap: 8px; margin-top: 4px; }
.dz-format-chip { font-size: 11px; font-weight: 600; color: var(--text-tertiary); background: var(--surface-card); border: 1px solid var(--border-subtle); padding: 3px 9px; border-radius: var(--radius-pill); }

.sample-file-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-4);
}
.sample-file-row .sf-left { display: flex; align-items: center; gap: 10px; }
.sample-file-row .sf-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--emerald-50); color: var(--emerald-600); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.sample-file-row .sf-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sample-file-row .sf-meta { font-size: 11.5px; color: var(--text-tertiary); }

/* Paste from Excel */
.paste-panel {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  transition: all var(--dur-fast) var(--ease);
}
.paste-panel:focus-within { border-color: var(--accent-400); background: var(--surface-card); }
.paste-panel textarea {
  width: 100%; min-height: 200px; border: none; background: transparent; outline: none;
  padding: var(--sp-5); font-family: 'SF Mono', 'Consolas', monospace; font-size: 12.5px; color: var(--text-primary);
  resize: vertical; line-height: 1.6;
}
.paste-panel-hint { display: flex; align-items: center; gap: 8px; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-tertiary); }
.paste-panel-hint i { color: var(--accent-500); }
.paste-empty-illustration { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-8) var(--sp-4); text-align: center; }
.paste-empty-illustration i { font-size: 40px; color: var(--border-strong); }
.paste-empty-illustration .pei-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.paste-empty-illustration .pei-sub { font-size: 12.5px; color: var(--text-tertiary); max-width: 380px; line-height: 1.5; }

/* Spreadsheet-style preview */
.spreadsheet-wrap { border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.spreadsheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.spreadsheet-table thead th {
  background: var(--navy-800); color: rgba(255,255,255,0.85);
  padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.spreadsheet-table thead th:first-child { width: 40px; text-align: center; }
.spreadsheet-table tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary); white-space: nowrap; background: var(--surface-card);
}
.spreadsheet-table tbody td:first-child { text-align: center; color: var(--text-tertiary); font-weight: 600; background: var(--surface-muted); }
.spreadsheet-table tbody tr:hover td { background: var(--surface-hover); }
.spreadsheet-table tbody tr:hover td:first-child { background: var(--surface-sunken); }
.spreadsheet-table tbody tr:last-child td { border-bottom: none; }

/* Validation status chips */
.validation-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (max-width: 1100px) { .validation-summary-grid { grid-template-columns: repeat(2, 1fr); } }
.val-stat-card {
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle); padding: var(--sp-4);
  background: var(--surface-muted); position: relative; overflow: hidden;
}
.val-stat-card::before { content: ''; position: absolute; top:0; left:0; bottom:0; width: 3px; background: var(--val-color, var(--accent-500)); }
.val-stat-card .vsc-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text-primary); }
.val-stat-card .vsc-label { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.val-stat-card .vsc-label i { font-size: 10px; }
.val-stat-card.valid { --val-color: var(--emerald-500); } .val-stat-card.valid .vsc-label i { color: var(--emerald-600); }
.val-stat-card.existing { --val-color: var(--accent-500); } .val-stat-card.existing .vsc-label i { color: var(--accent-600); }
.val-stat-card.new { --val-color: #7c5cbf; } .val-stat-card.new .vsc-label i { color: #7c5cbf; }
.val-stat-card.review { --val-color: var(--amber-500); } .val-stat-card.review .vsc-label i { color: var(--amber-600); }
.val-stat-card.duplicate { --val-color: var(--red-500); } .val-stat-card.duplicate .vsc-label i { color: var(--red-600); }
.val-stat-card.missing { --val-color: var(--red-500); } .val-stat-card.missing .vsc-label i { color: var(--red-600); }
.val-stat-card.invalid { --val-color: var(--red-500); } .val-stat-card.invalid .vsc-label i { color: var(--red-600); }

.val-row-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; white-space: nowrap; }
.val-row-badge.valid { background: var(--emerald-50); color: var(--emerald-600); }
.val-row-badge.existing { background: var(--accent-50); color: var(--accent-600); }
.val-row-badge.new { background: #f1ecfa; color: #7c5cbf; }
.val-row-badge.duplicate { background: var(--red-50); color: var(--red-600); }
.val-row-badge.missing-iqama { background: var(--red-50); color: var(--red-600); }
.val-row-badge.invalid { background: var(--red-50); color: var(--red-600); }
.val-row-badge.review { background: var(--amber-50); color: var(--amber-600); }

/* Column mapping rows */
.mapping-list { display: flex; flex-direction: column; gap: 10px; }
.mapping-row {
  display: grid; grid-template-columns: 1fr 32px 1fr 90px; gap: var(--sp-3); align-items: center;
  background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}
.mapping-row.unmapped { border-color: var(--red-100); background: var(--red-50); }
.mapping-row.required-missing { border-color: var(--amber-100); background: var(--amber-50); }
.mapping-source { display: flex; flex-direction: column; gap: 2px; }
.mapping-source .ms-label { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.mapping-source .ms-sample { font-size: 11px; color: var(--text-tertiary); font-family: 'SF Mono', monospace; }
.mapping-arrow { color: var(--text-tertiary); font-size: 13px; text-align: center; }
.mapping-row select { width: 100%; }
.mapping-status { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 11px; font-weight: 700; }
.mapping-status.mapped { color: var(--emerald-600); }
.mapping-status.unmapped { color: var(--red-600); }
.mapping-status.required { color: var(--amber-600); }

/* Import options */
.import-option-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (max-width: 900px) { .import-option-cards { grid-template-columns: 1fr; } }
.import-option-card {
  border: 1.5px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--sp-4);
  cursor: pointer; transition: all var(--dur-fast) var(--ease); background: var(--surface-card);
  display: flex; flex-direction: column; gap: 8px;
}
.import-option-card:hover { border-color: var(--accent-200); }
.import-option-card.selected { border-color: var(--accent-500); background: var(--accent-50); box-shadow: 0 0 0 3px var(--accent-50); }
.import-option-card .ioc-top { display: flex; align-items: center; justify-content: space-between; }
.import-option-card .ioc-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-50); color: var(--accent-600); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.import-option-card.selected .ioc-icon { background: var(--accent-500); color: #fff; }
.import-option-card .ioc-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; position: relative; }
.import-option-card.selected .ioc-radio { border-color: var(--accent-500); }
.import-option-card.selected .ioc-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent-500); }
.import-option-card .ioc-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.import-option-card .ioc-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }

.matching-key-note {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-50); border: 1px solid var(--accent-100); color: var(--accent-700);
  border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); font-size: 12.5px; margin-bottom: var(--sp-5);
}

/* Final review summary */
.import-review-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
@media (max-width: 1100px) { .import-review-grid { grid-template-columns: repeat(2, 1fr); } }
.review-stat-card {
  border-radius: var(--radius-lg); padding: var(--sp-5); text-align: center;
  background: var(--surface-muted); border: 1px solid var(--border-subtle);
}
.review-stat-card .rsc-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text-primary); }
.review-stat-card .rsc-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin-top: 6px; }
.review-stat-card.create .rsc-value { color: #7c5cbf; }
.review-stat-card.update .rsc-value { color: var(--accent-600); }
.review-stat-card.import .rsc-value { color: var(--emerald-600); }
.review-stat-card.review .rsc-value { color: var(--amber-600); }

/* Summary success step */
.import-success-block { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-4); padding: var(--sp-6) 0; }
.import-success-block .isb-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--emerald-50); color: var(--emerald-600);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  animation: htms-pop-in 0.4s var(--ease);
}
@keyframes htms-pop-in { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.import-success-block .isb-title { font-size: 19px; font-weight: 700; color: var(--text-primary); }
.import-success-block .isb-sub { font-size: 13px; color: var(--text-tertiary); max-width: 460px; line-height: 1.6; }
.import-success-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: var(--sp-2); }

/* Responsive tab bar for import center on small screens */
@media (max-width: 700px) {
  .import-tabs { width: 100%; overflow-x: auto; }
  .wizard-panel { padding: var(--sp-4); }
  .mapping-row { grid-template-columns: 1fr; gap: 8px; }
  .mapping-arrow { display: none; }
  .import-review-grid { grid-template-columns: 1fr 1fr; }
  .validation-summary-grid { grid-template-columns: 1fr 1fr; }
  .tdh-actions { width: 100%; }
  .tdh-actions .btn { flex: 1; }
}

/* ==========================================================================
   Import detection — what was read, and what was not.

   A client who uploads a 26-row sheet and gets 7 attendees back is owed the
   arithmetic and the reasons. "7 rows excluded after validation" tells them
   something went wrong without telling them what to fix.
   ========================================================================== */
.detect-summary {
  display: grid; gap: 10px; margin: 14px 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.detect-stat {
  padding: 11px 14px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--surface-muted);
}
.detect-stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px; font-weight: 800; color: var(--accent-ink); line-height: 1.15;
}
.detect-stat-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-tertiary); margin-top: 3px;
}

.detect-note {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 13px; margin-bottom: 16px;
  border: 1px solid var(--amber-100); border-left: 3px solid var(--amber-500);
  border-radius: var(--radius-sm); background: var(--amber-50);
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
}
.detect-note i { color: var(--amber-600); margin-top: 2px; }

.excluded-panel {
  margin: 14px 0 18px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--surface-card); overflow: hidden;
}
.excluded-panel > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  background: var(--surface-muted); list-style: none;
}
.excluded-panel > summary::-webkit-details-marker { display: none; }
.excluded-panel > summary i { color: var(--amber-600); }
.excluded-hint { font-weight: 500; color: var(--text-tertiary); }

.excluded-list { margin: 0; padding: 6px 0; list-style: none; max-height: 300px; overflow: auto; }
.excluded-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 6px 14px; font-size: 12.5px;
  border-top: 1px solid var(--border-subtle);
}
.excluded-list li:first-child { border-top: none; }
.excluded-row {
  flex-shrink: 0; min-width: 62px;
  font-weight: 700; color: var(--accent-ink);
}
.excluded-reason { color: var(--text-secondary); }
.excluded-more { padding: 8px 14px; font-size: 12px; color: var(--text-tertiary); border-top: 1px solid var(--border-subtle); }

/* ==========================================================================
   Import parsing state.

   Named stages, not a percentage. The reader cannot know how far through a
   workbook it is, and a bar that stalls at 80% reads as a crash — whereas
   "Detecting attendance table…" reads as work happening.
   ========================================================================== */
.import-parsing {
  margin-bottom: 16px;
  border: 1px solid var(--accent-200); border-radius: var(--radius-md);
  background: var(--accent-50);
}
.import-parsing-body { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.import-parsing-spin {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2.5px solid var(--accent-200); border-top-color: var(--accent-600);
  border-radius: 50%; animation: import-spin .7s linear infinite;
}
@keyframes import-spin { to { transform: rotate(360deg); } }
.import-parsing-text { flex: 1; min-width: 0; }
.import-parsing-stage { font-size: 13.5px; font-weight: 700; color: var(--accent-700); }
.import-parsing-file {
  font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==========================================================================
   Phase E — session metadata reconciliation (Import Center, step 5)

   The table answers one question per row: what will this import do to this
   field? The fourth column says it in words, so nobody has to infer intent
   from a tick and a colour.
   ========================================================================== */
/* The shared .enterprise-table carries min-width:900px and nowrap cells, which
   here pushes "What will happen" off the right edge behind a scrollbar — the
   one column the whole step exists to show. This table is nine short rows, so
   it drops both and wraps instead. */
/* .enterprise-table sets nowrap via `thead th` / `tbody td`, so these have to
   match that specificity to win — a bare `.meta-compare td` silently loses. */
.meta-compare { min-width: 0; table-layout: fixed; }
.meta-compare thead th,
.meta-compare tbody td { white-space: normal; vertical-align: middle; }
.meta-compare thead th:nth-child(1) { width: 22%; }
.meta-compare thead th:nth-child(2) { width: 22%; }
.meta-compare thead th:nth-child(3) { width: 22%; }
.meta-compare thead th:nth-child(4) { width: 34%; }

.meta-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.meta-pick.is-static { cursor: default; color: var(--text-secondary); font-weight: 600; }
.meta-pick input { cursor: pointer; margin: 0; }

.meta-outcome { font-size: 12.5px; color: var(--text-tertiary); }

/* Nothing detected, or already in agreement: quiet. */
.meta-row.meta-keep td,
.meta-row.meta-blank td,
.meta-row.meta-same td { color: var(--text-tertiary); }

/* A disagreement is worth noticing whether or not it is being applied. */
.meta-row.meta-conflict { background: var(--amber-50); }
.meta-row.meta-conflict .meta-outcome { color: var(--amber-700); font-weight: 600; }

/* A field this import will actually write. */
.meta-row.is-applied { background: var(--accent-50); }
.meta-row.is-applied .meta-outcome { color: var(--accent-700); font-weight: 700; }
.meta-row.meta-conflict.is-applied { background: var(--amber-100); }

.meta-summary,
.meta-receipt {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--emerald-50); font-size: 13px; line-height: 1.55;
}
.meta-summary i, .meta-receipt i { margin-top: 2px; color: var(--emerald-600); }
.meta-summary.has-changes, .meta-receipt.has-changes { background: var(--accent-50); }
.meta-summary.has-changes i, .meta-receipt.has-changes i { color: var(--accent-600); }
.meta-held { display: block; margin-top: 4px; color: var(--text-tertiary); }

.meta-receipt { max-width: 640px; margin: 16px auto 0; text-align: left; }
.meta-receipt ul { margin: 6px 0 0; padding-left: 18px; }
.meta-receipt li { margin-top: 3px; }
.meta-receipt s { color: var(--text-tertiary); }
