@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f7fb;
  --bg-soft: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f8fafd;
  --surface-muted: #f1f5fb;
  --line: #dbe4f0;
  --line-strong: #c7d3e2;
  --text: #142033;
  --muted: #64748b;
  --muted-strong: #475569;
  --primary: #135cc8;
  --primary-dark: #0b3f91;
  --primary-soft: #e9f1ff;
  --ink: #0f172a;
  --success: #15803d;
  --success-soft: #eaf8ef;
  --warning: #b76e00;
  --warning-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", "Aptos", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(circle at 14% -10%, rgba(19, 92, 200, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, var(--bg-soft) 100%);
  overflow-x: hidden;
}

.page-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 80;
  background: transparent;
}

.page-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #135cc8, #36a3ff);
  box-shadow: 0 0 14px rgba(19, 92, 200, 0.35);
  transition: width 220ms ease;
}

.page-progress.done {
  opacity: 0;
  transition: opacity 180ms ease;
}

.app-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.assistant-fab {
  border: 1px solid #c8dbfb;
  background: linear-gradient(135deg, #135cc8, #0c3476);
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(19, 92, 200, 0.28);
  font-weight: 800;
  cursor: pointer;
}

.assistant-fab-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #8cf2bf;
  box-shadow: 0 0 0 4px rgba(140, 242, 191, 0.18);
}

.assistant-panel {
  width: min(380px, calc(100vw - 32px));
  border: 1px solid rgba(219, 228, 240, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.assistant-head strong {
  display: block;
  font-size: 0.98rem;
  color: var(--ink);
}

.assistant-head p {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.assistant-messages {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.assistant-bubble {
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.assistant-bubble.assistant {
  background: #f4f8ff;
  border: 1px solid #d9e8ff;
  color: #1f2a37;
}

.assistant-bubble.user {
  background: #135cc8;
  color: #fff;
  margin-left: 28px;
}

.assistant-bubble-meta {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-suggestion {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.assistant-form {
  display: grid;
  gap: 8px;
}

.assistant-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 13px;
  color: var(--text);
  font: inherit;
}

.assistant-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-status {
  font-size: 0.76rem;
  color: var(--muted);
}

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

@media (max-width: 720px) {
  .app-assistant {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-items: stretch;
  }

  .assistant-fab {
    justify-content: center;
  }

  .assistant-panel {
    width: 100%;
  }
}

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

h1 {
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.25rem, 1.1vw + 1rem, 1.85rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

h3 {
  font-size: 1.02rem;
  letter-spacing: -0.025em;
}

h4 {
  font-size: 0.95rem;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 254, 0.98)),
    radial-gradient(circle at top left, rgba(19, 92, 200, 0.08), transparent 34%);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #135cc8, #0c3476);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(19, 92, 200, 0.24);
}

.brand p,
.muted,
.topbar-subtitle {
  color: var(--muted);
}

.brand p {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  transition: 160ms ease;
}

.nav-link.active,
.nav-link:hover {
  background: var(--primary-soft);
  border-color: #c8dbfb;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.main {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 520px);
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 228, 240, 0.88);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.topbar-actions {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}

.btn-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  display: inline-block;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.upload-control {
  flex: 1 1 230px;
  max-width: 290px;
  display: grid;
  gap: 6px;
}

.upload-control span,
.top-meta-card span,
.hero-card span,
.metric-card span,
.summary-card span,
.summary-chip span,
.eyebrow,
.field span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.upload-control input,
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: 140ms ease;
}

.upload-control input {
  height: 42px;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.upload-control input::file-selector-button {
  height: 28px;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.upload-control input:focus,
.field input:focus,
.field select:focus {
  border-color: #93b8f5;
  box-shadow: 0 0 0 4px rgba(19, 92, 200, 0.1);
}

.action-buttons {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
}

.action-buttons .btn {
  min-width: 136px;
}

.topbar-meta {
  flex: 1 1 100%;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.top-meta-card,
.hero-card,
.metric-card,
.summary-card,
.summary-chip {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

@keyframes fadeRiseIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid.is-loading .hero-card span,
.hero-grid.is-loading .hero-card strong,
.hero-grid.is-loading .hero-card p {
  color: transparent !important;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf3fb 0%, #f8fbff 22%, #e6edf8 45%, #edf3fb 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.35s linear infinite;
}

.hero-grid.is-loading .hero-card span {
  width: 42%;
  min-width: 96px;
  height: 10px;
}

.hero-grid.is-loading .hero-card strong {
  width: 34%;
  min-width: 72px;
  height: 34px;
  margin-top: 10px;
}

.hero-grid.is-loading .hero-card p {
  width: 56%;
  min-width: 110px;
  height: 11px;
  margin-top: 10px;
}

.toolbar-skeleton {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-skeleton-pill,
.table-skeleton-head span,
.table-skeleton-row span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf3fb 0%, #f8fbff 22%, #e6edf8 45%, #edf3fb 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.35s linear infinite;
}

.toolbar-skeleton-pill {
  height: 42px;
}

.toolbar-skeleton-search {
  grid-column: span 1;
}

.toolbar-skeleton-button {
  max-width: 132px;
}

.table-skeleton {
  display: grid;
  gap: 12px;
}

.table-skeleton-head,
.table-skeleton-row {
  display: grid;
  grid-template-columns: 1.45fr repeat(5, minmax(84px, 1fr));
  gap: 12px;
}

.table-skeleton-head span {
  height: 12px;
}

.table-skeleton-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.table-skeleton-row span {
  height: 16px;
}

.table-feedback {
  padding: 8px 0 0;
}

.table-feedback-card {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  justify-items: start;
}

.table-feedback-card strong {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.table-feedback-card p {
  color: var(--muted);
}

.table-row-fade {
  opacity: 0;
  animation: fadeRiseIn 260ms ease forwards;
}

.loading-marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 18px;
  margin: 2px 0 8px;
  color: #7c8798;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
  animation: fadeRiseIn 220ms ease;
}

.loading-marquee-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
  animation: loadingDotPulse 1.25s ease-in-out infinite;
}

.loading-ellipsis {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loading-ellipsis i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
  display: block;
  animation: loadingDotBounce 1.2s infinite ease-in-out;
}

.loading-ellipsis i:nth-child(2) {
  animation-delay: 0.18s;
}

.loading-ellipsis i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes loadingDotPulse {
  0%, 100% {
    transform: scale(0.88);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.14);
    opacity: 1;
  }
}

@keyframes loadingDotBounce {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

#leadToolbar:not(.hidden),
#leadTableWrap:not(.hidden),
#leadTableFooter:not(.hidden),
#leadTableState:not(.hidden) {
  animation: fadeRiseIn 240ms ease;
}

.top-meta-card {
  min-width: 132px;
  padding: 10px 12px;
}

.top-meta-card strong,
.hero-card strong,
.metric-card strong,
.summary-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.top-log {
  display: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted-strong);
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.top-log.visible {
  display: block;
}

.top-log[data-tone="success"] {
  border-color: #bde8cc;
  background: var(--success-soft);
  color: var(--success);
}

.top-log[data-tone="warn"] {
  border-color: #f0d3a3;
  background: var(--warning-soft);
  color: var(--warning);
}

.toast-host {
  position: fixed;
  z-index: 120;
  top: 18px;
  right: 22px;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 40px));
  pointer-events: none;
}

.app-toast {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 14px;
  border: 1px solid #d8e1ec;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  color: #111827;
  pointer-events: auto;
  animation: toastSlideIn 180ms ease-out;
}

.app-toast.is-hiding {
  animation: toastSlideOut 180ms ease-in forwards;
}

.app-toast strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.app-toast p {
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.app-toast button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.toast-success {
  border-color: #bde8cc;
}

.toast-success strong {
  color: #04724d;
}

.toast-warn {
  border-color: #f0d3a3;
}

.toast-warn strong {
  color: #92400e;
}

.toast-info strong {
  color: #0737a8;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.banner-warning {
  background: linear-gradient(180deg, var(--warning-soft), #fff9eb);
  border: 1px solid #f0d3a3;
  border-radius: var(--radius-md);
}

.hidden {
  display: none !important;
}

.status-chip,
.band-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 800;
}

.status-ok {
  background: var(--success-soft);
  color: var(--success);
}

.status-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-panel,
.log-box,
.transcript-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  white-space: pre-wrap;
}

.info-box {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f7faff, #eef4ff);
  border-radius: var(--radius-md);
  padding: 12px;
}

.info-box p {
  margin-top: 8px;
  color: var(--muted);
}

.hero-grid,
.batch-grid,
.metric-grid,
.summary-grid,
.filters,
.settings-layout,
.settings-hero,
.detail-layout {
  display: grid;
  gap: 14px;
}

.hero-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid-3 {
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
}

.dashboard-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
}

.dashboard-filter-label {
  display: grid;
  gap: 4px;
}

.dashboard-filter-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-filter-pill strong {
  color: var(--text);
}

.dashboard-frame {
  width: 100%;
  min-height: calc(100vh - 180px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.dashboard-filter-pill-active {
  background: linear-gradient(135deg, #edf4ff, #f6faff);
  border-color: #bfd7ff;
}

.intelligence-hero {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid #d9e4f3;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(19, 92, 200, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.98));
  box-shadow: var(--shadow-sm);
}

.intelligence-hero-copy {
  display: grid;
  gap: 8px;
}

.intelligence-hero-copy h3 {
  font-size: clamp(1.45rem, 1.4vw + 1rem, 2.2rem);
  letter-spacing: -0.05em;
}

.intelligence-hero-text {
  max-width: 920px;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.6;
}

.intelligence-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.intelligence-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.intelligence-kpi-card {
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}

.intelligence-kpi-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intelligence-kpi-card strong {
  font-size: 1.85rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

.intelligence-kpi-card p {
  color: var(--muted-strong);
  font-size: 0.8rem;
  line-height: 1.4;
}

.kpi-danger {
  background: linear-gradient(180deg, #fff5f3, #fffdfd);
  border-color: #f2cdc6;
}

.kpi-neutral {
  background: linear-gradient(180deg, #fbfcfe, #ffffff);
}

.kpi-success {
  background: linear-gradient(180deg, #f1fdf4, #ffffff);
  border-color: #c8eacd;
}

.kpi-warning {
  background: linear-gradient(180deg, #fff9ef, #ffffff);
  border-color: #efd6a5;
}

.kpi-mint {
  background: linear-gradient(180deg, #eefcf9, #ffffff);
  border-color: #ccefe7;
}

.kpi-blue {
  background: linear-gradient(180deg, #f1f6ff, #ffffff);
  border-color: #cfe0ff;
}

.intelligence-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.insight-callout {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.insight-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.insight-callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.insight-callout p {
  color: var(--muted-strong);
  font-size: 0.82rem;
  line-height: 1.5;
}

.tone-red {
  background: #fff7f6;
  border-color: #f2d0cb;
}

.tone-red .insight-icon {
  background: #ffe4de;
  color: #b42318;
}

.tone-orange {
  background: #fff8f0;
  border-color: #efd8b1;
}

.tone-orange .insight-icon {
  background: #ffebcf;
  color: #b76e00;
}

.tone-gold {
  background: #fffbea;
  border-color: #eadba0;
}

.tone-gold .insight-icon {
  background: #fff1bf;
  color: #9b6a00;
}

.tone-blue {
  background: #f4f8ff;
  border-color: #cdddfb;
}

.tone-blue .insight-icon {
  background: #deebff;
  color: #135cc8;
}

.dashboard-panel-stack {
  display: grid;
  gap: 14px;
}

.intelligence-panel {
  padding: 16px;
}

.anomaly-feed {
  display: grid;
  gap: 10px;
}

.anomaly-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.anomaly-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.anomaly-card p {
  color: var(--muted-strong);
  font-size: 0.82rem;
  line-height: 1.5;
}

.anomaly-blue {
  background: #eef5ff;
  border-color: #cfddfb;
}

.anomaly-green {
  background: #eefaf1;
  border-color: #cae8d0;
}

.anomaly-orange {
  background: #fff8ee;
  border-color: #eddab3;
}

.anomaly-red {
  background: #fff4f2;
  border-color: #f1cdc7;
}

.anomaly-purple {
  background: #f6f2ff;
  border-color: #ddd1ff;
}

.comparison-chart-tall .comparison-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.comparison-chart-tall .comparison-row:last-child {
  border-bottom: 0;
}

.compact-grid {
  align-items: start;
}

.compact-chart {
  margin-top: 10px;
}

.intelligence-mini-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.micro-metric-list {
  display: grid;
  gap: 12px;
}

.micro-metric-row {
  display: grid;
  gap: 8px;
}

.micro-metric-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.micro-metric-head strong {
  font-size: 0.86rem;
}

.micro-metric-head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.batch-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-span {
  grid-column: 1 / -1;
}

.compact-head {
  margin-top: 14px;
}

.hero-danger {
  background: linear-gradient(180deg, rgba(254, 236, 235, 0.96), rgba(255, 255, 255, 0.96));
}

.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.funnel-stack,
.distribution-list,
.comparison-chart,
.action-board {
  display: grid;
  gap: 12px;
}

.funnel-row,
.distribution-row,
.comparison-row {
  display: grid;
  gap: 8px;
}

.funnel-copy,
.distribution-copy,
.comparison-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funnel-copy strong,
.distribution-copy strong,
.comparison-head strong {
  font-size: 0.9rem;
}

.funnel-copy span,
.distribution-copy span,
.comparison-head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.funnel-bar-track,
.distribution-bar-track,
.comparison-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.funnel-bar-fill,
.distribution-bar-fill,
.comparison-fill {
  height: 100%;
  border-radius: inherit;
}

.funnel-bar-fill {
  background: linear-gradient(90deg, #135cc8, #4f8ff3);
}

.distribution-bar-fill {
  background: linear-gradient(90deg, #1f7ae0, #85b4ff);
}

.comparison-bars {
  display: grid;
  gap: 8px;
}

.comparison-bar {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.comparison-bar span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comparison-fill-volume {
  background: linear-gradient(90deg, #0b66d9, #5d9cff);
}

.comparison-fill-conversion {
  background: linear-gradient(90deg, #15803d, #4ade80);
}

.insight-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.insight-data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.insight-data-table th,
.insight-data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.insight-data-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-soft);
}

.insight-data-table tr:last-child td {
  border-bottom: 0;
}

.action-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
  min-height: 96px;
}

.action-card span {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.action-card strong {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.action-primary {
  background: #edf4ff;
  border-color: #cfe0ff;
}

.action-warning {
  background: #fff6e7;
  border-color: #f3d9a5;
}

.action-danger {
  background: #fff1f0;
  border-color: #f6c6c2;
}

.action-neutral {
  background: #f5f8fc;
}

.empty-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.filters {
  grid-template-columns: 1fr 1fr 1fr minmax(280px, 1.4fr);
  margin: 14px 0;
}

.field {
  display: grid;
  gap: 6px;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0a58ca);
  color: white;
}

.btn-dark {
  background: linear-gradient(135deg, #1f2937, #0f172a);
  color: white;
}

.btn-subtle {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #cfe0ff;
}

.btn-inline {
  padding: 0 12px;
  min-width: 62px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.page-indicator {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control span {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.page-size-control select {
  width: 72px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  outline: none;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1680px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #e7edf7;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafd;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

tbody tr:hover,
tbody tr.active {
  background: #eef5ff;
}

.detail-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.85fr);
}

.lead-detail-view {
  align-content: start;
}

.detail-page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.detail-page-head .btn {
  flex: 0 0 auto;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.detail-header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mini-stat {
  text-align: right;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.batch-progress {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  background: #eaf0f8;
  overflow: hidden;
  border: 1px solid var(--line);
}

.batch-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #5f95ed);
  transition: width 220ms ease;
}

.summary-card p {
  margin-top: 5px;
  color: var(--text);
}

.stack {
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 12px;
}

.card p {
  margin-top: 5px;
}

.transcript-box {
  min-height: 170px;
  max-height: 460px;
  overflow: auto;
}

.view {
  display: none;
  gap: 18px;
  min-width: 0;
}

.view.active {
  display: grid;
}

.settings-hero {
  grid-template-columns: 1.35fr 0.9fr;
}

.settings-summary {
  display: grid;
  gap: 10px;
}

.settings-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
}

.secret-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.model-grid {
  display: grid;
  gap: 10px;
}

.model-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  padding: 13px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.model-card:hover {
  border-color: #b9cdf4;
  transform: translateY(-1px);
}

.model-card.active {
  border-color: #7fb0ff;
  box-shadow: 0 0 0 3px rgba(19, 92, 200, 0.12);
}

.model-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.model-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.65rem;
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout,
  .settings-layout,
  .settings-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 16px;
  }

  .filters,
  .topbar-meta {
    grid-template-columns: 1fr;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .topbar-meta,
  .action-buttons {
    width: 100%;
  }

  .upload-control {
    max-width: none;
  }

  .action-buttons .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 680px) {
  .hero-grid,
  .batch-grid,
  .metric-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel {
    padding: 14px;
  }

  .detail-header,
  .detail-page-head,
  .banner,
  .button-row {
    flex-direction: column;
  }

  .secret-wrap {
    grid-template-columns: 1fr;
  }
}

/* Compact density: roughly 10% smaller without using browser/page zoom. */
html,
body {
  font-size: 12.6px;
}

.app-shell {
  grid-template-columns: 173px minmax(0, 1fr);
}

.rail {
  padding: 22px 11px;
  gap: 23px;
}

.brand-compact {
  padding: 0 7px 16px;
}

.nav-link {
  min-height: 31px;
  padding: 8px 11px;
}

.nav-icon {
  width: 14px;
  height: 14px;
}

.main {
  padding: 22px;
  gap: 11px;
}

.leads-topbar h2 {
  font-size: 1.24rem;
}

.topbar-subtitle {
  font-size: 0.66rem;
}

.lead-page-actions {
  gap: 7px;
}

.lead-page-actions .btn {
  min-height: 31px;
  padding: 0 13px;
}

.hero-grid {
  grid-template-columns: repeat(6, minmax(124px, 1fr));
  gap: 7px;
}

.hero-card {
  min-height: 67px;
  padding: 10px 11px;
}

.hero-card strong {
  font-size: 1.1rem;
}

.hero-card p {
  font-size: 0.56rem;
}

.progress-panel {
  padding: 18px;
}

.progress-segments {
  gap: 7px;
}

.progress-segment {
  min-height: 50px;
  padding: 8px 11px;
}

.lead-toolbar {
  gap: 11px;
  margin: 11px 0 16px;
}

.search-field input,
.situation-filter select {
  height: 32px;
}

th,
td {
  padding: 10px 16px;
}

.table-footer {
  padding-top: 11px;
}

/* Keep the left navigation as a full-height SaaS rail. */
.app-shell {
  min-height: 100vh;
  align-items: stretch;
}

.rail {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@media (max-width: 980px) {
  .rail {
    position: static;
    min-height: auto;
    height: auto;
  }
}

/* SalesPilot leads workspace */
body {
  background: #f6f8fb;
}

.app-shell {
  grid-template-columns: 192px minmax(0, 1fr);
}

.rail {
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
  background: #ffffff;
  border-right: 1px solid #d9e0ea;
  box-shadow: none;
}

.brand-compact {
  padding: 0 8px 18px;
  border-bottom: 1px solid #e4e9f1;
}

.brand-compact h1 {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand-compact p {
  margin-top: 4px;
  color: #7a8798;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  flex: 0 0 auto;
  gap: 4px;
  padding: 10px 0 12px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  color: #8a96a8;
  padding: 7px 9px 4px;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-section-chevron {
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.nav-section.is-collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-section-items {
  display: grid;
  gap: 4px;
}

.nav-section.is-collapsed .nav-section-items {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-radius: 0;
  padding: 9px 12px;
  color: #243044;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #66758a;
  font-size: 0.62rem;
  font-weight: 900;
}

.nav-link.active,
.nav-link:hover {
  background: #0737a8;
  border-color: #0737a8;
  color: #ffffff;
  box-shadow: none;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  color: #ffffff;
}

.nav-disabled {
  opacity: 0.88;
}

.rail-footer {
  flex: 0 0 auto;
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #e4e9f1;
}

.signed-card {
  padding: 12px;
  background: #eef2f7;
  color: #1f2937;
}

.signed-card span {
  display: block;
  color: #111827;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signed-card strong {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
}

.signed-card p {
  margin-top: 2px;
  color: #667085;
  font-size: 0.68rem;
}

.signed-card small {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 6px;
  background: #0737a8;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
}

.signout-btn {
  border: 0;
  background: transparent;
  color: #d11f3a;
  text-align: left;
  padding: 0 12px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.main {
  padding: 24px 24px;
  gap: 12px;
  background: #f6f8fb;
}

.leads-topbar,
#leadsView,
#scLeadTableView,
#leadsView .lead-table-panel,
#scLeadTableView .lead-table-panel,
#leadsView .hero-card,
#scLeadTableView .hero-card,
#leadsView .batch-status-panel,
#leadsView .lead-toolbar,
#scLeadTableView .lead-toolbar,
#leadsView .table-wrap,
#scLeadTableView .table-wrap,
#leadsView .table-footer,
#leadsView .table-feedback-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leads-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.leads-topbar h2 {
  font-size: 0.95rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #1a1a1a;
}

.topbar-title {
  gap: 4px;
}

.topbar-subtitle {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #888;
}

.model-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
  color: #667085;
  font-size: 0.68rem;
}

.model-strip span {
  color: #7a8798;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-strip strong {
  color: #111827;
  font-weight: 900;
}

.lead-page-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: auto;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.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;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.lead-page-actions .btn {
  border-radius: 16px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
}

.export-menu {
  position: relative;
  display: inline-flex;
}

.export-menu-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  padding: 6px;
  border: 1px solid #e8e8e8;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.export-menu-list button {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #263244;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
}

.export-menu-list button:hover {
  background: #eef4ff;
  color: #0737a8;
}

.detail-page-actions .btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
}

.hero-grid {
  grid-template-columns: repeat(6, minmax(138px, 1fr));
  gap: 10px;
  margin-top: 2px;
}

#leadsView .hero-grid {
  grid-template-columns: repeat(6, minmax(138px, 1fr));
}

.hero-card {
  min-height: 78px;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  box-shadow: none;
}

.hero-card strong {
  margin-top: 4px;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.08;
  color: #1a1a1a;
}

.hero-card p {
  margin-top: 4px;
  color: #888;
  font-size: 0.62rem;
  line-height: 1.35;
}

.hero-card span {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: #888;
  font-weight: 600;
}

.hero-success {
  border-color: #bfe9d0;
  background: linear-gradient(180deg, #f6fff8, #ffffff);
}

.hero-blue {
  border-color: #cfe0ff;
  background: linear-gradient(180deg, #f5f9ff, #ffffff);
}

.hero-warning {
  border-color: #f6dfab;
  background: linear-gradient(180deg, #fffaf2, #ffffff);
}

.hero-neutral {
  border-color: #e8e8e8;
  background: linear-gradient(180deg, #ffffff, #fcfdff);
}

.progress-panel {
  border-radius: 0;
  background: #ffffff;
  padding: 20px;
}

.analysis-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.analysis-progress-head h3 {
  font-size: 0.86rem;
}

.analysis-progress-head strong {
  color: #0737a8;
  font-size: 1.15rem;
}

.batch-progress {
  height: 8px;
  border-radius: 999px;
  background: #e7edf5;
}

.batch-progress-bar {
  background: #0737a8;
}

.progress-segments {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.progress-segment {
  min-height: 56px;
  padding: 9px 12px;
  text-align: center;
}

.progress-segment span {
  display: block;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-segment strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.progress-analyzed {
  background: #d8f8e6;
  color: #04724d;
}

.progress-pending {
  background: #fff3c4;
  color: #944d00;
}

.progress-no-transcript {
  background: #eef2f7;
  color: #64748b;
}

.batch-status-panel {
  padding: 14px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
}

.batch-status-panel .analysis-progress-head {
  align-items: center;
}

.batch-status-panel .batch-progress {
  height: 6px;
  margin-top: 10px;
}

.batch-status-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.batch-chip {
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
  background: #ffffff;
  border-radius: 10px;
}

.batch-chip span {
  display: block;
  color: #667085;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.batch-chip strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #111827;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-status-panel .compact-status {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: normal;
}

.lead-table-panel {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px 16px 16px;
}

.lead-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px;
  gap: 12px;
  margin: 10px 0 14px;
}

.search-field,
.situation-filter {
  display: block;
}

.search-field {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
}

.search-field input,
.situation-filter select {
  width: 100%;
  height: 36px;
  border: 1px solid #e8e8e8;
  background: #ffffff;
  color: #1f2937;
  border-radius: 10px;
  outline: none;
  font-size: 0.72rem;
}

.search-field input {
  padding: 0 12px 0 64px;
}

.situation-filter select {
  padding: 0 12px;
}

.table-wrap {
  border-radius: 10px;
  border-color: #e8e8e8;
  background: #ffffff;
}

table {
  min-width: 1120px;
}

thead th {
  background: #fafbfc;
  color: #888;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

th,
td {
  padding: 11px 14px;
  font-size: 0.72rem;
}

tbody tr:hover,
tbody tr.active {
  background: #f8fbff;
}

.score-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 9px;
  border: 1px solid transparent;
  font-size: 0.58rem;
  font-weight: 600;
  border-radius: 999px;
}

.score-good {
  color: #04724d;
  background: #daf7e5;
  border-color: #17a56b;
}

.score-mid {
  color: #a15300;
  background: #fff0cc;
  border-color: #f59e0b;
}

.score-low {
  color: #b42318;
  background: #ffe1e3;
  border-color: #f04450;
}

.score-empty {
  color: #64748b;
  background: #edf2f7;
  border-color: #cbd5e1;
}

.tag-success {
  color: #04724d;
  background: #dff7e8;
  border-color: #17a56b;
}

.tag-neutral {
  color: #334155;
  background: #eef2f7;
  border-color: #d6dee9;
}

.tag-warning {
  color: #92400e;
  background: #fff4d6;
  border-color: #f59e0b;
}

.tag-info {
  color: #174bba;
  background: #e4efff;
  border-color: #8db7ff;
}

.next-cta {
  max-width: 260px;
  color: #475569;
}

.row-action {
  border: 0;
  background: transparent;
  color: #0737a8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.table-footer {
  justify-content: flex-end;
  padding-top: 14px;
}

#leadsView .section-head h3 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

#scLeadTableView .section-head h3 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

#leadsView .section-head .eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #9aa3af;
}

#scLeadTableView .section-head .eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #9aa3af;
}

#leadsView #rowCount,
#leadsView #pageSummary,
#leadsView .page-indicator {
  font-size: 0.72rem;
  color: #6b7280;
}

#scLeadTableView .sc-row-count {
  font-size: 0.72rem;
  color: #6b7280;
}

.table-footer #pageSummary {
  margin-right: auto;
}

@media (max-width: 1180px) {
  #leadsView .hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .leads-topbar {
    flex-direction: column;
  }

  .lead-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #leadsView .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-toolbar,
  .progress-segments {
    grid-template-columns: 1fr;
  }
}

/* Final desktop rail behavior: fixed full-height sidebar with main content offset. */
@media (min-width: 981px) {
  .app-shell {
    display: block;
    min-height: 100vh;
    padding-left: 162px;
  }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 162px;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .rail::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .rail-footer {
    margin-top: auto;
  }

  .main {
    min-height: 100vh;
    padding-left: 14px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: grid;
    padding-left: 0;
  }

  .rail {
    position: static;
    width: auto;
    height: auto;
    min-height: auto;
    overflow: visible;
  }
}

/* Compact the fixed left navigation stack. */
@media (min-width: 981px) {
  .rail {
    padding: 18px 10px 14px;
    gap: 14px;
  }

  .brand-compact {
    padding: 0 8px 12px;
  }

  .brand-compact h1 {
    font-size: 0.88rem;
  }

  .brand-compact p {
    margin-top: 2px;
    font-size: 0.52rem;
  }

  .nav {
    gap: 2px;
  }

  .nav-link {
    min-height: 27px;
    padding: 6px 10px;
    gap: 8px;
    font-size: 0.7rem;
  }

  .nav-icon {
    width: 13px;
    height: 13px;
    font-size: 0.54rem;
  }

  .rail-footer {
    gap: 10px;
  }

  .signed-card {
    padding: 10px;
  }

  .signed-card span {
    font-size: 0.54rem;
  }

  .signed-card strong {
    margin-top: 4px;
    font-size: 0.72rem;
  }

  .signed-card p {
    font-size: 0.62rem;
  }

  .signed-card small {
    margin-top: 6px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }

  .signout-btn {
    padding: 0 10px;
    font-size: 0.66rem;
  }
}

/* Final typography polish: softer SaaS weights, better data-table readability. */
:root {
  --font-ui: "Plus Jakarta Sans", "Aptos", "Segoe UI", sans-serif;
  --font-data: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
}

html,
body {
  font-family: var(--font-ui);
  font-feature-settings: "kern", "liga", "cv05";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  color: #111827;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-compact h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-compact p,
.eyebrow,
.hero-card span,
.metric-card span,
.summary-card span,
.summary-chip span,
.field span,
thead th,
.progress-segment span,
.signed-card span,
.page-size-control span {
  font-weight: 700;
  letter-spacing: 0.045em;
}

.nav-link {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-icon {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #66758a;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  color: #ffffff;
}

.topbar-subtitle,
.muted,
.hero-card p,
.summary-card p,
.signed-card p {
  color: #667085;
  font-weight: 400;
}

.hero-card strong,
.analysis-progress-head strong,
.progress-segment strong {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.btn,
.score-badge,
.tag,
.row-action {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.005em;
}

table {
  font-family: var(--font-data);
}

th,
td {
  font-family: var(--font-data);
  font-weight: 400;
}

thead th {
  font-family: var(--font-ui);
  color: #5b6678;
}

tbody td strong {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.02em;
}

input,
select,
button {
  font-family: var(--font-ui);
}

/* Compact SaaS filter bar: primary filters inline, secondary filters expandable. */
.lead-toolbar {
  grid-template-columns: minmax(220px, 1.4fr) 138px 138px 156px auto auto;
  gap: 7px;
  margin: 8px 0 8px;
  align-items: center;
}

.toolbar-filter,
.filter-field {
  display: block;
}

.toolbar-filter select,
.filter-field select,
.filter-field input {
  width: 100%;
  height: 30px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #ffffff;
  color: #263244;
  padding: 0 9px;
  outline: none;
  font-size: 0.68rem;
  font-weight: 600;
}

.search-field input {
  height: 30px;
  border-radius: 8px;
  font-size: 0.68rem;
}

.search-icon {
  font-size: 0.62rem;
}

.filter-button {
  height: 30px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #eff5ff;
  color: #0737a8;
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.filter-button-muted {
  border-color: #d9e0ea;
  background: #ffffff;
  color: #667085;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 7px;
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid #e4e9f1;
  border-radius: 10px;
  background: #ffffff;
}

.advanced-filters.hidden {
  display: none;
}

.filter-field {
  display: grid;
  gap: 4px;
}

.filter-field span {
  color: #667085;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.multi-filter-source {
  display: none !important;
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select-button {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #ffffff;
  color: #263244;
  padding: 0 9px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: left;
}

.multi-select.has-value .multi-select-button {
  border-color: #b9cdf4;
  background: #f6f9ff;
  color: #0737a8;
}

.multi-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.multi-select.open .multi-select-caret {
  transform: rotate(225deg) translateY(-1px);
}

.multi-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 210px);
  max-height: 240px;
  overflow: auto;
  display: none;
  padding: 6px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.multi-select.open .multi-select-menu {
  display: grid;
  gap: 2px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #263244;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 500;
}

.multi-select-option:hover {
  background: #f3f7ff;
}

.multi-select-all {
  margin-bottom: 4px;
  border-bottom: 1px solid #edf1f7;
  border-radius: 7px 7px 0 0;
  color: #0737a8;
  font-weight: 700;
}

.multi-select-option input {
  width: 13px;
  height: 13px;
  accent-color: #0737a8;
}

.multi-select-empty {
  padding: 8px;
  color: #667085;
  font-size: 0.68rem;
}

@media (max-width: 1320px) {
  .lead-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 0.5fr));
  }

  .filter-button {
    width: 100%;
  }

  .advanced-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .lead-toolbar,
  .advanced-filters {
    grid-template-columns: 1fr;
  }
}

.sort-header {
  width: 100%;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  font: inherit;
}

.sort-header:hover {
  color: #0737a8;
}

.sort-icon {
  position: relative;
  width: 9px;
  height: 13px;
  flex: 0 0 9px;
  opacity: 0.45;
}

.sort-icon::before,
.sort-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}

.sort-icon::before {
  top: 1px;
  border-bottom: 4px solid currentColor;
}

.sort-icon::after {
  bottom: 1px;
  border-top: 4px solid currentColor;
}

.sort-header.active {
  color: #0737a8;
}

.sort-header.active .sort-icon {
  opacity: 1;
}

.sort-header.active[data-direction="asc"] .sort-icon::after,
.sort-header.active[data-direction="desc"] .sort-icon::before {
  opacity: 0.2;
}

/* Lead table polish: no horizontal page scrollbar, cleaner SaaS pagination. */
.lead-table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: hidden;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

#leadTable {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

#leadTable th,
#leadTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 16%;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2) {
  width: 13%;
}

#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 9%;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 12%;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 14%;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 20%;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 10%;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 6%;
  text-align: right;
}

.next-cta {
  max-width: none;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 32px;
  margin-top: 0;
  padding: 2px 2px 0;
}

.pagination-summary {
  color: #667085;
  font-size: 0.68rem;
  font-weight: 500;
  margin-right: 8px;
  white-space: nowrap;
}

.table-footer #pageSummary {
  margin-right: 8px;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-left: 0;
}

.pager-btn {
  height: 28px;
  min-width: 64px;
  border: 1px solid #d8e1ef;
  border-radius: 10px;
  background: #ffffff;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pager-btn:hover:not(:disabled) {
  background: #f6f9ff;
  border-color: #b9cdf4;
  color: #0737a8;
}

.pager-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.pager-btn-primary {
  background: #eff5ff;
  border-color: #cfe0ff;
  color: #0737a8;
}

.page-indicator {
  min-width: 70px;
  color: #475467;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
}

.page-indicator strong {
  color: #111827;
  font-weight: 800;
}

.page-size-control {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 10px;
  border: 1px solid #d8e1ef;
  border-radius: 10px;
  background: #ffffff;
}

.page-size-control span {
  color: #667085;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.page-size-control select {
  width: 54px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 0.78rem;
  font-weight: 800;
  outline: none;
}

@media (max-width: 1180px) {
  .table-wrap {
    overflow-x: auto;
  }

  #leadTable {
    min-width: 980px !important;
  }
}

/* Full audit schema table: compact horizontal data grid with sticky edges. */
.table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #c7d3e2 #eef3f9;
}

.table-wrap::-webkit-scrollbar {
  height: 5px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef3f9;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #c7d3e2;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#leadTable {
  min-width: 2680px !important;
  table-layout: fixed;
}

#leadTable th,
#leadTable td {
  padding: 9px 12px;
  text-align: left;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2) {
  width: 100px;
}

#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 95px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 140px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 160px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 130px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7),
#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 130px;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9) {
  width: 150px;
}

#leadTable th:nth-child(10),
#leadTable td:nth-child(10) {
  width: 120px;
}

#leadTable th:nth-child(11),
#leadTable td:nth-child(11) {
  width: 115px;
}

#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 90px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 110px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 130px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 110px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16),
#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 170px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18) {
  width: 130px;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 320px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20) {
  width: 100px;
}

#leadTable thead th:nth-child(1) {
  z-index: 4;
  background: #f3f6fa;
}

#leadTable tbody td:nth-child(1) {
  background: #ffffff;
}

#leadTable tbody tr:hover td:nth-child(1),
#leadTable tbody tr.active td:nth-child(1) {
  background: #f2f6ff;
}

/* Full lead schema widths after adding FE Date and TAT columns. */
#leadTable {
  min-width: 2860px !important;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2) {
  width: 100px;
}

#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 100px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 130px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 95px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 140px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 160px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 130px;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9),
#leadTable th:nth-child(10),
#leadTable td:nth-child(10) {
  width: 130px;
}

#leadTable th:nth-child(11),
#leadTable td:nth-child(11) {
  width: 150px;
}

#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 120px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 115px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 90px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 110px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 130px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 110px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18),
#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 170px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20) {
  width: 130px;
}

#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 320px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 100px;
}

#leadTable thead th:nth-child(1) {
  z-index: 4;
  background: #f3f6fa;
}

#leadTable tbody td:nth-child(1) {
  background: #ffffff;
}

#leadTable tbody tr:hover td:nth-child(1),
#leadTable tbody tr.active td:nth-child(1) {
  background: #f2f6ff;
}

/* Match Settings and Lead Detail to the Leads page SaaS template. */
#settingsView,
#trainAiView,
#emailConfigView,
#leadDetailView {
  gap: 10px;
  align-content: start;
}

.settings-page-head,
.detail-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-page-head h2,
.detail-page-head h2 {
  margin-top: 2px;
  font-size: 1.24rem;
  line-height: 1.1;
}

.settings-page-head .muted,
.detail-page-head .muted {
  margin-top: 3px;
  font-size: 0.68rem;
}

.detail-page-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: auto;
  justify-content: flex-end;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: -2px;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#settingsView .summary-chip,
#trainAiView .summary-chip,
#emailConfigView .summary-chip,
#leadDetailView .metric-card,
#leadDetailView .summary-card {
  border-radius: 10px;
  border-color: #d9e0ea;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

#settingsView .summary-chip,
#trainAiView .summary-chip,
#emailConfigView .summary-chip {
  min-height: 62px;
  padding: 11px 12px;
}

#settingsView .summary-chip strong,
#trainAiView .summary-chip strong,
#emailConfigView .summary-chip strong {
  margin-top: 4px;
  font-size: 0.92rem;
}

#settingsView .panel,
#trainAiView .panel,
#emailConfigView .panel,
#leadDetailView .panel {
  border-radius: 10px;
  border-color: #d9e0ea;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 14px;
}

.settings-layout {
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

#settingsView .section-head,
#trainAiView .section-head,
#emailConfigView .section-head,
#leadDetailView .section-head,
.detail-header {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e9f1;
}

#settingsView .section-head h3,
#trainAiView .section-head h3,
#emailConfigView .section-head h3,
#changePasswordView .section-head h3,
#leadDetailView .section-head h3,
.detail-header h3 {
  font-size: 0.86rem;
}

#settingsView .field,
#emailConfigView .field,
#changePasswordView .field {
  margin-top: 12px;
  gap: 5px;
}

#settingsView .field input,
#settingsView .field select,
#emailConfigView .field input,
#emailConfigView .field select,
#changePasswordView .field input {
  height: 34px;
  border-radius: 9px;
}

.secret-wrap {
  gap: 8px;
}

#settingsView .info-box,
#settingsView .status-panel,
#trainAiView .info-box,
#trainAiView .status-panel,
#emailConfigView .info-box,
#emailConfigView .status-panel,
#changePasswordView .info-box,
#changePasswordView .status-panel {
  border-radius: 9px;
  padding: 10px;
}

#settingsView .compact-status,
#trainAiView .compact-status,
#emailConfigView .compact-status,
#changePasswordView .compact-status {
  margin-top: 10px;
  min-height: 38px;
  font-size: 0.68rem;
  line-height: 1.35;
}

#settingsView .button-row,
#trainAiView .button-row,
#emailConfigView .button-row,
#changePasswordView .button-row {
  margin-top: 10px;
}

#settingsView .button-row .btn,
#trainAiView .button-row .btn,
#emailConfigView .button-row .btn,
#changePasswordView .button-row .btn {
  min-height: 32px;
  padding: 0 13px;
}

#changePasswordView {
  max-width: 1120px;
}

.password-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

#changePasswordView .password-panel {
  padding: 18px 20px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.password-head {
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 12px;
}

.password-lock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  min-height: 28px;
  padding: 0 11px;
  text-transform: uppercase;
}

.password-force-banner {
  margin-top: 14px;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.password-force-banner strong {
  font-size: 0.82rem;
  color: #0f172a;
}

#changePasswordView .password-force-banner p {
  font-size: 0.76rem;
  color: #53627a;
}

.password-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  margin-top: 14px;
  max-width: 420px;
}

#changePasswordView .field span {
  font-size: 0.68rem;
  color: #718096;
  letter-spacing: 0.055em;
}

#changePasswordView .field input {
  min-height: 40px;
  font-size: 0.86rem;
  font-weight: 650;
  background: #fff;
}

#changePasswordView .button-row {
  justify-content: flex-start;
}

#changePasswordView #changePasswordBtn {
  min-width: 170px;
  min-height: 38px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.password-side-card {
  border: 1px solid #dbe7f7;
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 12%, rgba(34, 197, 94, 0.16), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 18px;
}

.password-side-card h4 {
  color: #0f172a;
  font-size: 0.98rem;
  line-height: 1.25;
  margin: 4px 0 14px;
}

.password-rule-list {
  display: grid;
  gap: 9px;
}

.password-rule-list span {
  display: block;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #53627a;
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 9px 10px;
}

#changePasswordView .status-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

#changePasswordView .status-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

@media (max-width: 980px) {
  .password-layout {
    grid-template-columns: 1fr;
  }

  .password-side-card {
    max-width: none;
  }
}

.model-grid {
  gap: 8px;
}

.model-card {
  border-radius: 10px;
  padding: 11px;
}

.model-card h4 {
  font-size: 0.82rem;
}

.model-card p {
  font-size: 0.68rem;
}

#settingsView .settings-status-grid,
#trainAiView .settings-status-grid,
#emailConfigView .settings-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#settingsView .summary-chip,
#trainAiView .summary-chip,
#emailConfigView .summary-chip {
  min-width: 0;
  overflow: hidden;
}

#settingsView .summary-chip strong,
#trainAiView .summary-chip strong,
#emailConfigView .summary-chip strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  gap: 10px;
}

.field-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.email-settings-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.email-report-panel {
  grid-column: 1 / -1;
}

#emailConfigView #emailSecurityInput,
#emailConfigView #emailSmtpPortInput,
#emailConfigView #emailSmtpHostInput,
#emailConfigView #emailUsernameInput,
#emailConfigView #emailPasswordInput,
#emailConfigView #emailSenderNameInput,
#emailConfigView #emailSenderEmailInput,
#emailConfigView #emailTestRecipientInput,
#emailConfigView #heatmapEmailToInput,
#emailConfigView #heatmapEmailCcInput,
#emailConfigView #heatmapEmailSubjectInput,
#emailConfigView #heatmapEmailSenderNameInput {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #1f2937;
  line-height: 1.2;
  height: 40px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background-color: #ffffff;
  box-shadow: none;
}

#emailConfigView #emailSecurityInput {
  padding: 0 40px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #5b6678 50%),
    linear-gradient(135deg, #5b6678 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-transform: none;
}

#emailConfigView #emailSecurityInput:focus,
#emailConfigView #emailSmtpPortInput:focus,
#emailConfigView #emailUsernameInput:focus,
#emailConfigView #emailPasswordInput:focus,
#emailConfigView #emailSenderNameInput:focus,
#emailConfigView #emailSenderEmailInput:focus,
#emailConfigView #emailTestRecipientInput:focus,
#emailConfigView #heatmapEmailToInput:focus,
#emailConfigView #heatmapEmailCcInput:focus,
#emailConfigView #heatmapEmailSubjectInput:focus,
#emailConfigView #heatmapEmailSenderNameInput:focus {
  border-color: #9fc2ff;
  box-shadow: 0 0 0 3px rgba(19, 92, 200, 0.1);
  outline: none;
}

#emailConfigView #emailSecurityInput option {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

#emailConfigView .field-grid.two-up {
  align-items: end;
}

#emailConfigView #emailSmtpHostInput[readonly] {
  background: #f6f8fb;
  color: #5b6678;
  cursor: default;
}

#settingsMaskedKey {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.01em;
}

.train-ai-panel {
  display: grid;
  gap: 12px;
}

.train-ai-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #bfd4ff;
  background: #edf4ff;
  color: #0d47a1;
  font-size: 0.68rem;
  font-weight: 800;
}

.train-ai-state-pill.is-running {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.train-ai-state-pill.is-complete {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #047857;
}

.train-ai-state-pill.is-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.train-ai-progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.train-ai-progress span {
  display: block;
  width: var(--train-progress, 8%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #135cc8, #11b981);
  transition: width 260ms ease;
}

.train-ai-progress.is-running span {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 34%) 0 0 / 34px 100%,
    linear-gradient(90deg, #f59e0b, #135cc8);
  animation: train-progress-glide 900ms linear infinite;
}

.train-ai-progress.is-complete span {
  background: linear-gradient(90deg, #059669, #12b76a);
}

.train-model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.train-model-row > div,
.train-model-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.train-model-row span {
  color: #7a8798;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.train-model-row strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.train-ai-flow-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.train-step-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 178px;
  padding: 12px 10px;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.train-step-card > div:last-child {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 0;
  flex-direction: column;
}

.train-step-card.is-active {
  border-color: #9fc2ff;
  box-shadow: 0 8px 24px rgba(19, 92, 200, 0.1);
  transform: translateY(-1px);
}

.train-step-card.is-done {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff, #f6fffa);
}

.train-step-card.is-locked {
  background: #f8fafc;
  opacity: 0.72;
}

.train-step-card.is-running {
  border-color: #fed7aa;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}

.train-step-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #edf4ff;
  color: #0d47a1;
  font-size: 0.78rem;
  font-weight: 900;
}

.train-step-card.is-done .train-step-index {
  background: #dcfce7;
  color: #047857;
}

.train-step-card.is-running .train-step-index {
  background: #fff7ed;
  color: #c2410c;
  animation: train-step-pulse 1.4s ease-in-out infinite;
}

.train-step-card h4 {
  margin: 2px 0 6px;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--ink);
}

.train-step-card p:not(.eyebrow) {
  margin: 0 0 10px;
  min-height: 54px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.42;
}

.train-step-card .btn {
  width: calc(100% + 34px);
  min-width: 0;
  min-height: 36px;
  margin-top: auto;
  margin-left: -34px;
  padding: 6px 8px;
  border-radius: 11px;
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: normal;
}

.train-step-card .btn:disabled {
  border: 1px solid #d8e1ee;
  background: #eaf1fb !important;
  color: #7890b5 !important;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.train-step-card .compact-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: auto;
  margin-left: -34px;
  width: calc(100% + 34px);
}

.train-step-card .compact-buttons .btn {
  width: 100%;
  margin-left: 0;
}

.train-ai-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.train-ai-downloads {
  justify-content: flex-end;
  margin-top: 0;
}

@keyframes train-progress-glide {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 34px 0, 0 0;
  }
}

@keyframes train-step-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.22);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
  }
}

.golden-dataset-panel .status-panel strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.golden-dataset-panel .status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.golden-subtitle {
  margin: 16px 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.golden-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.golden-metric-grid span {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 9px 10px;
  font-size: 0.76rem;
  color: var(--ink);
  line-height: 1.35;
}

.golden-timeline {
  margin-top: 4px;
}

.training-timeline-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.training-timeline-head .golden-subtitle {
  margin: 0 0 3px;
}

.training-timeline-head h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.training-version-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  width: min(760px, 70%);
}

.status-warn-text {
  color: #b45309 !important;
  font-weight: 800;
}

.training-version-grid span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-version-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.golden-timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.golden-timeline-item:last-child {
  border-bottom: 0;
}

.golden-timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 5px #eaf2ff;
}

.golden-timeline-item strong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink);
}

.golden-timeline-item strong em {
  max-width: min(720px, 100%);
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf4ff;
  color: #0d47a1;
  font-size: 0.62rem;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.golden-timeline-item p {
  margin: 3px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .train-ai-flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .train-ai-status-grid {
    grid-template-columns: 1fr;
  }

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

  .training-timeline-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .training-version-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .golden-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .train-ai-flow-grid {
    grid-template-columns: 1fr;
  }

  .golden-metric-grid {
    grid-template-columns: 1fr;
  }
}

.btn-dirty {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.model-badge {
  padding: 4px 7px;
  font-size: 0.58rem;
}

.detail-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 10px;
}

.detail-header {
  margin-bottom: 12px;
}

.band-pill {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #cfe0ff;
  background: #eff5ff;
  color: #0737a8;
  border-radius: 999px;
  font-size: 0.72rem;
}

.mini-stat span {
  font-size: 0.56rem;
  letter-spacing: 0.045em;
}

.mini-stat strong {
  font-size: 0.76rem;
}

#leadDetailView .metric-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 0;
}

#leadDetailView .summary-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

#leadDetailView .metric-card,
#leadDetailView .summary-card {
  min-height: 62px;
  padding: 10px 11px;
}

#leadDetailView .metric-card strong {
  font-size: 0.86rem;
}

#leadDetailView .summary-card p {
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.35;
}

.stack {
  gap: 8px;
}

.card {
  border-radius: 9px;
  padding: 10px;
  background: #f8fafc;
}

.card strong {
  font-size: 0.76rem;
}

.card p {
  margin-top: 4px;
  font-size: 0.68rem;
  line-height: 1.35;
}

.transcript-box {
  min-height: 120px;
  max-height: 320px;
  border-radius: 9px;
  font-size: 0.7rem;
}

#leadDetailView .transcript-box {
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.76rem;
}

@media (max-width: 1320px) {
  #leadDetailView .metric-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  #leadDetailView .summary-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }
}

@media (max-width: 1120px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  #leadDetailView .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  #leadDetailView .summary-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 980px) {
  .settings-page-head,
  .detail-page-head,
  .detail-page-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-status-grid,
  .settings-layout,
  .detail-layout,
  #leadDetailView .metric-grid,
  #leadDetailView .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Lead table schema after adding Audit Status and Audit Model. */
#leadTable {
  min-width: 3170px !important;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2),
#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 100px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 130px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 130px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 120px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 95px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 140px;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9) {
  width: 160px;
}

#leadTable th:nth-child(10),
#leadTable td:nth-child(10),
#leadTable th:nth-child(11),
#leadTable td:nth-child(11),
#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 130px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 150px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 120px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 115px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 90px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 110px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18) {
  width: 130px;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 110px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20),
#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 170px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 130px;
}

#leadTable th:nth-child(23),
#leadTable td:nth-child(23) {
  width: 320px;
}

#leadTable th:nth-child(24),
#leadTable td:nth-child(24) {
  width: 100px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  text-align: left !important;
}

/* Lead table schema after adding Top Positive Driver and Miss Owner Why. */
#leadTable {
  min-width: 4050px !important;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2),
#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 100px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4),
#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 130px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6),
#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 120px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 140px;
  text-align: left !important;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9) {
  width: 160px;
}

#leadTable th:nth-child(10),
#leadTable td:nth-child(10),
#leadTable th:nth-child(11),
#leadTable td:nth-child(11),
#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 130px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 150px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 120px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 115px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 90px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17),
#leadTable th:nth-child(18),
#leadTable td:nth-child(18),
#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 120px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20),
#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 170px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 320px;
}

#leadTable th:nth-child(23),
#leadTable td:nth-child(23) {
  width: 260px;
}

#leadTable th:nth-child(24),
#leadTable td:nth-child(24) {
  width: 420px;
}

#leadTable th:nth-child(25),
#leadTable td:nth-child(25) {
  width: 340px;
}

#leadTable th:nth-child(26),
#leadTable td:nth-child(26) {
  width: 100px;
}

.followup-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-action-btn,
.icon-button {
  border: 1px solid #cfe0ff;
  background: #eff5ff;
  color: #0737a8;
  cursor: pointer;
  font-weight: 900;
}

.mini-action-btn {
  min-height: 24px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 0.62rem;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
}

.followup-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.followup-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.followup-history-item {
  padding: 10px 11px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background: #f8fafc;
}

.followup-history-item p {
  margin-top: 4px;
  color: #475569;
  font-size: 0.68rem;
  line-height: 1.4;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

#followUpModal .modal-card {
  width: min(560px, 90vw) !important;
  max-width: 560px !important;
  max-height: 84vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4e9f1;
}

.upload-review-card {
  width: min(780px, 94vw);
}

.scorecard-issue-card {
  width: min(820px, 94vw);
}

.upload-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.upload-review-stat {
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.upload-review-stat span {
  display: block;
  color: #667085;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.upload-review-stat strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 1.15rem;
  font-weight: 900;
}

.issue-lead-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.issue-lead-chip {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background: #fbfdff;
}

.issue-lead-chip strong {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 800;
}

.issue-lead-chip span {
  color: #667085;
  font-size: 0.73rem;
  line-height: 1.45;
}

.scorecard-soft-note {
  margin-top: 12px;
  background: #fff9ed;
  border-color: #f0d7a7;
  color: #8a5a00;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4e9f1;
}

.followup-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.followup-form-section {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d9e0ea;
  border-radius: 10px;
  background: #fbfdff;
}

.followup-form-single {
  width: 100%;
  max-width: 100%;
}

.followup-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.followup-section-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

.required-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.followup-form-section textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d9e0ea;
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
}

#followUpModal .field input,
#followUpModal .field select,
#followUpModal .followup-form-section textarea {
  padding: 7px 10px;
  font-size: 0.84rem;
}

#followUpModal .field span {
  font-size: 0.62rem;
}

.info-inline {
  padding: 9px 10px;
  border: 1px solid #fde68a;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
}

.followup-inline-prompt {
  margin: 4px 0 8px;
  padding: 9px 10px;
  border: 1px solid #fde68a;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.45;
}

.followup-submit-note {
  margin: 0;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.45;
}

.callback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Lead table schema after adding follow-up management columns. */
#leadTable {
  min-width: 4700px !important;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2),
#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 100px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 130px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 230px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 170px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 110px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 130px;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9),
#leadTable th:nth-child(10),
#leadTable td:nth-child(10) {
  width: 120px;
}

#leadTable th:nth-child(11),
#leadTable td:nth-child(11) {
  width: 140px;
  text-align: left !important;
}

#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 160px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13),
#leadTable th:nth-child(14),
#leadTable td:nth-child(14),
#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 130px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 150px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 120px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18) {
  width: 115px;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 90px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20),
#leadTable th:nth-child(21),
#leadTable td:nth-child(21),
#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 120px;
}

#leadTable th:nth-child(23),
#leadTable td:nth-child(23),
#leadTable th:nth-child(24),
#leadTable td:nth-child(24) {
  width: 170px;
}

#leadTable th:nth-child(25),
#leadTable td:nth-child(25) {
  width: 320px;
}

#leadTable th:nth-child(26),
#leadTable td:nth-child(26) {
  width: 260px;
}

#leadTable th:nth-child(27),
#leadTable td:nth-child(27) {
  width: 420px;
}

#leadTable th:nth-child(28),
#leadTable td:nth-child(28) {
  width: 340px;
}

#leadTable th:nth-child(29),
#leadTable td:nth-child(29) {
  width: 100px;
}

@media (max-width: 980px) {
  .upload-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue-lead-list {
    grid-template-columns: 1fr;
  }

  .followup-form-grid,
  .followup-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Lead table schema: grouped by lead identity, timing, medical context, scoring, blockers, follow-up, closure, outcome. */
#leadTable {
  min-width: 4550px !important;
  table-layout: fixed;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2),
#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 95px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 120px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5) {
  width: 105px;
}

#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 130px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 145px;
  text-align: left !important;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 165px;
  text-align: left !important;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9),
#leadTable th:nth-child(10),
#leadTable td:nth-child(10) {
  width: 115px;
}

#leadTable th:nth-child(11),
#leadTable td:nth-child(11) {
  width: 150px;
}

#leadTable th:nth-child(12),
#leadTable td:nth-child(12) {
  width: 120px;
}

#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 110px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 95px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 170px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 260px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 170px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18) {
  width: 360px;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 300px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20) {
  width: 115px;
}

#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 170px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 210px;
}

#leadTable th:nth-child(23),
#leadTable td:nth-child(23) {
  width: 155px;
}

#leadTable th:nth-child(24),
#leadTable td:nth-child(24) {
  width: 120px;
}

#leadTable th:nth-child(25),
#leadTable td:nth-child(25) {
  width: 115px;
}

#leadTable th:nth-child(26),
#leadTable td:nth-child(26) {
  width: 120px;
}

#leadTable th:nth-child(27),
#leadTable td:nth-child(27) {
  width: 100px;
}

/* Lead table schema after restoring operational audit columns. */
#leadTable {
  min-width: 5200px !important;
  table-layout: fixed;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1) {
  width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

#leadTable th:nth-child(2),
#leadTable td:nth-child(2) {
  width: 135px;
}

#leadTable th:nth-child(3),
#leadTable td:nth-child(3) {
  width: 165px;
}

#leadTable th:nth-child(4),
#leadTable td:nth-child(4) {
  width: 145px;
}

#leadTable th:nth-child(5),
#leadTable td:nth-child(5),
#leadTable th:nth-child(6),
#leadTable td:nth-child(6) {
  width: 105px;
}

#leadTable th:nth-child(7),
#leadTable td:nth-child(7) {
  width: 130px;
}

#leadTable th:nth-child(8),
#leadTable td:nth-child(8) {
  width: 105px;
  text-align: left !important;
}

#leadTable th:nth-child(9),
#leadTable td:nth-child(9) {
  width: 130px;
}

#leadTable th:nth-child(10),
#leadTable td:nth-child(10) {
  width: 145px;
  text-align: left !important;
}

#leadTable th:nth-child(11),
#leadTable td:nth-child(11) {
  width: 165px;
  text-align: left !important;
}

#leadTable th:nth-child(12),
#leadTable td:nth-child(12),
#leadTable th:nth-child(13),
#leadTable td:nth-child(13) {
  width: 115px;
}

#leadTable th:nth-child(14),
#leadTable td:nth-child(14) {
  width: 150px;
}

#leadTable th:nth-child(15),
#leadTable td:nth-child(15) {
  width: 120px;
}

#leadTable th:nth-child(16),
#leadTable td:nth-child(16) {
  width: 110px;
}

#leadTable th:nth-child(17),
#leadTable td:nth-child(17) {
  width: 95px;
}

#leadTable th:nth-child(18),
#leadTable td:nth-child(18) {
  width: 170px;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 260px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20) {
  width: 170px;
}

#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 360px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 300px;
}

#leadTable th:nth-child(23),
#leadTable td:nth-child(23) {
  width: 115px;
}

#leadTable th:nth-child(24),
#leadTable td:nth-child(24) {
  width: 170px;
}

#leadTable th:nth-child(25),
#leadTable td:nth-child(25) {
  width: 210px;
}

#leadTable th:nth-child(26),
#leadTable td:nth-child(26) {
  width: 155px;
}

#leadTable th:nth-child(27),
#leadTable td:nth-child(27) {
  width: 120px;
}

#leadTable th:nth-child(28),
#leadTable td:nth-child(28) {
  width: 115px;
}

#leadTable th:nth-child(29),
#leadTable td:nth-child(29) {
  width: 120px;
}

#leadTable th:nth-child(30),
#leadTable td:nth-child(30) {
  width: 100px;
}

/* Compact operational status columns that otherwise create unnecessary horizontal drag. */
#leadTable {
  min-width: 4650px !important;
}

#leadTable th:nth-child(19),
#leadTable td:nth-child(19) {
  width: 120px;
}

#leadTable th:nth-child(20),
#leadTable td:nth-child(20) {
  width: 112px;
}

#leadTable th:nth-child(21),
#leadTable td:nth-child(21) {
  width: 92px;
}

#leadTable th:nth-child(22),
#leadTable td:nth-child(22) {
  width: 150px;
}

#leadTable td:nth-child(19),
#leadTable td:nth-child(21),
#leadTable td:nth-child(22) {
  white-space: normal;
  line-height: 1.25;
}

#leadTable td:nth-child(20) .score-badge {
  min-width: 72px;
  justify-content: center;
}

.sc-lead-dashboard {
  display: grid;
  gap: 18px;
}

.sc-month-select-label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  margin: 0;
}

.sc-month-select-label span {
  color: #9aa3af;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sc-month-select-label select {
  min-height: 34px;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 12px;
}

.sc-page-actions {
  align-items: flex-end;
  margin-left: auto;
  justify-content: flex-end;
  min-width: 260px;
}

.sc-lead-card-grid {
  grid-template-columns: repeat(6, minmax(138px, 1fr)) !important;
  gap: 10px;
}

.sc-action-card {
  appearance: none;
  cursor: pointer;
  text-align: left;
}

.sc-action-card:hover,
.sc-action-card.active {
  border-color: #b7d4ff !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.sc-lead-panel {
  margin-top: 0;
}

.sc-row-count {
  white-space: nowrap;
}

.sc-lead-toolbar {
  margin-bottom: 12px;
}

.sc-lead-toolbar .search-field {
  min-width: 360px;
}

.sc-lead-table tr {
  cursor: pointer;
}

.sc-lead-table tr:hover td {
  background: #f8fbff;
}

#scLeadTable {
  min-width: 4650px !important;
  table-layout: fixed;
}

#scLeadTable th,
#scLeadTable td {
  padding: 9px 12px;
  text-align: left;
}

#scLeadTable th {
  background: #fafbfc;
  color: #888;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#scLeadTable th,
#scLeadTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#scLeadTable th:nth-child(1),
#scLeadTable td:nth-child(1) {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 10px 0 14px -14px rgba(15, 23, 42, 0.45);
  border-right: 1px solid #e5eaf2;
}

#scLeadTable thead th:nth-child(1) {
  z-index: 4;
  background: #fafbfc;
}

#scLeadTable tbody tr:hover td:nth-child(1),
#scLeadTable tbody tr.active td:nth-child(1) {
  background: #f8fbff;
}

#scLeadTable th:nth-child(2),
#scLeadTable td:nth-child(2),
#scLeadTable th:nth-child(3),
#scLeadTable td:nth-child(3) {
  width: 135px;
}

#scLeadTable th:nth-child(4),
#scLeadTable td:nth-child(4) {
  width: 170px;
}

#scLeadTable th:nth-child(5),
#scLeadTable td:nth-child(5) {
  width: 110px;
}

#scLeadTable th:nth-child(6),
#scLeadTable td:nth-child(6) {
  width: 110px;
}

#scLeadTable th:nth-child(7),
#scLeadTable td:nth-child(7) {
  width: 115px;
}

#scLeadTable th:nth-child(8),
#scLeadTable td:nth-child(8) {
  width: 115px;
}

#scLeadTable th:nth-child(9),
#scLeadTable td:nth-child(9),
#scLeadTable th:nth-child(10),
#scLeadTable td:nth-child(10) {
  width: 140px;
}

#scLeadTable th:nth-child(11),
#scLeadTable td:nth-child(11) {
  width: 165px;
  text-align: left !important;
}

#scLeadTable th:nth-child(12),
#scLeadTable td:nth-child(12),
#scLeadTable th:nth-child(13),
#scLeadTable td:nth-child(13) {
  width: 115px;
}

#scLeadTable th:nth-child(14),
#scLeadTable td:nth-child(14) {
  width: 150px;
}

#scLeadTable th:nth-child(15),
#scLeadTable td:nth-child(15) {
  width: 120px;
}

#scLeadTable th:nth-child(16),
#scLeadTable td:nth-child(16) {
  width: 110px;
}

#scLeadTable th:nth-child(17),
#scLeadTable td:nth-child(17) {
  width: 95px;
}

#scLeadTable th:nth-child(18),
#scLeadTable td:nth-child(18) {
  width: 170px;
}

#scLeadTable th:nth-child(19),
#scLeadTable td:nth-child(19) {
  width: 120px;
}

#scLeadTable th:nth-child(20),
#scLeadTable td:nth-child(20) {
  width: 112px;
}

#scLeadTable th:nth-child(21),
#scLeadTable td:nth-child(21) {
  width: 92px;
}

#scLeadTable th:nth-child(22),
#scLeadTable td:nth-child(22) {
  width: 150px;
}

#scLeadTable th:nth-child(23),
#scLeadTable td:nth-child(23) {
  width: 115px;
}

#scLeadTable th:nth-child(24),
#scLeadTable td:nth-child(24) {
  width: 170px;
}

#scLeadTable th:nth-child(25),
#scLeadTable td:nth-child(25) {
  width: 210px;
}

#scLeadTable th:nth-child(26),
#scLeadTable td:nth-child(26) {
  width: 155px;
}

#scLeadTable th:nth-child(27),
#scLeadTable td:nth-child(27) {
  width: 120px;
}

#scLeadTable th:nth-child(28),
#scLeadTable td:nth-child(28) {
  width: 115px;
}

#scLeadTable th:nth-child(29),
#scLeadTable td:nth-child(29) {
  width: 120px;
}

#scLeadTable th:nth-child(30),
#scLeadTable td:nth-child(30) {
  width: 100px;
}

#scLeadTable td:nth-child(19),
#scLeadTable td:nth-child(21),
#scLeadTable td:nth-child(22) {
  white-space: normal;
  line-height: 1.25;
}

#scLeadTable td:nth-child(20) .score-badge {
  min-width: 72px;
  justify-content: center;
}

/* Shared fixed grid for All Leads and SC Lead Table. Keep every column boxed so horizontal scroll never overlaps text. */
#leadTable,
#scLeadTable {
  min-width: 5850px !important;
  table-layout: fixed !important;
  border-collapse: separate;
  border-spacing: 0;
}

#leadTable th,
#leadTable td,
#scLeadTable th,
#scLeadTable td {
  box-sizing: border-box;
  max-width: var(--col-w);
  min-width: var(--col-w);
  width: var(--col-w);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
  vertical-align: middle;
}

#leadTable th:nth-child(1),
#leadTable td:nth-child(1),
#scLeadTable th:nth-child(1),
#scLeadTable td:nth-child(1) { --col-w: 190px; }

#leadTable th:nth-child(2), #leadTable td:nth-child(2),
#leadTable th:nth-child(3), #leadTable td:nth-child(3),
#scLeadTable th:nth-child(2), #scLeadTable td:nth-child(2),
#scLeadTable th:nth-child(3), #scLeadTable td:nth-child(3) { --col-w: 135px; }

#leadTable th:nth-child(4), #leadTable td:nth-child(4),
#scLeadTable th:nth-child(4), #scLeadTable td:nth-child(4) { --col-w: 165px; }

#leadTable th:nth-child(5), #leadTable td:nth-child(5),
#scLeadTable th:nth-child(5), #scLeadTable td:nth-child(5) { --col-w: 145px; }

#leadTable th:nth-child(6), #leadTable td:nth-child(6),
#leadTable th:nth-child(7), #leadTable td:nth-child(7),
#leadTable th:nth-child(8), #leadTable td:nth-child(8),
#leadTable th:nth-child(9), #leadTable td:nth-child(9),
#scLeadTable th:nth-child(6), #scLeadTable td:nth-child(6),
#scLeadTable th:nth-child(7), #scLeadTable td:nth-child(7),
#scLeadTable th:nth-child(8), #scLeadTable td:nth-child(8),
#scLeadTable th:nth-child(9), #scLeadTable td:nth-child(9) { --col-w: 115px; }

#leadTable th:nth-child(10), #leadTable td:nth-child(10),
#scLeadTable th:nth-child(10), #scLeadTable td:nth-child(10) { --col-w: 145px; }

#leadTable th:nth-child(11), #leadTable td:nth-child(11),
#leadTable th:nth-child(12), #leadTable td:nth-child(12),
#leadTable th:nth-child(13), #leadTable td:nth-child(13),
#leadTable th:nth-child(14), #leadTable td:nth-child(14),
#scLeadTable th:nth-child(11), #scLeadTable td:nth-child(11),
#scLeadTable th:nth-child(12), #scLeadTable td:nth-child(12),
#scLeadTable th:nth-child(13), #scLeadTable td:nth-child(13),
#scLeadTable th:nth-child(14), #scLeadTable td:nth-child(14) { --col-w: 165px; }

#leadTable th:nth-child(15), #leadTable td:nth-child(15),
#leadTable th:nth-child(16), #leadTable td:nth-child(16),
#scLeadTable th:nth-child(15), #scLeadTable td:nth-child(15),
#scLeadTable th:nth-child(16), #scLeadTable td:nth-child(16) { --col-w: 155px; }

#leadTable th:nth-child(17), #leadTable td:nth-child(17),
#leadTable th:nth-child(18), #leadTable td:nth-child(18),
#leadTable th:nth-child(19), #leadTable td:nth-child(19),
#scLeadTable th:nth-child(17), #scLeadTable td:nth-child(17),
#scLeadTable th:nth-child(18), #scLeadTable td:nth-child(18),
#scLeadTable th:nth-child(19), #scLeadTable td:nth-child(19) { --col-w: 145px; }

#leadTable th:nth-child(20), #leadTable td:nth-child(20),
#leadTable th:nth-child(21), #leadTable td:nth-child(21),
#leadTable th:nth-child(22), #leadTable td:nth-child(22),
#leadTable th:nth-child(23), #leadTable td:nth-child(23),
#scLeadTable th:nth-child(20), #scLeadTable td:nth-child(20),
#scLeadTable th:nth-child(21), #scLeadTable td:nth-child(21),
#scLeadTable th:nth-child(22), #scLeadTable td:nth-child(22),
#scLeadTable th:nth-child(23), #scLeadTable td:nth-child(23) { --col-w: 120px; }

#leadTable th:nth-child(24), #leadTable td:nth-child(24),
#scLeadTable th:nth-child(24), #scLeadTable td:nth-child(24) { --col-w: 180px; }

#leadTable th:nth-child(25), #leadTable td:nth-child(25),
#leadTable th:nth-child(27), #leadTable td:nth-child(27),
#leadTable th:nth-child(28), #leadTable td:nth-child(28),
#scLeadTable th:nth-child(25), #scLeadTable td:nth-child(25),
#scLeadTable th:nth-child(27), #scLeadTable td:nth-child(27),
#scLeadTable th:nth-child(28), #scLeadTable td:nth-child(28) { --col-w: 220px; }

#leadTable th:nth-child(26), #leadTable td:nth-child(26),
#scLeadTable th:nth-child(26), #scLeadTable td:nth-child(26) { --col-w: 150px; }

#leadTable th:nth-child(29), #leadTable td:nth-child(29),
#scLeadTable th:nth-child(29), #scLeadTable td:nth-child(29) { --col-w: 155px; }

#leadTable th:nth-child(30), #leadTable td:nth-child(30),
#scLeadTable th:nth-child(30), #scLeadTable td:nth-child(30) { --col-w: 120px; }

#leadTable th:nth-child(31), #leadTable td:nth-child(31),
#leadTable th:nth-child(32), #leadTable td:nth-child(32),
#leadTable th:nth-child(33), #leadTable td:nth-child(33),
#scLeadTable th:nth-child(31), #scLeadTable td:nth-child(31),
#scLeadTable th:nth-child(32), #scLeadTable td:nth-child(32),
#scLeadTable th:nth-child(33), #scLeadTable td:nth-child(33) { --col-w: 165px; }

#leadTable th:nth-child(34), #leadTable td:nth-child(34),
#scLeadTable th:nth-child(34), #scLeadTable td:nth-child(34) { --col-w: 155px; }

#leadTable th:nth-child(35), #leadTable td:nth-child(35),
#leadTable th:nth-child(36), #leadTable td:nth-child(36),
#scLeadTable th:nth-child(35), #scLeadTable td:nth-child(35),
#scLeadTable th:nth-child(36), #scLeadTable td:nth-child(36) { --col-w: 130px; }

#leadTable th:nth-child(37), #leadTable td:nth-child(37),
#scLeadTable th:nth-child(37), #scLeadTable td:nth-child(37) { --col-w: 120px; }

#leadTable td:nth-child(19),
#leadTable td:nth-child(21),
#leadTable td:nth-child(22),
#scLeadTable td:nth-child(19),
#scLeadTable td:nth-child(21),
#scLeadTable td:nth-child(22) {
  white-space: nowrap !important;
  line-height: 1.25;
}

#leadTable .followup-cell,
#scLeadTable .followup-cell {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#leadTable .followup-cell > span,
#scLeadTable .followup-cell > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1440px) {
  .sc-lead-card-grid {
    grid-template-columns: repeat(6, minmax(138px, 1fr)) !important;
    gap: 10px;
  }
}

@media (max-width: 980px) {
  .sc-lead-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1320px) {
  .intelligence-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intelligence-insights-grid {
    grid-template-columns: 1fr;
  }

  .intelligence-mini-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-kpi-grid,
  #dashboardView .hero-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .intelligence-kpi-grid,
  .intelligence-mini-kpis {
    grid-template-columns: 1fr;
  }

  .intelligence-periods {
    display: grid;
  }

  .dashboard-filter-bar {
    align-items: flex-start;
  }

  .dashboard-kpi-grid,
  #dashboardView .hero-grid,
  .mini-kpi-grid,
  .action-board {
    grid-template-columns: 1fr;
  }

  .comparison-bar {
    grid-template-columns: 1fr;
  }
}

body.dashboard-mode .main {
  padding: 0;
  gap: 0;
  background: #f6f8fb;
}

body.dashboard-mode .topbar {
  display: none;
}

body.dashboard-mode #syncLog,
body.dashboard-mode #settingsBanner {
  margin: 0 28px 16px;
}

body.dashboard-mode #dashboardView {
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.dashboard-mode #dashboardView.active {
  display: block;
}

body.dashboard-mode #coachDashboardView {
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.dashboard-mode #coachDashboardView.active {
  display: block;
}

body.dashboard-mode #aiDashboardView,
body.dashboard-mode #heatmapDashboardView,
body.dashboard-mode #dayCoachScoreView {
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.dashboard-mode #aiDashboardView.active,
body.dashboard-mode #heatmapDashboardView.active,
body.dashboard-mode #dayCoachScoreView.active {
  display: block;
}

body.dashboard-mode .dashboard-frame {
  width: 100%;
  min-height: calc(100vh - 88px);
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}

@media (max-width: 980px) {
  body.dashboard-mode .main {
    padding: 0;
  }

  body.dashboard-mode #syncLog,
  body.dashboard-mode #settingsBanner {
    margin: 0 16px 12px;
  }
}
/* Auth and user management */
.auth-locked{filter:blur(3px);pointer-events:none;user-select:none;}
.login-overlay{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:18px;background:#f4f7fb;overflow:hidden;}
.login-overlay::before{content:"";position:absolute;inset:-25%;background:radial-gradient(circle at 18% 20%,rgba(37,99,235,.18),transparent 28%),radial-gradient(circle at 82% 22%,rgba(16,185,129,.16),transparent 26%),linear-gradient(135deg,#eef5ff 0%,#f8fafc 48%,#eefbf6 100%);animation:loginAtmosphere 14s ease-in-out infinite alternate;}
.login-shell{position:relative;z-index:1;width:min(920px,100%);min-height:500px;display:grid;grid-template-columns:minmax(0,1fr) 360px;background:rgba(255,255,255,.82);border:1px solid rgba(203,213,225,.9);border-radius:24px;box-shadow:0 22px 58px rgba(15,23,42,.13);overflow:hidden;backdrop-filter:blur(18px);}
.login-visual{position:relative;overflow:hidden;padding:30px 32px;color:#fff;background:linear-gradient(145deg,#10213d 0%,#12385f 52%,#0f766e 100%);}
.login-visual::after{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.055) 1px,transparent 1px);background-size:40px 40px;mask-image:linear-gradient(180deg,rgba(0,0,0,.8),rgba(0,0,0,.18));}
.login-visual-glow{position:absolute;width:210px;height:210px;border-radius:999px;filter:blur(22px);opacity:.28;animation:loginFloat 8s ease-in-out infinite;}
.login-visual-glow-one{left:8%;top:16%;background:#38bdf8;}
.login-visual-glow-two{right:10%;bottom:12%;background:#34d399;animation-delay:1.2s;}
.login-product-mark,.login-hero-copy,.login-demo-card,.login-floating-card,.login-orbit{position:relative;z-index:1;}
.login-product-mark{display:inline-grid;gap:3px;padding:8px 10px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(255,255,255,.08);box-shadow:inset 0 1px 0 rgba(255,255,255,.12);}
.login-product-mark span{font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;color:#bfdbfe;}
.login-product-mark strong{font-size:13px;color:#fff;}
.login-hero-copy{max-width:430px;margin-top:46px;}
.login-eyebrow{font-size:9px;font-weight:900;letter-spacing:.16em;text-transform:uppercase;color:#86efac;margin-bottom:9px;}
.login-hero-copy h2{font-size:27px;line-height:1.12;letter-spacing:-.035em;margin-bottom:12px;color:#fff;max-width:440px;}
.login-hero-copy p:not(.login-eyebrow){font-size:12px;line-height:1.58;color:#dbeafe;max-width:390px;}
.login-demo-card{width:min(330px,86%);margin-top:26px;padding:14px;border:1px solid rgba(255,255,255,.16);border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,.07));box-shadow:0 16px 44px rgba(0,0,0,.14);backdrop-filter:blur(14px);animation:loginRise 700ms ease both;}
.login-demo-top{display:flex;align-items:center;justify-content:space-between;color:#bfdbfe;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:12px;}
.login-demo-top strong{color:#86efac;background:rgba(34,197,94,.14);border:1px solid rgba(134,239,172,.25);border-radius:999px;padding:4px 7px;}
.login-demo-metric strong{display:block;font-size:18px;color:#fff;margin-bottom:3px;}
.login-demo-metric span{color:#cbd5e1;font-size:10px;}
.login-demo-bars{display:grid;gap:7px;margin-top:16px;}
.login-demo-bars i{height:7px;border-radius:999px;background:linear-gradient(90deg,#60a5fa,#34d399);animation:loginBar 2.8s ease-in-out infinite;}
.login-demo-bars i:nth-child(1){width:82%;}
.login-demo-bars i:nth-child(2){width:58%;animation-delay:.25s;}
.login-demo-bars i:nth-child(3){width:72%;animation-delay:.5s;}
.login-floating-card{position:absolute;display:grid;gap:2px;min-width:112px;padding:9px 10px;border:1px solid rgba(255,255,255,.15);border-radius:13px;background:rgba(255,255,255,.1);box-shadow:0 12px 32px rgba(0,0,0,.13);backdrop-filter:blur(16px);animation:loginFloat 5.5s ease-in-out infinite;}
.login-floating-card span{font-size:8px;color:#bfdbfe;text-transform:uppercase;font-weight:900;letter-spacing:.1em;}
.login-floating-card strong{font-size:12px;color:#fff;}
.login-floating-card-one{right:28px;top:104px;}
.login-floating-card-two{right:58px;bottom:54px;animation-delay:1.4s;}
.login-orbit{position:absolute;right:70px;top:188px;width:112px;height:112px;border:1px solid rgba(255,255,255,.14);border-radius:50%;animation:loginSpin 13s linear infinite;}
.login-orbit::before{content:"";position:absolute;left:16px;top:22px;width:13px;height:13px;border-radius:999px;background:#86efac;box-shadow:0 0 28px #86efac;}
.login-card{align-self:center;justify-self:center;width:min(310px,calc(100% - 32px));background:#fff;border:1px solid #e5edf7;border-radius:22px;padding:20px;box-shadow:0 16px 42px rgba(15,23,42,.1);}
.login-brand{display:grid;gap:2px;margin-bottom:10px;}
.login-brand span{color:#1d4ed8;font-size:8.5px;font-weight:900;letter-spacing:.13em;text-transform:uppercase;}
.login-brand strong,.login-card h1{color:#0f172a;}
.login-brand strong{font-size:12px;}
.login-card h1{font-size:18px;letter-spacing:-.025em;margin-bottom:5px;}
.login-card p,.login-card small{color:#64748b;line-height:1.55;}
.login-card p{font-size:11px;margin-bottom:9px;}
.login-card small{display:block;margin-top:10px;font-size:10px;}
.login-card label{display:grid;gap:5px;color:#64748b;font-size:8px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;margin:8px 0;}
.login-card input,.user-form-panel input,.user-form-panel select{width:100%;border:1px solid #dbe3ef;border-radius:11px;min-height:34px;padding:0 11px;font:inherit;color:#0f172a;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03);}
.login-card input{font-size:13px;font-weight:600;}
.login-card input::placeholder{font-size:12px;font-weight:600;color:#7c8798;}
.login-card input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.12);}
.login-card .btn{width:100%;justify-content:center;min-height:34px;border-radius:11px;font-size:12px;}
.login-divider{display:flex;align-items:center;gap:8px;color:#94a3b8;font-size:7.5px;font-weight:900;letter-spacing:.1em;text-transform:uppercase;margin:9px 0;}
.login-divider::before,.login-divider::after{content:"";height:1px;flex:1;background:#e2e8f0;}
.login-message{margin:8px 0;padding:8px 10px;border-radius:11px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-size:10px;line-height:1.45;}
.login-message-loading{position:relative;padding-left:30px;background:#f8fbff;border-color:#c8dbfb;color:#0f4fb8;}
.login-message-loading::before{content:"";position:absolute;left:10px;top:50%;width:11px;height:11px;margin-top:-6px;border-radius:999px;border:2px solid rgba(19,92,200,.2);border-top-color:#135cc8;animation:spin .8s linear infinite;}
.login-message-error{background:#fff7f7;border-color:#fecaca;color:#b91c1c;}
@keyframes loginAtmosphere{from{transform:translate3d(-1%,0,0) scale(1);}to{transform:translate3d(1.5%,1%,0) scale(1.03);}}
@keyframes loginFloat{0%,100%{transform:translateY(0);}50%{transform:translateY(-14px);}}
@keyframes loginSpin{to{transform:rotate(360deg);}}
@keyframes loginRise{from{opacity:0;transform:translateY(18px);}to{opacity:1;transform:translateY(0);}}
@keyframes loginBar{0%,100%{filter:saturate(1);opacity:.72;}50%{filter:saturate(1.4);opacity:1;}}
@media (max-width:900px){.login-shell{grid-template-columns:1fr;min-height:auto;}.login-visual{display:none;}.login-card{width:min(420px,calc(100% - 28px));margin:18px 0;}}
#userManagementView .user-management-panel{display:grid;gap:14px;padding:18px 20px;background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);}
#userManagementView .section-head{align-items:center;border-bottom:1px solid #edf2f7;padding-bottom:12px;}
#userManagementView .section-head h3{font-size:1.05rem;line-height:1.2;color:var(--ink);letter-spacing:-.02em;}
#userManagementView .section-head .eyebrow{font-size:.68rem;color:#8a96a8;}
#userManagementView #newUserBtn{min-height:38px;border-radius:12px;padding:0 16px;font-size:.78rem;}
.user-form-panel{border:1px solid #dbe7f7;border-radius:16px;padding:14px;background:#fbfdff;}
.user-form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.user-form-panel label,.permission-grid label{display:grid;gap:6px;color:#64748b;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.user-form-panel input,.user-form-panel select{font-size:.82rem;font-weight:650;}
.permission-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;margin-top:12px;}
.permission-grid label{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:9px 10px;text-transform:none;color:#34445a;font-size:.74rem;}
.permission-grid input{accent-color:var(--primary);}
.form-actions,.user-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;}
.user-table-wrap{overflow:auto;border:1px solid #e5eaf2;border-radius:16px;background:#fff;}
.user-table{width:100%;border-collapse:collapse;font-size:.82rem;min-width:980px;}
.user-table th,.user-table td{padding:13px 14px;border-bottom:1px solid #eef2f7;text-align:left;vertical-align:middle;}
.user-table th{color:#7c8798;font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:#fbfdff;}
.user-table td{color:#243044;}
.user-table td:first-child strong{display:block;color:#111827;font-size:.84rem;margin-bottom:3px;}
.user-table .metric-sub{display:block;color:#8a96a8;font-size:.72rem;line-height:1.35;}
.user-actions{margin-top:0;align-items:center;}
.user-actions button,.unmapped-coach-chip button,.unmapped-coach-actions button{border:1px solid #dbe3ef;border-radius:999px;background:#fff;color:#0f4fb8;padding:6px 10px;font:inherit;font-size:.68rem;font-weight:800;cursor:pointer;transition:background 120ms ease,border-color 120ms ease,transform 120ms ease;}
.user-actions button:hover,.unmapped-coach-actions button:hover{background:#eff6ff;border-color:#bfdbfe;transform:translateY(-1px);}
.user-actions button[data-user-delete]{color:#b91c1c;border-color:#fecaca;background:#fff7f7;}
.unmapped-coach-chip{display:inline-flex;align-items:center;gap:8px;margin:8px 8px 0 0;padding:8px 10px;border:1px solid #fde68a;border-radius:999px;background:#fffbeb;color:#92400e;}
#unmappedCoachPanel{white-space:normal;background:#fff;border:1px solid #dbe3ef;border-radius:16px;padding:14px;box-shadow:0 1px 2px rgba(15,23,42,.03);}
.unmapped-coach-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.unmapped-coach-head h4{font-size:.95rem;color:#111827;line-height:1.25;margin-top:2px;}
.unmapped-coach-head > span{display:inline-flex;align-items:center;border-radius:999px;background:#fff7ed;color:#c2410c;border:1px solid #fed7aa;padding:5px 9px;font-size:.7rem;font-weight:800;white-space:nowrap;}
.unmapped-coach-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.unmapped-coach-card{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;border:1px solid #e8eef7;border-radius:14px;background:#fbfdff;padding:10px 11px;}
.unmapped-coach-card strong{display:block;color:#0f172a;font-size:.82rem;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:210px;}
.unmapped-coach-card span{display:block;color:#7c8798;font-size:.7rem;margin-top:3px;}
.unmapped-coach-actions{display:flex;gap:6px;flex:0 0 auto;}
@media (max-width:1300px){.unmapped-coach-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.permission-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width:1100px){.user-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:760px){.unmapped-coach-grid,.user-form-grid,.permission-grid{grid-template-columns:1fr;}#userManagementView .section-head{align-items:flex-start;flex-direction:column;}.unmapped-coach-card{align-items:flex-start;flex-direction:column;}.unmapped-coach-actions{width:100%;}.unmapped-coach-actions button{flex:1;}}
#backupRestoreView {
  max-width: 1180px;
}

#backupRestoreView .settings-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

#backupRestoreView .summary-chip {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

#backupRestoreView .summary-chip span {
  color: #7c8798;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#backupRestoreView .summary-chip strong {
  display: block;
  margin-top: 7px;
  color: #111827;
  font-size: 1rem;
  line-height: 1.22;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backup-restore-layout {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.backup-restore-layout .panel {
  min-height: 0;
  padding: 16px;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

#backupRestoreView .section-head {
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px solid #e4e9f1;
}

#backupRestoreView .section-head h3 {
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.2;
}

#backupRestoreView .eyebrow {
  color: #8a96a8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

#backupRestoreView .info-box,
#backupRestoreView .status-panel {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border-color: #dbe7f6;
  background: #f8fbff;
  font-size: 0.75rem;
  line-height: 1.45;
}

#backupRestoreView .info-box strong {
  color: #111827;
  font-size: 0.78rem;
}

#backupRestoreView .info-box p {
  margin-top: 4px;
  color: #53627a;
}

.backup-checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  background: #fbfdff;
  color: #31415a;
  font-size: 0.76rem;
  line-height: 1.45;
}

.backup-checkline input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: #0b5fd3;
}

#backupRestoreView .field {
  margin-top: 12px;
  gap: 6px;
}

#backupRestoreView .field span {
  color: #718096;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#backupRestoreView .field input,
#backupRestoreView .field select {
  height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 650;
}

#backupRestoreView .warning-box {
  border-color: #fed7aa;
  background: #fff7ed;
}

#backupRestoreView .button-row {
  margin-top: 12px;
}

#backupRestoreView .button-row .btn {
  min-height: 36px;
  border-radius: 11px;
  padding: 0 15px;
  font-size: 0.78rem;
}

#backupRestoreView .backup-history-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.backup-history-wrap {
  overflow: hidden;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #ffffff;
}

.backup-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
}

.backup-history-table th,
.backup-history-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
}

.backup-history-table th {
  background: #fbfdff;
  color: #718096;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.backup-history-table td {
  color: #243044;
  overflow-wrap: anywhere;
}

.backup-history-table tr:last-child td {
  border-bottom: none;
}

.backup-history-table th:nth-child(1) {
  width: 190px;
}

.backup-history-table th:nth-child(3) {
  width: 130px;
}

.backup-history-table th:nth-child(4) {
  width: 96px;
}

@media (max-width: 1100px) {
  #backupRestoreView .settings-status-grid,
  .backup-restore-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  #backupRestoreView .settings-status-grid,
  .backup-restore-layout {
    grid-template-columns: 1fr;
  }
}
