/* ===== Practice Protection — Phase F1 Dashboard Styles ===== */
/* Design: Bloomberg-meets-Linear dark theme with glassmorphism */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c26;
  --bg-sidebar: #0d0d14;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --border-light: #333348;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #5a5a70;
  --accent-blue: #6366f1;
  --accent-blue-glow: rgba(99, 102, 241, 0.15);
  --accent-green: #22c55e;
  --accent-green-bg: rgba(34, 197, 94, 0.12);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-purple: #a855f7;
  --accent-purple-bg: rgba(168, 85, 247, 0.12);
  --accent-cyan: #06b6d4;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-input: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border);
  --accent-blue-glow: rgba(99, 102, 241, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 100%;
  max-width: 260px;
  height: auto;
  object-fit: contain;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
}

/* In light mode the white bg is invisible against the white sidebar */
[data-theme="light"] .logo-img {
  background: transparent;
  padding: 4px 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.nav-item.active svg {
  color: var(--accent-blue);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--accent-purple-bg);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-purple);
  font-size: 0.75rem;
  font-weight: 600;
}

/* The class's display:flex would otherwise override the `hidden` attribute
   (which only hides at UA-stylesheet priority) — so hide it explicitly. */
.demo-badge[hidden] {
  display: none;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
  transition: background var(--transition);
}

/* Slightly dimmer than the status word: it is reference information, not a
   state the underwriter needs to read at a glance. The sidebar is narrow, so
   this must not push the status onto a second line. */
.status-version {
  opacity: 0.75;
  white-space: nowrap;
}

.connection-status.connected .status-dot {
  background: var(--accent-green);
}

.connection-status.error .status-dot {
  background: var(--accent-red);
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* Without this, a wide child (e.g. the header pipeline) forces this flex item to
     grow past the viewport instead of shrinking, overflowing the whole page. */
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Top Bar ===== */
.top-bar {
  height: var(--topbar-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* Shrink below content so the overflow:hidden (set inline) clips, and the header
     pipeline inside scrolls instead of stretching the top bar past the viewport. */
  min-width: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ===== Header Pipeline CSS ===== */
.header-pipeline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1rem;
  /* min-width:0 lets this flex item shrink so overflow-x can actually scroll,
     instead of expanding to fit every pill and being clipped by the top bar. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Fade the right edge as a subtle "scroll for more" affordance. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
}

.header-pipeline::-webkit-scrollbar {
  display: none;
}

.pipeline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}

.pipeline-pill:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.pipeline-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pipeline-chevron {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1;
}

.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--accent-green);
  padding: 0.3rem 0.6rem;
  background: var(--accent-green-bg);
  border-radius: 20px;
  font-weight: 500;
}

.refresh-indicator svg {
  animation: spin 4s linear infinite;
}

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

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

/* ===== Views ===== */
.view {
  display: none;
  padding: 1.5rem;
  flex: 1;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== KPI Cards ===== */
.kpi-row {
  display: grid;
  /* All 7 tiles on one row; minmax(0,…) lets tracks shrink so they never overflow. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  padding: 0.9rem 0.85rem;
  /* Stacked (icon on top, value, then label) so the full tile width is available
     to the label — keeps 7 condensed tiles readable on one row. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  transition: all var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.clickable-card:hover::before {
  opacity: 1;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-icon-blue {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.kpi-icon-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.kpi-icon-green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.kpi-icon-red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.kpi-icon-purple {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  /* Take the full tile width and allow shrinking so long labels wrap, not overflow. */
  width: 100%;
  min-width: 0;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* ===== Charts ===== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-header {
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.chart-body {
  padding: 1rem 1.25rem;
  height: 220px;
  position: relative;
  flex: 1;
}

.chart-body canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-link:hover {
  opacity: 0.8;
}

/* ===== Threat Thermometer ===== */
.thermometer-bar {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-input);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.thermometer-segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.thermometer-segment:hover {
  filter: brightness(1.2);
}

.thermometer-legend {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.thermometer-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: opacity var(--transition);
}

.thermometer-legend-item:hover {
  opacity: 0.8;
}

.thermometer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.thermometer-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.thermometer-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ===== Pipeline ===== */
.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.pipeline-section {
  margin-bottom: 1.5rem;
}

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.pipeline-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  position: relative;
  transition: all var(--transition);
}

.pipeline-stage:hover {
  border-color: var(--border-light);
}

.pipeline-stage-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-stage-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pipeline-stage-bar {
  margin-top: 0.5rem;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.pipeline-stage-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ===== Tables ===== */
/* Both class names are used in the markup; keep wide tables scrolling inside their
   own box so they never stretch the card/page (which cut off right-edge content). */
.table-container,
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(42, 42, 58, 0.5);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem !important;
}

.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable:hover {
  color: var(--text-primary);
}

.sort-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.4rem;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.3;
  transition: opacity 120ms ease, transform 120ms ease;
}

.sortable:hover .sort-arrow {
  opacity: 0.7;
}

.sortable.sort-active {
  color: var(--text-primary);
}

.sortable.sort-active .sort-arrow {
  opacity: 1;
}

.sortable.sort-asc .sort-arrow {
  transform: rotate(180deg);
}

/* ===== Status Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Ready for Review — green "good to go". */
.badge-ready {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

/* Freshly received (pre-verification) — neutral blue, distinct from Ready. */
.badge-received {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.badge-needs-human {
  background: rgba(249, 115, 22, 0.14);
  color: #f97316;
}

/* Information-validation gate — matches the "Info Validation" pipeline pill
   (#14b8a6 teal = COLORS.INFORMATION_VALIDATION_REQUIRED), kept distinct from
   the orange Needs Human badge. */
.badge-info-validation {
  background: rgba(20, 184, 166, 0.14);
  color: #14b8a6;
}

.badge-review {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.badge-info {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
}

.badge-escalated {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.badge-approved {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-declined {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.badge-closed {
  background: rgba(90, 90, 112, 0.15);
  color: var(--text-muted);
}

.badge-priority-rush {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.badge-priority-normal {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.badge-priority-low {
  background: rgba(90, 90, 112, 0.15);
  color: var(--text-muted);
}

/* ===== Filters ===== */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 160px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-end;
}

.btn-secondary:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.btn-page {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-page:hover:not(:disabled) {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.case-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Workload ===== */
.workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Empty-roster onboarding (fresh deployment: no underwriters yet). */
.workload-onboarding {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.workload-onboarding-icon { font-size: 2rem; line-height: 1; }

.workload-onboarding-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.workload-onboarding-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 32ch;
}

.workload-onboarding-btn {
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.workload-onboarding-btn:hover { filter: brightness(1.08); }

.workload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
}

.workload-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.workload-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.workload-name-text {
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
  padding-bottom: 1px;
}
.workload-name-text:hover {
  border-bottom-color: var(--text-muted);
}

.workload-rename-input {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-secondary, #1e1e2e);
  color: var(--text-primary, #fff);
  border: 1px solid var(--accent, #6366f1);
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  width: 100%;
  max-width: 160px;
}

.workload-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.workload-edit-btn:hover {
  color: var(--accent, #6366f1);
  opacity: 1;
}

.workload-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.workload-count {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0.4rem;
}

.workload-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.workload-bar {
  margin-top: 0.75rem;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transition: width 0.6s ease;
}

/* Clickable / active card */
.workload-card {
  cursor: pointer;
  position: relative;
}

.workload-card.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Remove (×) button on card */
.workload-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  opacity: 0;
}
.workload-card:hover .workload-remove-btn { opacity: 1; }
.workload-remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Workload toolbar */
.workload-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.workload-toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.workload-toolbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.workload-toolbar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Add Member trigger button */
.workload-add-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  color: white;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}
.workload-add-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}
.workload-add-icon {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
}

/* Add member form */
.workload-add-form {
  margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
}
.workload-add-form-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.workload-add-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  opacity: 0.7;
}
.workload-add-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}
.workload-add-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-glow);
}
.workload-add-input::placeholder {
  color: var(--text-muted);
}
.workload-add-save,
.workload-add-cancel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  background: transparent;
}
.workload-add-save {
  color: var(--accent-green);
  border-color: rgba(34, 197, 94, 0.3);
}
.workload-add-save:hover {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
}
.workload-add-cancel {
  color: var(--text-muted);
}
.workload-add-cancel:hover {
  color: var(--accent-red);
  background: var(--accent-red-bg);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Worker detail panel */
.workload-detail-panel {
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.workload-detail-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}
.workload-detail-body {
  padding: 0 1.25rem 1rem;
}

/* Assignment dropdown */
.assign-select {
  padding: 0.35rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 160px;
  transition: border-color var(--transition);
}
.assign-select:hover { border-color: var(--accent-blue); }
.assign-select:focus { border-color: var(--accent-blue); outline: none; }

/* Priority dropdown — compact, color-coded to match badge colors */
.priority-select {
  padding: 0.2rem 0.45rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color var(--transition), opacity var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-align: center;
  min-width: 72px;
}
.priority-select:hover { opacity: 0.85; }
.priority-select:focus { outline: none; border-color: var(--text-muted); }
.priority-select-rush { background: var(--accent-red-bg); color: var(--accent-red); }
.priority-select-normal { background: var(--accent-blue-glow); color: var(--accent-blue); }
.priority-select-low { background: rgba(90, 90, 112, 0.15); color: var(--text-muted); }

/* Queue-status dropdown — compact, color-coded to match status badges.
   Explicit font/line-height/box-sizing keep the closed pill identical across
   platforms (Windows Chrome otherwise inherits Segoe UI + a taller intrinsic
   line-height for <select>, making the pill look chunkier than on macOS).
   The chevron is a data-URI SVG since appearance:none strips the native one. */
.status-select {
  padding: 0.2rem 1.15rem 0.2rem 0.6rem;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: border-color var(--transition), opacity var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-align: left;
  text-align-last: left;
  min-width: 90px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'><path d='M1 1l3 3 3-3' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 8px 6px;
}
.status-select:hover { opacity: 0.85; }
.status-select:focus { outline: none; border-color: var(--text-muted); }
/* The <option> popover chrome is OS-drawn, but Chromium respects color/background
   on the options themselves — this at least gives Windows readable labels in the
   app's theme rather than raw system defaults. */
.status-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}
.status-select-ready { background: var(--accent-blue-glow); color: var(--accent-blue); }
.status-select-needs-human { background: rgba(249, 115, 22, 0.14); color: #f97316; }
.status-select-info-validation { background: rgba(20, 184, 166, 0.14); color: #14b8a6; }
.status-select-review { background: var(--accent-amber-bg); color: var(--accent-amber); }
.status-select-info { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.status-select-escalated { background: var(--accent-purple-bg); color: var(--accent-purple); }
.status-select-approved { background: var(--accent-green-bg); color: var(--accent-green); }
.status-select-declined { background: var(--accent-red-bg); color: var(--accent-red); }
.status-select-closed { background: rgba(90, 90, 112, 0.15); color: var(--text-muted); }

/* Workload case table */
.workload-case-table { margin-top: 0.75rem; }

/* ===== Decisions Summary ===== */
.decisions-summary {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
  min-height: 200px;
}

.decision-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.decision-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 120px;
}

.decision-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.decision-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.decision-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pipeline-stages {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .pipeline-stages {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filter-select {
    min-width: 100%;
  }
}

/* ===== Slide-over Panel ===== */
.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.slide-panel.open {
  transform: translateX(0);
}

/* Full-screen review. The panel is fixed to the right edge, so widening it to
   the viewport is all that is needed — no layout reflow, and the open/close
   transform still works. Capped at 100vw so it can never exceed the window. */
.slide-panel.fullscreen {
  width: 100vw;
  box-shadow: none;
  border-left: none;
}

/* Content stays readable rather than stretching a two-column grid across an
   ultrawide monitor: the panel fills the window, its content centres. */
.slide-panel.fullscreen .panel-content {
  padding: 1.5rem clamp(1.5rem, 6vw, 8rem);
}

/* Match the header's horizontal padding to the content's so the case id and
   tags don't hug the left edge in fullscreen. */
.slide-panel.fullscreen .panel-header {
  padding-left: clamp(1.5rem, 6vw, 8rem);
  padding-right: clamp(1.5rem, 6vw, 8rem);
}

/* With the extra width the identity/detail grids get more columns instead of
   longer, sparser rows. */
.slide-panel.fullscreen .detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-fullscreen-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.panel-fullscreen-pill:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent-blue);
}

/* Reads as "on" while engaged, so the control shows the current state rather
   than only the action. */
.panel-fullscreen-pill[aria-pressed="true"] {
  color: #fff;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.panel-fullscreen-pill svg {
  flex-shrink: 0;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.panel-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.panel-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.detail-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Application Details corrections form: flags a field with no value (either
   never extracted or cleared by the underwriter) so it's scannable at a
   glance which fields still need completing. */
.detail-item.field-missing .detail-label {
  color: var(--accent-amber);
}

.detail-item.field-missing input,
.detail-item.field-missing textarea {
  border-color: var(--accent-amber);
}

.field-caption {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.verification-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Verification accordion items */
.verify-item.verify-accordion {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}

.verify-item.verify-accordion:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.verify-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  user-select: none;
}

.verify-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.verify-icon.pass {
  color: var(--accent-green);
}

.verify-icon.fail {
  color: var(--accent-red);
}

.verify-text {
  font-size: 0.85rem;
  font-weight: 600;
  flex: 1;
}

.verify-status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.pill-pass {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.pill-fail {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.verify-icon.review {
  color: var(--accent-amber);
}

.verify-icon.unsupported {
  color: var(--text-muted);
}

.pill-review {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.pill-unsupported {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

/* A check can read Verified because a person overrode the automated finding.
   The badge says so in the collapsed row; the note inside gives the account. */
.verify-manual-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-blue);
}

.verify-manual-note {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: rgba(99, 102, 241, 0.07);
  border-left: 2px solid var(--accent-blue);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.6rem;
}

.verify-manual-note strong {
  color: var(--text-primary);
}

.verify-manual-note a {
  color: var(--accent-blue);
  overflow-wrap: anywhere;
}

.verify-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.verify-accordion.verify-open .verify-chevron {
  transform: rotate(180deg);
}

.verify-accordion.verify-open {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

/* Expandable detail panel */
.verify-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border-top: 0 solid transparent;
}

.verify-accordion.verify-open .verify-detail {
  max-height: 600px;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

.verify-detail strong {
  color: var(--text-primary);
  font-weight: 600;
}

.verify-reason-pass {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}

.verify-reason-fail {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}

.verify-reason-note {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Manual verification link */
.verify-manual-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.verify-manual-link:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-blue);
  color: #818cf8;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
  transform: translateX(2px);
}
.verify-manual-link svg {
  flex-shrink: 0;
}

/* ===== Evidence Screenshots ===== */
.verify-screenshots {
  margin-top: 0.75rem;
}

.evidence-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.evidence-label svg {
  opacity: 0.6;
}

.evidence-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.evidence-thumb {
  position: relative;
  width: 120px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.evidence-thumb:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.evidence-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  object-position: top left;
  display: block;
  background: #0e0e14;
}

.evidence-thumb-label {
  display: block;
  padding: 0.25rem 0.35rem;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
}

/* Full-screen review: bigger evidence.
   At 120x80 a board screenshot is cropped to roughly its top-left corner —
   enough to know an image exists, not enough to tell a licensee record from a
   blank search form, which is exactly the judgement an underwriter is making
   when deciding whether a capture is worth keeping. The extra width in
   full-screen mode goes to the thumbnails rather than to more of them per row. */
.slide-panel.fullscreen .evidence-thumbs {
  gap: 0.75rem;
}

.slide-panel.fullscreen .evidence-thumb {
  width: 300px;
}

.slide-panel.fullscreen .evidence-thumb img {
  height: 200px;
}

/* The label has room to be legible rather than a 0.6rem ellipsis. */
.slide-panel.fullscreen .evidence-thumb-label {
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
}

/* Scaled with the thumbnail so it stays an easy target, not a speck. */
.slide-panel.fullscreen .evidence-thumb-delete {
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.85rem;
}

/* The hover "expand" glyph scales too — a 20px icon centred on a 300x200 tile
   reads as a smudge rather than an affordance. */
.slide-panel.fullscreen .evidence-thumb::after {
  background-size: 32px;
}

/* Expand icon overlay on hover */
.evidence-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cpolyline points='9 21 3 21 3 15'%3E%3C/polyline%3E%3Cline x1='21' y1='3' x2='14' y2='10'%3E%3C/line%3E%3Cline x1='3' y1='21' x2='10' y2='14'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  pointer-events: none;
}

.evidence-thumb:hover::after {
  opacity: 1;
}

/* ===== Screenshot Lightbox ===== */
.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.screenshot-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.screenshot-lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.lightbox-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lightbox-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.lightbox-close:hover {
  background: var(--bg-input);
  color: var(--accent-red);
}

.lightbox-body {
  overflow: auto;
  padding: 0;
}

.lightbox-body img {
  display: block;
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  padding-left: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.25rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-blue);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.timeline-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--bg-input);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Make table rows clickable */
.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(99, 102, 241, 0.05) !important;
}

/* ===== Work Queue Step Badges ===== */
.badge-wq-processing {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
  animation: pulse-processing 1.8s ease-in-out infinite;
  position: relative;
}

.badge-wq-processing::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  margin-right: 0.35rem;
  animation: dot-blink 1.2s ease-in-out infinite;
}

.badge-wq-validating {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  animation: pulse-validating 1.8s ease-in-out infinite;
  position: relative;
}

.badge-wq-validating::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
  margin-right: 0.35rem;
  animation: dot-blink 1.2s ease-in-out infinite;
}

.badge-wq-complete {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-wq-complete::before {
  content: '✓';
  margin-right: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
}

.badge-wq-skipped {
  background: rgba(90, 90, 112, 0.15);
  color: var(--text-muted);
}

/* Active row glow for in-progress steps */
.step-active-row {
  background: rgba(99, 102, 241, 0.03) !important;
  animation: row-glow 2s ease-in-out infinite;
}

@keyframes pulse-processing {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
  }

  50% {
    box-shadow: 0 0 8px 2px rgba(99, 102, 241, 0.2);
  }
}

@keyframes pulse-validating {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3);
  }

  50% {
    box-shadow: 0 0 8px 2px rgba(245, 158, 11, 0.2);
  }
}

@keyframes dot-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes row-glow {

  0%,
  100% {
    background: rgba(99, 102, 241, 0.03);
  }

  50% {
    background: rgba(99, 102, 241, 0.06);
  }
}

/* ===== Case Report Card ===== */
.report-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.report-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.report-case-id {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.report-generated {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.report-file-list {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.report-file-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.report-file-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
}

.report-file-item + .report-file-item {
  border-top: 1px solid rgba(42, 42, 58, 0.3);
}

.report-file-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.report-file-name {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-file-size {
  color: var(--text-muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.report-file-original {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.report-file-view {
  color: var(--accent, #6366f1);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.15s ease;
}

.report-file-view:hover {
  background: rgba(99, 102, 241, 0.12);
  text-decoration: underline;
}

.report-file-onedrive {
  color: #0078d4;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.15s ease;
}

.report-file-onedrive:hover {
  background: rgba(0, 120, 212, 0.12);
  text-decoration: underline;
}

.drive-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.drive-status-pill .drive-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.drive-status-synced {
  background: rgba(0, 120, 212, 0.14);
  color: #0078d4;
}

.drive-status-synced .drive-status-dot {
  background: #0078d4;
}

.drive-status-local {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted, #94a3b8);
}

.drive-status-local .drive-status-dot {
  background: var(--text-muted, #94a3b8);
}

.report-view-btn-drive {
  background: rgba(0, 120, 212, 0.12);
  color: #0078d4;
  border-color: rgba(0, 120, 212, 0.35);
  text-decoration: none;
}

.report-view-btn-drive:hover {
  background: rgba(0, 120, 212, 0.2);
}

.report-actions {
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.report-download-btn,
.report-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  /* Uniform width so Download, View Report, and View Application read as
     three peers of the same shape rather than one stretched primary and
     two shrink-to-fit secondaries. */
  width: 13rem;
  flex: 0 0 auto;
}

.report-download-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  border: none;
}

.report-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  filter: brightness(1.1);
}

.report-view-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
}

.report-view-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.report-preview-container {
  border-top: 1px solid var(--border);
  padding: 0;
  background: #1e1e24; /* Darker background for the iframe container */
}

.report-preview-iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* ===== Application Details: application beside the fields =====
   Transcribing from the application into the form needs both visible at once,
   so this splits rather than overlays. Default is a single column — the split
   only exists while the application is open. */
.appdetails-layout {
  display: grid;
  grid-template-columns: 1fr;
}

.appdetails-layout.appdetails-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  padding-left: 1.5rem;
  align-items: start;
}

/* The document column comes first in the DOM so that when the split collapses
   on a narrow screen the application sits above the fields rather than below
   a long form. */
/* Must out-specify the rule below: `display: flex` on a class beats the UA
   stylesheet's `[hidden] { display: none }`, which left the panel on screen —
   an empty black iframe above the form — while scripts still read it as
   hidden, so the close button "opened" it. */
.appdetails-application[hidden] {
  display: none;
}

.appdetails-application {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 1rem;
  /* Tall enough to read a form page without scrolling the page itself. */
  height: calc(100vh - 9rem);
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #1e1e24;
  overflow: hidden;
}

.appdetails-application-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.appdetails-application-select {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
}

/* One attachment is the common case; a picker showing a single fixed option is
   noise, so it is hidden and the bar keeps just the close control. */
.appdetails-application-select.appdetails-single {
  display: none;
}

.appdetails-application-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}

.appdetails-application-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.appdetails-application-frame {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}

.appdetails-pill[aria-pressed="true"] {
  outline: 2px solid #7c2d12;
  outline-offset: 1px;
}

/* Below this the two columns are too narrow to read, so stack them. The
   application loses its sticky full-height treatment and becomes a fixed band
   above the fields. */
@media (max-width: 1100px) {
  .appdetails-layout.appdetails-split {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .appdetails-layout.appdetails-split .appdetails-application {
    position: static;
    height: 60vh;
    margin: 0 1.5rem;
  }
}

/* ===== Verification Browser Modal ===== */
.verify-browser-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.verify-browser-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.verify-browser-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 1;
}

.verify-browser-container {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.verify-browser-modal.open .verify-browser-container {
  transform: scale(1) translateY(0);
}

/* Browser-chrome style header */
.verify-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.verify-browser-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.verify-browser-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.verify-browser-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.verify-browser-url-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  transition: border-color 0.2s;
}

.verify-browser-url-container:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.verify-browser-lock {
  color: var(--accent-green);
  display: flex;
  flex-shrink: 0;
}

.verify-browser-url {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.verify-browser-url::placeholder {
  color: var(--text-muted);
}

.verify-browser-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.verify-browser-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verify-browser-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.verify-browser-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

/* Scrollable viewport for page screenshot */
.verify-browser-viewport {
  flex: 1;
  overflow: hidden;
  background: #0e0e14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
}

.verify-browser-screenshot {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  image-rendering: auto;
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
  /* Center horizontally when height-constrained (narrower than container) */
  margin: 0 auto;
}

/* Loading state */
.verify-browser-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  min-height: 300px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.verify-browser-loading-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.verify-browser-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error state */
.verify-browser-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  min-height: 300px;
  color: var(--accent-red);
  text-align: center;
  padding: 2rem;
}

.verify-browser-error-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.verify-browser-error-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 500px;
}

.verify-browser-retry-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.verify-browser-retry-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Action bar */
.verify-browser-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.verify-browser-actions-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.verify-browser-actions-right {
  flex-shrink: 0;
}

.verify-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.verify-capture-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.verify-capture-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

.verify-capture-btn.capturing {
  pointer-events: none;
  opacity: 0.7;
}

.verify-capture-btn.capturing span::after {
  content: '...';
  animation: dot-pulse 1s steps(3) infinite;
}

@keyframes dot-pulse {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

/* Verify status button states */
.verify-status-btn {
  font-weight: 700;
  padding: 0.55rem 1.25rem;
}

.verify-status-not-verified {
  background: linear-gradient(135deg, var(--accent-green), #16a34a);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.verify-status-not-verified:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
  filter: brightness(1.1);
}

.verify-status-verified {
  background: var(--bg-input);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.verify-status-verified:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
}

/* Proof thumbnail gallery */
.verify-proof-gallery {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.1rem 0;
}

.verify-proof-thumb {
  position: relative;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--accent-green);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.2);
}

.verify-proof-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.verify-proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

.verify-proof-thumb .proof-check {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  font-weight: 800;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* Verification browser button (replaces verify-manual-link in accordion) */
.verify-browser-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  color: var(--accent-blue);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.verify-browser-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.22));
  border-color: var(--accent-blue);
  color: #818cf8;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.verify-browser-btn svg {
  flex-shrink: 0;
}

.verify-browser-btn:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

/* Secondary variant for the Cloudflare escape hatch — outlined and quieter
   than the primary co-browse button so the default action still reads as
   primary and the escape hatch as an alternate. */
.verify-browser-btn-alt {
  margin-left: 0.4rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px dashed var(--border-light);
}

.verify-browser-btn-alt:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
  border-color: var(--text-secondary);
  box-shadow: none;
}

/* Manual verify dock — floating panel used with the "Open in my browser"
   escape hatch. Fixed to the viewport so it stays reachable while the
   underwriter Alt-Tabs between the app and the source-site tab, and z-indexed
   above the case panel and its fullscreen overlay. */
.manual-verify-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  z-index: 1200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.manual-verify-dock[hidden] {
  display: none;
}

.manual-verify-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
}

.manual-verify-dock-title {
  display: flex;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

.manual-verify-dock-title > span:first-child {
  color: var(--text-muted);
}

.manual-verify-dock-check {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-verify-dock-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

.manual-verify-dock-close:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.15);
}

.manual-verify-dock-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.manual-verify-dock-instructions {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.manual-verify-dock-instructions kbd {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-input);
}

.manual-verify-dock-instructions a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.manual-verify-dock-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
  font: inherit;
}

.manual-verify-dock-drop:hover,
.manual-verify-dock-drop.is-dragover {
  border-color: var(--accent-blue);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.manual-verify-dock-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.4;
}

.manual-verify-dock-preview {
  max-width: 100%;
  max-height: 12rem;
  border-radius: var(--radius-sm);
  object-fit: contain;
  display: block;
}

/* The class rule above sets display:block, which outranks the browser
   default styling for [hidden]. Without this override the empty <img>
   still lays out (as the alt-text placeholder) and the drop zone looks
   like it has a broken image in it before any screenshot is chosen. */
.manual-verify-dock-preview[hidden] {
  display: none;
}

.manual-verify-dock-status {
  min-height: 1.1rem;
  font-size: 0.75rem;
}

.manual-verify-dock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
}

.manual-verify-dock-cancel,
.manual-verify-dock-submit {
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.manual-verify-dock-cancel {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.manual-verify-dock-cancel:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.manual-verify-dock-submit {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
}

.manual-verify-dock-submit:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.manual-verify-dock-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Delete control on an evidence thumbnail. Hidden until the thumbnail is
   hovered — destructive, and the common action here is opening the image, not
   removing it. */
.evidence-thumb {
  position: relative;
}

.evidence-thumb-delete {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  line-height: 1;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(190, 40, 40, 0.9);
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.evidence-thumb:hover .evidence-thumb-delete,
.evidence-thumb-delete:focus {
  display: block;
}

.evidence-thumb-delete:hover {
  background: rgb(210, 45, 45);
}

/* One practitioner inside the Additional Practitioners accordion. Bordered
   rather than ruled, so a thirty-person roster reads as a list of people
   instead of a wall of text. */
.practitioner-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  margin-top: 0.5rem;
  background: var(--bg-secondary);
}

.practitioner-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.practitioner-row-ids {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* The four checks, wrapping rather than overflowing the narrow panel. */
.practitioner-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.35rem;
}

.practitioner-check {
  font-size: 0.68rem;
  white-space: nowrap;
}

/* "Individual Application" toggle inside the Business Entity accordion. */
.individual-app-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.individual-app-toggle input {
  cursor: pointer;
}

.individual-app-toggle:hover {
  border-color: var(--accent-blue);
}

/* Licences table — an editable grid, so the cells are inputs rather than text. */
.licensure-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.licensure-table .licensure-cell {
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

.licensure-row-delete {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  color: var(--accent-red);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.licensure-row-delete:hover {
  border-color: var(--accent-red);
  background: rgba(200, 50, 50, 0.1);
}

.licensure-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.licensure-save-msg {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Google Search: the catch-all section's action row. Wraps rather than
   overflowing, since the right-hand panel is narrow and this holds three
   buttons. */
.addl-evidence-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.addl-evidence-actions .verify-browser-btn {
  margin-top: 0;
}

.addl-evidence-status {
  flex-basis: 100%;
  min-height: 1rem;
  font-size: 0.72rem;
  line-height: 1.3;
}

/* Proof attached indicator on accordion */
.verify-proof-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-left: 0.4rem;
  opacity: 0.9;
}

.verify-proof-indicator svg {
  width: 10px;
  height: 10px;
}

/* Manually verified pill style */
.pill-manual-pass {
  background: linear-gradient(135deg, var(--accent-green-bg), rgba(34, 197, 94, 0.15));
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Responsive adjustments for verification browser */
@media (max-width: 900px) {
  .verify-browser-container {
    width: 96vw;
    height: 92vh;
    border-radius: var(--radius-md);
  }

  .verify-browser-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .verify-browser-actions-left,
  .verify-browser-actions-right {
    width: 100%;
  }

  .verify-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Interactive Browser Styles ===== */

/* Focus ring on viewport when keyboard capture is active */
.verify-browser-viewport:focus-within,
.verify-browser-viewport:focus {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Processing overlay: shows briefly after click/action, hides when screenshot arrives */
.verify-browser-processing {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  display: none;
  z-index: 5;
}

.verify-browser-processing.active {
  display: block;
}

.verify-processing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: processing-pulse 0.8s ease-in-out infinite;
}

@keyframes processing-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Click ripple feedback */
.verify-click-ripple {
  position: fixed;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.35);
  border: 1.5px solid rgba(99, 102, 241, 0.6);
  pointer-events: none;
  z-index: 9999;
  animation: click-ripple-anim 0.5s ease-out forwards;
}

@keyframes click-ripple-anim {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* ── Scroll Indicator ─────────────────────────────────────────────── */
.verify-browser-viewport.scrolling::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0.8;
  z-index: 10;
  animation: scroll-indicator-pulse 0.3s ease-out;
}

@keyframes scroll-indicator-pulse {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ── Data HUD Overlay ─────────────────────────────────────────────── */
.verify-data-hud {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 280px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  color: #1a1a1a;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  overflow: hidden;
}

.verify-data-hud.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.verify-data-hud.collapsed .verify-data-hud-body {
  display: none;
}

.verify-data-hud.collapsed {
  width: auto;
}

.verify-data-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  cursor: move;
}

.verify-data-hud-title {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #111;
}

.verify-data-hud-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}

.verify-data-hud-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #111;
}

.verify-data-hud-body {
  padding: 8px 0;
}

.verify-data-hud-row {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 6px;
}

.verify-data-hud-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.verify-data-hud-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 65px;
  flex-shrink: 0;
}

.verify-data-hud-value {
  font-size: 12px;
  color: #1a1a1a;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.verify-data-hud-copy {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.verify-data-hud-row:hover .verify-data-hud-copy {
  opacity: 1;
}

.verify-data-hud-copy:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

.verify-data-hud-copy.copied {
  color: #16a34a;
  opacity: 1;
}

/* ── Action bar button variants ────────────────────────────────────── */
.verify-scroll-bottom-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.verify-scroll-bottom-btn:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  color: var(--accent-blue) !important;
}

.verify-data-hud-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.verify-data-hud-btn:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  color: var(--accent-blue) !important;
}

.verify-data-hud-btn.active {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: var(--accent-blue) !important;
}

/* ===== Standalone Login Page (login.html) ===== */
.login-page {
  display: block;              /* override the app's flex body layout */
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--shadow-glow), transparent),
    var(--bg-primary);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.25rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 2rem;
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.login-logo img {
  height: 48px;
  width: auto;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 1.75rem;
}

.login-field {
  text-align: left;
  margin-bottom: 1rem;
}
.login-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}
.login-field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-error {
  text-align: left;
  font-size: 0.8rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.85rem;
}

.login-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.login-btn:hover { opacity: 0.92; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: 0.6; cursor: default; }

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

.login-sso-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}
.login-sso-btn:hover { border-color: var(--accent-blue); }

.login-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 360px;
}

/* ===== Header user menu + logout dropdown ===== */
.user-menu {
  position: relative;
}
.user-menu .user-avatar {
  cursor: pointer;
  border: none;
  padding: 0;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 200;
  overflow: hidden;
}
.user-dropdown-header {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.user-dropdown-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.user-dropdown-item:hover { background: var(--bg-primary); }
/* ===== Admin Panel — Credential & API Key Management ===== */
.badge-pending {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

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

/* Inline add/edit form (mirrors the Invite User form) */
.credential-form {
  padding: 1.25rem 1.5rem;
  margin: 0 1.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.credential-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.credential-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}
@media (max-width: 700px) {
  .credential-form-grid { grid-template-columns: 1fr; }
}

/* Category pills */
.credential-category-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.cat-license    { background: var(--accent-blue-glow);   color: var(--accent-blue); }
.cat-business   { background: var(--accent-green-bg);    color: var(--accent-green); }
.cat-national   { background: var(--accent-purple-bg);   color: var(--accent-purple); }
.cat-captcha    { background: var(--accent-amber-bg);    color: var(--accent-amber); }
.cat-commercial { background: rgba(6, 182, 212, 0.12);   color: var(--accent-cyan); }

/* Credential table cells */
.credential-table .cred-name { font-weight: 600; color: var(--text-primary); }
.credential-table .cred-key {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.cred-mask {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}
.cred-notset { color: var(--text-muted); font-style: italic; font-size: 0.78rem; }

.cred-actions { white-space: nowrap; }
.cred-action {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  margin-right: 0.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.cred-action:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.cred-action:disabled { opacity: 0.6; cursor: default; }
.cred-action-danger { color: var(--accent-red); border-color: var(--accent-red-bg); }
.cred-action-danger:hover { background: var(--accent-red-bg); color: var(--accent-red); }

/* ── Admin Panel: sub-tabs ─────────────────────────────────────────────── */
.admin-subtabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-subtab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.admin-subtab:hover { color: var(--text-primary); }
.admin-subtab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}
.admin-tab-pane[hidden] { display: none; }

/* ── Information Validation: required-fields page ──────────────────────── */
.vf-intro { padding: 0; }
.vf-intro-body { padding: 1.25rem 1.5rem; }
.vf-intro-body h2 { margin: 0 0 0.5rem; }
.vf-help {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  max-width: 100ch;
}
.vf-help strong { color: var(--text-primary); }
.vf-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--accent-blue-glow);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.vf-summary-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
}

/* buttons (shared by the header + form) */
.vf-btn {
  appearance: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}
.vf-btn-primary {
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  color: #fff;
}
.vf-btn-primary:hover { background: #4f52e0; border-color: #4f52e0; }
.vf-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.vf-btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.vf-btn:disabled { opacity: 0.6; cursor: default; }

/* inline add/edit form */
.vfield-form {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
}
.vfield-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}
.vf-input-group { display: flex; flex-direction: column; gap: 0.35rem; }
.vf-input-wide { grid-column: 1 / -1; }
.vf-input-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.vf-optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
.vfield-form input[type="text"],
.vfield-form select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
}
.vfield-form input[type="text"]:focus,
.vfield-form select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}
.vf-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
}
.vf-check-inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-blue); cursor: pointer; }
.vf-builtin-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 70ch;
}
.vfield-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}
.vf-form-msg { font-size: 0.8rem; margin-right: auto; }

/* fields table */
.vfield-table { table-layout: fixed; width: 100%; }
.vfield-table td { vertical-align: middle; white-space: normal; overflow-wrap: break-word; word-wrap: break-word; }
.vfield-table th:first-child,
.vfield-table td:first-child { text-align: center; }
.vf-row-check { width: 17px; height: 17px; accent-color: var(--accent-green); cursor: pointer; }
.vf-field-label { font-weight: 600; color: var(--text-primary); }
.vf-field-desc {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.vf-type-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.vf-source-tag { font-size: 0.78rem; color: var(--text-secondary); }
.vf-badge-builtin { background: var(--accent-blue-glow); color: var(--accent-blue); }
.vf-badge-custom { background: var(--accent-purple-bg); color: var(--accent-purple); }
.vf-badge-builtin, .vf-badge-custom {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}
.vf-action {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.74rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.vf-action:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.vf-action-danger { color: var(--accent-red); border-color: var(--accent-red-bg); }
.vf-action-danger:hover { background: var(--accent-red-bg); color: var(--accent-red); }

/* ── User Guide ─────────────────────────────────────────────────────────── */
.guide-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 1100px;
  margin: 0;
  padding: 0.5rem 0 4rem 1.25rem;
}

.guide-toc {
  position: sticky;
  top: calc(var(--topbar-height) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - 2rem);
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.25rem 0;
  border-right: 1px solid var(--border);
}

.guide-toc-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary, var(--text-secondary));
  margin: 0 0 0.75rem 0.25rem;
}

#guide-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#guide-toc-nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.3;
  border-left: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

#guide-toc-nav a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

#guide-toc-nav a.active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  background: var(--accent-blue-bg, transparent);
}

.guide-content {
  min-width: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.guide-header {
  margin-bottom: 2rem;
}

.guide-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.guide-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.guide-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.guide-section h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light, var(--border));
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.guide-section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.guide-section p {
  margin: 0 0 0.85rem;
  color: var(--text-primary);
  font-size: 0.93rem;
}

.guide-section ol,
.guide-section ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  color: var(--text-primary);
  font-size: 0.93rem;
}

.guide-section li {
  margin-bottom: 0.4rem;
}

.guide-section code {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Inline status pills in the guide should match the surrounding text size
   (they inherit from .badge which uses a much smaller default). Padding
   scales up too so proportions stay right. */
.guide-section .badge {
  font-size: 0.9rem;
  padding: 0.22rem 0.75rem;
  line-height: 1.3;
  vertical-align: baseline;
}

/* The Case List renders READY_FOR_REVIEW via .status-select-ready (blue),
   not the green .badge-ready fallback — override just inside the guide so
   our Ready pill matches what users actually see. */
.guide-section .badge-ready {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

/* Status reference list: pills sit in a fixed-width column so every
   definition starts at the same x position, regardless of pill length. */
.guide-status-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem;
}
.guide-status-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  column-gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.guide-status-list li > .badge {
  display: flex;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.guide-callout {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.guide-callout-tip { border-left: 3px solid var(--accent-blue); }
.guide-callout-warn { border-left: 3px solid var(--accent-orange, #f97316); }
.guide-callout-note { border-left: 3px solid var(--text-tertiary, var(--text-secondary)); }

.guide-shot {
  margin: 1rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .guide-toc {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
  }
}


/* ── Case list: entity expansion ──────────────────────────────────────────
   An entity policy is one limit shared by a practice and everyone under it.
   The practice keeps a single row — a roster of thirty would otherwise bury
   every other case on the page — and discloses its practitioners on request.
*/

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

/* Fixed and narrow: the column holds a control, so it must not take width
   from the data columns beside it. */
.case-expand-col {
  width: 2.25rem;
  padding-right: 0 !important;
}

.case-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.case-expand-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.case-expand-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.case-expand-caret {
  font-size: 0.7rem;
  line-height: 1;
}

/* Sits beside the applicant name, so an entity's outstanding work reads off
   the collapsed row — the count is the reason the row can stay collapsed. */
.case-roster-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.case-roster-badge-done {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

/* Recessed against the parent row, and marked down the left edge, so a long
   roster still reads as belonging to the practice above it. */
.case-child-row > td {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  font-size: 0.8rem;
}

.case-child-row > td:nth-child(2) {
  border-left: 2px solid var(--border-light);
}

.case-child-name {
  color: var(--text-primary);
  font-weight: 500;
}

.case-child-ids {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.case-child-kind {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-child-check {
  display: inline-block;
  margin: 0.1rem 0.3rem 0.1rem 0;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  text-transform: capitalize;
  white-space: nowrap;
}

.case-child-check-ok {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.case-child-check-warn {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.case-child-check-bad {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.case-child-check-muted,
.case-child-check-pending {
  background: var(--bg-input);
  color: var(--text-secondary);
}
