/* Cohort Analytics — Dashboard Tab & Interactive Retention Curve styles */

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

/* KPI Metrics Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s var(--ux-ease), box-shadow 0.2s var(--ux-ease), border-color 0.2s var(--ux-ease);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -3px var(--ux-shadow);
  border-color: var(--ux-line);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ux-ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ux-surface-2);
  color: var(--ux-accent);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ux-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi-sub {
  font-size: 12px;
  color: var(--ux-ink-3);
  margin-top: 4px;
  line-height: 1.4;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}

.kpi-trend.positive {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.kpi-trend.neutral {
  background: var(--ux-surface-2);
  color: var(--ux-ink-2);
}

/* Dashboard Interactive Section */
.dashboard-section {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
}

.dash-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dash-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--ux-ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-subheading {
  font-size: 12.5px;
  color: var(--ux-ink-2);
  margin: 2px 0 0 0;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-controls,
.dash-toggle-capsule {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--ux-surface-2);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--ux-line-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* Category Controls Toolbar Row */
.cat-controls-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cat-page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ux-ink-2);
  white-space: nowrap;
}

.cat-page-size-control label {
  margin: 0;
  line-height: 1;
}

.cat-controls-cluster .dash-toggle-capsule {
  height: 32px;
  padding: 2px 3px;
}

.cat-controls-cluster .dash-btn-toggle {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11.5px;
}

.dash-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  background: var(--ux-surface);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.35, 1), width 0.28s cubic-bezier(0.25, 1, 0.35, 1);
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .dash-slider,
:root:not([data-theme="light"]) .dash-slider {
  background: var(--ux-surface-3);
  border: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.dash-btn-toggle {
  position: relative;
  z-index: 2;
  background: transparent;
  border: 0;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ux-ink-2);
  cursor: pointer;
  transition: color 0.18s var(--ux-ease);
}

.dash-btn-toggle:hover {
  color: var(--ux-ink);
}

.dash-btn-toggle.active {
  color: var(--ux-ink);
  font-weight: 600;
}

/* Fallback visible pill ONLY for capsules without a sliding indicator (.dash-slider) */
.dash-toggle-capsule:not(:has(.dash-slider)) .dash-btn-toggle.active {
  background: var(--ux-surface);
  border: 0;
  box-shadow: 0 1px 4px var(--ux-shadow);
}

[data-theme="dark"] .dash-toggle-capsule:not(:has(.dash-slider)) .dash-btn-toggle.active,
:root:not([data-theme="light"]) .dash-toggle-capsule:not(:has(.dash-slider)) .dash-btn-toggle.active {
  background: var(--ux-surface-3);
  border: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  color: #FFFFFF;
}

/* SVG Chart Container */
.chart-viewport {
  position: relative;
  width: 100%;
  height: 290px;
  margin-top: 10px;
}

.retention-svg-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Grid & Axes */
.chart-grid line {
  stroke: var(--ux-line-2);
  stroke-dasharray: 4 4;
}

.chart-axis-label {
  fill: var(--ux-ink-3);
  font-size: 10.5px;
  font-weight: 500;
}

/* Curve elements */
.chart-area-path {
  fill: url(#retentionAreaGradient);
  transition: d 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart-line-path {
  fill: none;
  stroke: var(--ux-accent);
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: d 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart-data-dot {
  fill: var(--ux-surface);
  stroke: var(--ux-accent);
  stroke-width: 2.5;
  cursor: pointer;
  transition: transform 0.15s ease, r 0.15s ease, stroke-width 0.15s ease;
}

.chart-data-dot:hover,
.chart-data-dot.active {
  r: 6.5;
  stroke-width: 3.5;
  fill: var(--ux-accent);
}

/* Discrete Bar Chart Styling */
.chart-bar-rect {
  fill: var(--ux-accent);
  opacity: 0.82;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, fill 0.18s ease;
}

.chart-bar-rect:hover,
.chart-bar-rect.active {
  opacity: 1;
  fill: var(--ux-accent-2);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.chart-bar-rect.churn-bar {
  fill: var(--ux-danger);
  opacity: 0.78;
}

.chart-bar-rect.churn-bar:hover,
.chart-bar-rect.churn-bar.active {
  opacity: 1;
  fill: #e04b4b;
}

.chart-bar-val-label {
  fill: var(--ux-ink);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

/* Compare Multiline Chart Styling */
.compare-line-path {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width 0.15s ease, opacity 0.15s ease;
}

.compare-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--ux-line-2);
}

.compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ux-ink-2);
}

.compare-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* Chart Tooltip */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-10px);
  transition: opacity 0.15s var(--ux-ease), transform 0.15s var(--ux-ease);
  z-index: 10;
  white-space: nowrap;
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-12px);
}

.tooltip-title {
  font-weight: 600;
  color: var(--ux-ink);
  margin-bottom: 2px;
}

.tooltip-val {
  font-weight: 700;
  color: var(--ux-accent);
  font-size: 13.5px;
}

.tooltip-sub {
  font-size: 11px;
  color: var(--ux-ink-3);
}

/* Cohort Distribution Table / Mini Breakdown */
.dash-cohorts-summary {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 820px) {
  .dash-cohorts-summary {
    grid-template-columns: 1fr;
  }
}

.dash-sub-card {
  background: var(--ux-surface-2);
  border: 1px solid var(--ux-line-2);
  border-radius: 12px;
  padding: 16px;
}

.dash-sub-card h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ux-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 8px;
  font-size: 12.5px;
}

.dash-list-item .item-label {
  font-weight: 600;
  color: var(--ux-ink);
}

.dash-list-item .item-meta {
  color: var(--ux-ink-2);
  font-size: 11.5px;
}

.dash-list-item .item-badge {
  font-weight: 700;
  color: var(--ux-accent);
}

/* Period Progress Bars */
.dash-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.dash-prog-label {
  width: 140px;
  font-weight: 600;
  color: var(--ux-ink-2);
  flex-shrink: 0;
  white-space: nowrap;
}

.dash-prog-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--ux-line-2);
  border-radius: 4px;
  overflow: hidden;
}

.dash-prog-fill {
  height: 100%;
  background: var(--ux-accent-2);
  border-radius: 4px;
  transition: width 0.4s var(--ux-ease);
}

.dash-prog-val {
  width: 45px;
  text-align: right;
  font-weight: 700;
  color: var(--ux-ink);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Doctor Leaderboard & Frequency Buckets Grid */
.dash-insights-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .dash-insights-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Bespoke Healthcare Analytics Tables (Doctor Retention & Visit Frequency)
   ========================================================================== */
.dash-insights-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 960px) {
  .dash-insights-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ux-line-2);
  margin-bottom: 8px;
}

.dash-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ux-ink);
  letter-spacing: -0.2px;
}

.dash-card-subtitle {
  display: block;
  font-size: 11.5px;
  color: var(--ux-ink-3);
  margin-top: 2px;
}

.dash-segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.dash-segment-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ux-ink-3);
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-segment-btn:hover {
  color: var(--ux-ink);
}

.dash-segment-btn.active {
  background: var(--ux-surface-2);
  color: var(--ux-ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.dash-status-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--ux-ink-3);
  padding: 3px 8px;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 4px;
}

/* Bespoke Tables */
.dash-doc-table-container,
.dash-freq-table-container {
  overflow-x: auto;
  border-radius: 6px;
}

.dash-bespoke-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.dash-bespoke-table thead th {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ux-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  border-bottom: 1px solid var(--ux-line-2);
  white-space: nowrap;
}

.dash-bespoke-table thead th.col-stat,
.dash-bespoke-table thead th.col-rate,
.dash-bespoke-table thead th.col-num {
  text-align: right;
}

.dash-bespoke-table tbody tr {
  border-bottom: 1px solid var(--ux-line-2);
  transition: background-color 0.12s ease;
}

.dash-bespoke-table tbody tr:last-child {
  border-bottom: none;
}

.dash-bespoke-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dash-bespoke-table tbody td {
  padding: 9px 10px;
  vertical-align: middle;
}

.dash-bespoke-table tbody td.col-num {
  text-align: right;
  color: var(--ux-ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.dash-bespoke-table tbody td.col-stat {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ux-ink-2);
}

.dash-bespoke-table tbody td.col-rate {
  text-align: right;
}

.col-name .doc-primary-name,
.col-name .freq-segment-name {
  font-weight: 600;
  color: var(--ux-ink);
  white-space: nowrap;
}

.rank-badge {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--ux-ink-3);
}

.doc-table-row.rank-gold .rank-badge {
  color: #f59e0b;
  font-weight: 700;
}

.doc-table-row.rank-silver .rank-badge {
  color: #94a3b8;
  font-weight: 700;
}

.doc-table-row.rank-bronze .rank-badge {
  color: #d97706;
  font-weight: 700;
}

/* Rate Track and Subtle Bar */
.table-rate-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-rate-cell .rate-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--ux-ink);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

.table-rate-cell .rate-track {
  width: 65px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.table-rate-cell .rate-fill {
  height: 100%;
  background: var(--ux-accent-2);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.table-rate-cell .rate-fill.freq-fill {
  background: var(--ux-accent-2);
}

.table-empty-cell {
  text-align: center;
  padding: 24px !important;
  color: var(--ux-ink-3);
  font-size: 12px;
}

/* Footer Action */
.dash-card-footer {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--ux-line-2);
  text-align: right;
}

.dash-link-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ux-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.dash-link-btn:hover {
  background: var(--ux-surface);
  color: var(--ux-accent-hover, var(--ux-accent));
}

/* Follow-up & At-Risk Tab Styles */
.followup-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.followup-kpi-card {
  position: relative;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.followup-kpi-card:hover {
  border-color: var(--ux-line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kpi-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kpi-indicator.dot-warning {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.kpi-indicator.dot-danger {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.kpi-indicator.dot-success {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.followup-kpi-card .kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ux-ink-2);
  letter-spacing: 0.02em;
}

.kpi-window-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--ux-surface-2);
  color: var(--ux-ink-3);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--ux-line-2);
}

.followup-kpi-card.status-risk .kpi-window-pill {
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
}

.followup-kpi-card.status-lapsed .kpi-window-pill {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

.followup-kpi-card.status-active .kpi-window-pill {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.06);
}

.kpi-stat-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.kpi-stat-display .kpi-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--ux-ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kpi-stat-display .kpi-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--ux-ink-3);
}

.kpi-foot-hint {
  font-size: 11.5px;
  color: var(--ux-ink-3);
  line-height: 1.35;
}

.followup-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 14px;
}

.followup-pills-group {
  display: inline-flex;
  gap: 6px;
}

.followup-filter-pill {
  border: 1px solid var(--ux-line-2);
  background: var(--ux-surface);
  color: var(--ux-ink-2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ux-ease);
}

.followup-filter-pill:hover {
  background: var(--ux-surface-2);
  color: var(--ux-ink);
}

.followup-filter-pill.active {
  background: var(--ux-accent);
  color: #FFFFFF;
  border-color: var(--ux-accent);
}

.followup-search-wrap {
  position: relative;
  min-width: 240px;
}

.followup-search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ux-ink);
  outline: none;
}

.followup-search-input:focus {
  border-color: var(--ux-accent);
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.15);
}

.followup-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ux-ink-3);
  pointer-events: none;
}

/* Follow-up Table */
.followup-table-container {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
}

.followup-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.followup-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.followup-data-table th {
  background: var(--ux-surface-2);
  color: var(--ux-ink-2);
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--ux-line-2);
  white-space: nowrap;
}

.followup-data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ux-line);
  color: var(--ux-ink);
  white-space: nowrap;
}

.followup-data-table tr:hover td {
  background: rgba(31, 78, 121, 0.03);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.pill-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.status-badge.pill-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.status-badge.pill-success {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

/* Category Retention Cards Grid */
.category-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cat-insight-card {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s var(--ux-ease);
}

.cat-insight-card:hover {
  transform: translateY(-2px);
  border-color: var(--ux-line);
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ux-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-rate-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--ux-accent);
  background: var(--ux-surface-2);
  padding: 3px 8px;
  border-radius: 6px;
}

.cat-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.cat-stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ux-ink-2);
}

.cat-stat-line strong {
  color: var(--ux-ink);
}

.cat-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--ux-surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.cat-progress-fill {
  height: 100%;
  background: var(--ux-accent-2);
  border-radius: 3px;
}

/* Category Table View */
.cat-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ux-line-2);
  border-radius: 12px;
  background: var(--ux-surface);
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
  margin-top: 16px;
}

.cat-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.cat-data-table th {
  padding: 12px 16px;
  background: var(--ux-surface-2);
  color: var(--ux-ink);
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid var(--ux-line-2);
  white-space: nowrap;
}

.cat-data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s var(--ux-ease), background 0.15s var(--ux-ease);
}

.cat-data-table th.sortable:hover {
  background: color-mix(in srgb, var(--ux-accent) 10%, var(--ux-surface-2));
  color: var(--ux-accent);
}

.cat-sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.cat-data-table th.sortable:hover .cat-sort-icon,
.cat-data-table th.active-sort .cat-sort-icon {
  opacity: 1;
  color: var(--ux-accent);
}

.cat-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ux-line);
  color: var(--ux-ink-2);
}

.cat-data-table tr:hover td {
  background: var(--ux-surface-2);
  color: var(--ux-ink);
}

.cat-data-table td strong {
  color: var(--ux-ink);
}

.cat-table-bar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.cat-table-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--ux-surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.cat-table-bar-fill {
  height: 100%;
  background: var(--ux-accent-2);
  border-radius: 3px;
}

/* Pagination UI Component */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 4px 6px;
  margin-top: 14px;
  border-top: 1px solid var(--ux-line);
}

.pagination-info {
  font-size: 12.5px;
  color: var(--ux-ink-2);
  font-weight: 500;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--ux-line-2);
  background: var(--ux-surface);
  color: var(--ux-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ux-ease);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--ux-accent);
  background: var(--ux-surface-2);
  color: var(--ux-accent);
}

.pagination-btn.active {
  background: var(--ux-accent);
  color: #FFFFFF;
  border-color: var(--ux-accent);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.25);
}

.pagination-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--ux-ink-3);
  font-size: 12px;
}

.pagination-select {
  background: var(--ux-surface);
  color: var(--ux-ink);
  border: 1px solid var(--ux-line-2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.pagination-select:focus {
  border-color: var(--ux-accent);
}

/* ==========================================================================
   Executive Verdict & Strategic Insights Styling (Quiet Executive Design)
   ========================================================================== */
.verdict-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
  animation: fadeIn 0.25s var(--ux-ease);
}

/* 1. Quiet Hero */
.briefing-hero {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 2px 10px -2px var(--ux-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.briefing-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.briefing-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.briefing-tag.badge-good {
  background: color-mix(in srgb, var(--ux-ink) 8%, var(--ux-surface));
  color: #10B981;
  border: 1px solid color-mix(in srgb, #10B981 30%, transparent);
}

.briefing-tag.badge-average {
  background: color-mix(in srgb, var(--ux-ink) 8%, var(--ux-surface));
  color: #F59E0B;
  border: 1px solid color-mix(in srgb, #F59E0B 30%, transparent);
}

.briefing-tag.badge-attention {
  background: color-mix(in srgb, var(--ux-ink) 8%, var(--ux-surface));
  color: #EF4444;
  border: 1px solid color-mix(in srgb, #EF4444 30%, transparent);
}

.briefing-scope {
  font-size: 11.5px;
  color: var(--ux-ink-3);
}

.briefing-headline {
  font-size: 22px;
  font-weight: 700;
  color: var(--ux-ink);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.3;
}

.briefing-summary {
  font-size: 13.5px;
  color: var(--ux-ink-2);
  line-height: 1.6;
  margin: 0;
  max-width: 840px;
}

/* Simple Human Flow */
.briefing-flow {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--ux-line-2);
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.flow-label {
  font-size: 11px;
  color: var(--ux-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--ux-ink);
  letter-spacing: -0.02em;
}

.flow-val.text-accent {
  color: var(--ux-ink);
}

.flow-val.text-muted {
  color: var(--ux-ink-2);
}

.flow-sub {
  font-size: 11.5px;
  color: var(--ux-ink-3);
}

.flow-arrow {
  color: var(--ux-ink-3);
  opacity: 0.5;
  font-size: 14px;
}

/* 2. 4 Clean Cards */
.briefing-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.briefing-card {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.briefing-card-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ux-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.briefing-card-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ux-ink);
  line-height: 1.1;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}

.briefing-card-meta {
  font-size: 11.5px;
  color: var(--ux-ink-3);
  line-height: 1.35;
}

/* 3. Two Columns: Strengths vs Areas */
.briefing-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 860px) {
  .briefing-two-col {
    grid-template-columns: 1fr;
  }
}

.briefing-panel {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ux-line-2);
}

.panel-icon {
  font-size: 13px;
  font-weight: 700;
  color: var(--ux-ink-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ux-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-icon.icon-warn {
  color: #F59E0B;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ux-ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.point-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--ux-ink-2);
  line-height: 1.5;
}

.point-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--ux-ink-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.point-item strong {
  color: var(--ux-ink);
}

/* 4. Action Steps */
.briefing-actions {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ux-line-2);
}

.actions-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ux-ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.actions-subtitle {
  font-size: 12.5px;
  color: var(--ux-ink-3);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.action-card {
  background: var(--ux-surface-2);
  border: 1px solid var(--ux-line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.action-card.highlight {
  border-color: var(--ux-line-2);
  background: var(--ux-surface-2);
}

.action-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line-2);
  color: var(--ux-ink-2);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-body h5 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ux-ink);
  margin: 0;
}

.action-body p {
  font-size: 12px;
  color: var(--ux-ink-2);
  line-height: 1.5;
  margin: 0;
}

.btn-subtle {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ux-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-subtle:hover {
  text-decoration: underline;
}






