/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-hover: #262a3a;
  --border: #2a2e3f;
  --text-primary: #e4e6f0;
  --text-secondary: #8b8fa3;
  --text-muted: #5c607a;

  --green: #22c55e;
  --blue: #3b82f6;
  --purple: #a855f7;
  --orange: #f97316;
  --red: #ef4444;
  --dark-red: #dc2626;
  --gray: #64748b;
  --yellow: #eab308;

  --radius: 8px;
  --radius-sm: 4px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Navigation ──────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--green);
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

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

.nav-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  display: inline-block;
  transition: background 0.3s;
}

.connection-dot.connected { background: var(--green); }
.connection-dot.disconnected { background: var(--red); }

/* ── Views ───────────────────────────────────── */
.view { display: none; padding: 24px; max-width: 1400px; margin: 0 auto; }
.view.active { display: block; }

/* ── Layout ──────────────────────────────────── */
.row { display: flex; gap: 16px; margin-bottom: 16px; }
.col-half { flex: 1; min-width: 0; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  gap: 16px;
}

/* ── Hero Status Panel ───────────────────────── */
.hero-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.hero-left { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }

.status-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid var(--gray);
  flex-shrink: 0;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gray);
  animation: pulse 2s infinite;
}

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

.status-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Status color states */
.status-in-meeting .status-badge { background: rgba(34, 197, 94, 0.12); border-color: var(--green); }
.status-in-meeting .status-dot { background: var(--green); }
.status-in-meeting .status-text { color: var(--green); }

.status-joining .status-badge { background: rgba(59, 130, 246, 0.12); border-color: var(--blue); }
.status-joining .status-dot { background: var(--blue); }
.status-joining .status-text { color: var(--blue); }

.status-waiting-room .status-badge { background: rgba(168, 85, 247, 0.12); border-color: var(--purple); }
.status-waiting-room .status-dot { background: var(--purple); }
.status-waiting-room .status-text { color: var(--purple); }

.status-reconnecting .status-badge { background: rgba(249, 115, 22, 0.12); border-color: var(--orange); }
.status-reconnecting .status-dot { background: var(--orange); }
.status-reconnecting .status-text { color: var(--orange); }

.status-browser-down .status-badge { background: rgba(239, 68, 68, 0.12); border-color: var(--red); }
.status-browser-down .status-dot { background: var(--red); }
.status-browser-down .status-text { color: var(--red); }

.status-off-hours .status-badge { background: rgba(100, 116, 139, 0.12); border-color: var(--gray); }
.status-off-hours .status-dot { background: var(--gray); animation: none; }
.status-off-hours .status-text { color: var(--gray); }

.status-fatal .status-badge { background: rgba(220, 38, 38, 0.12); border-color: var(--dark-red); }
.status-fatal .status-dot { background: var(--dark-red); }
.status-fatal .status-text { color: var(--dark-red); }

.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  flex: 1;
}

.hero-detail {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* ── Stat Cards ──────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  flex: 1;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Schedule Timeline ───────────────────────── */
.schedule-bar {
  display: flex;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.schedule-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.schedule-segment span { font-size: 11px; }
.schedule-segment small { font-size: 9px; opacity: 0.7; font-weight: 400; }

.schedule-segment.off { background: rgba(100, 116, 139, 0.2); color: var(--gray); }
.schedule-segment.normal { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.schedule-segment.peak { background: rgba(59, 130, 246, 0.25); color: var(--blue); }

.schedule-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  transition: left 1s ease;
}

.marker-line {
  width: 2px;
  height: 100%;
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
}

.marker-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}

/* ── Feed Lists ──────────────────────────────── */
.feed-list {
  max-height: 300px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}

.feed-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.feed-company {
  font-size: 12px;
  color: var(--text-secondary);
}

.feed-status {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.feed-status.enriched { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.feed-status.enriching { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.feed-status.no-match { background: rgba(100, 116, 139, 0.15); color: var(--gray); }
.feed-status.error { background: rgba(239, 68, 68, 0.15); color: var(--red); }

.feed-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.feed-healthy { color: var(--green); }

.error-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.error-category {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  align-self: flex-start;
}

.error-category.RECOVERABLE { background: rgba(249, 115, 22, 0.15); color: var(--orange); }
.error-category.BROWSER_CRASH { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.error-category.FATAL { background: rgba(220, 38, 38, 0.15); color: var(--dark-red); }

.error-message {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
  flex: 1;
}

/* ── Toolbar ─────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.input-dark {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.input-dark:focus { border-color: var(--blue); }

.btn-dark {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-dark:hover { background: var(--bg-hover); }

/* ── Data Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; }

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

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.data-table th:hover { color: var(--text-primary); }
.data-table th.sorted-asc::after { content: ' \u25b2'; font-size: 9px; }
.data-table th.sorted-desc::after { content: ' \u25bc'; font-size: 9px; }

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.data-table tr:hover td { background: var(--bg-hover); }
.data-table tr.new-row td { animation: fadeIn 0.5s ease; }

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

.table-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
}
.table-link:hover { text-decoration: underline; }

/* ── State Machine ───────────────────────────── */
.state-machine {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0;
}

.state-node {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: all 0.3s;
}

.state-node.active-state {
  color: var(--text-primary);
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.state-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

/* ── Health Gauges ───────────────────────────── */
.gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gauge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.gauge-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.gauge-value {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
}

.gauge-green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.gauge-yellow { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.gauge-red { background: rgba(239, 68, 68, 0.15); color: var(--red); }

/* ── Log Viewer ──────────────────────────────── */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.log-header .card-title { margin-bottom: 0; }

.log-filters {
  display: flex;
  gap: 4px;
}

.log-filter {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.log-filter:hover { color: var(--text-secondary); }
.log-filter.active { background: var(--bg-hover); color: var(--text-primary); border-color: var(--blue); }

.log-viewer {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-line { white-space: pre-wrap; word-break: break-all; }
.log-line.INFO { color: var(--text-secondary); }
.log-line.WARN { color: var(--orange); }
.log-line.ERROR { color: var(--red); }
.log-line.DEBUG { color: var(--text-muted); }
.log-loading { color: var(--text-muted); text-align: center; padding: 20px; }

/* ── Charts ──────────────────────────────────── */
.chart-container {
  position: relative;
  height: 280px;
}

/* ── Range Picker ────────────────────────────── */
.range-picker {
  display: flex;
  gap: 4px;
}

.range-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.range-btn:hover { background: var(--bg-hover); }
.range-btn.active { background: var(--bg-card); color: var(--text-primary); border-color: var(--blue); }

/* ── Analytics Summary ───────────────────────── */
.analytics-summary { margin-bottom: 16px; }

/* ── Freshness ───────────────────────────────── */
.freshness-green { color: var(--green); }
.freshness-yellow { color: var(--yellow); }
.freshness-red { color: var(--red); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .row { flex-direction: column; }
  .card-row { flex-direction: column; }
  .nav { flex-wrap: wrap; gap: 12px; }
  .nav-tabs { order: 3; width: 100%; overflow-x: auto; }
  .hero-details { gap: 12px 24px; }
  .gauges { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .view { padding: 12px; }
  .hero-panel { padding: 16px; }
  .stat-value { font-size: 28px; }
  .toolbar { flex-direction: column; }
  .toolbar .input-dark, .toolbar .btn-dark { width: 100%; }
}

/* ── Avatar Thumbnails ───────────────────────── */
/* Wrapper shows initials via ::before; image covers them when loaded.
   On image error, JS removes the <img> and initials show through. */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  vertical-align: middle;
  position: relative;
  flex-shrink: 0;
}

.avatar::before { content: attr(data-initials); }

.avatar.table-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Classification Badges ───────────────────── */
.classification-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.classification-badge.prospect { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.classification-badge.internal { background: rgba(100, 116, 139, 0.15); color: var(--gray); }
.classification-badge.staff { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.classification-badge.bot { background: rgba(249, 115, 22, 0.15); color: var(--orange); }

.classification-badge.clickable { cursor: pointer; transition: all 0.15s; }
.classification-badge.clickable:hover { filter: brightness(1.3); transform: scale(1.05); }

/* ── Feed classification indicators ─────────── */
.feed-item.feed-internal,
.feed-item.feed-staff,
.feed-item.feed-bot { opacity: 0.55; transition: opacity 0.2s; }
.feed-item.feed-internal:hover,
.feed-item.feed-staff:hover,
.feed-item.feed-bot:hover { opacity: 0.85; }

.classification-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gray);
}

.classification-dot.prospect { background: var(--green); }
.classification-dot.internal { background: var(--gray); }
.classification-dot.staff { background: #3b82f6; }
.classification-dot.bot { background: var(--orange); }

/* ── Stat Toggle ────────────────────────────── */
.stat-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s;
}

.stat-toggle:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.stat-toggle.active { background: var(--bg-hover); color: var(--text-primary); border-color: var(--blue); }

/* ── Analytics Classification Toggle ─────────── */
.classification-toggle {
  display: inline-flex;
  gap: 4px;
  margin-left: 12px;
}

.classification-toggle .btn-dark {
  padding: 6px 14px;
  font-size: 12px;
}

.classification-toggle .btn-dark.active {
  background: var(--bg-hover);
  border-color: var(--blue);
  color: var(--text-primary);
}

/* ── Live Session Card ───────────────────────── */
.live-session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.live-session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.live-session-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.live-session-label {
  font-size: 11px;
  color: var(--green);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.live-session-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.live-session-duration {
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

/* ── Cooldown Card ───────────────────────────── */
.cooldown-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.cooldown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 3s infinite;
  flex-shrink: 0;
}

.cooldown-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cooldown-label {
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cooldown-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.cooldown-timer {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

/* ── Session Range Buttons ───────────────────── */
.session-range-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.session-range-btn:hover { background: var(--bg-hover); }
.session-range-btn.active { background: var(--bg-card); color: var(--text-primary); border-color: var(--blue); }

/* ── Disconnect Reason Badge ─────────────────── */
.reason-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.reason-badge.kicked { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.reason-badge.browser_crash { background: rgba(249, 115, 22, 0.15); color: var(--orange); }
.reason-badge.shutdown { background: rgba(100, 116, 139, 0.15); color: var(--gray); }
.reason-badge.disconnected { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.reason-badge.stale_on_startup { background: rgba(100, 116, 139, 0.15); color: var(--gray); }
.reason-badge.isolated { background: rgba(168, 85, 247, 0.15); color: var(--purple); }

/* ── Chat Indicator ─────────────────────────── */
.chat-indicator {
  cursor: default;
  white-space: pre-line;
  font-size: 13px;
  color: var(--blue);
}

/* ── Source Badges ───────────────────────────── */
.source-cell { white-space: nowrap; }
.source-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.source-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.source-cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.source-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.source-yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.source-orange { background: rgba(249, 115, 22, 0.15); color: var(--orange); }

/* ── Decision Pills ─────────────────────────── */
.decision-cell { white-space: nowrap; }
.decision-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 2px;
  cursor: default;
  position: relative;
}

.decision-pass { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.decision-reject { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.decision-warn { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.decision-skip { background: rgba(100, 116, 139, 0.2); color: var(--gray); }

.decision-pill:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.text-muted { color: var(--text-muted); font-size: 12px; }

/* ── Enrichment Pipeline Health ──────────────── */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header-row .card-title { margin-bottom: 0; }

.btn-sm {
  padding: 4px 12px;
  font-size: 11px;
}

/* Service Indicators */
.service-indicators {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.service-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gray);
  flex-shrink: 0;
}

.indicator-dot.indicator-green { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.indicator-dot.indicator-yellow { background: var(--yellow); }
.indicator-dot.indicator-red { background: var(--red); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); animation: pulse 1.5s infinite; }

.indicator-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.indicator-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.indicator-detail {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.indicator-stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.indicator-stat {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.indicator-stat.green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.indicator-stat.red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.indicator-stat.orange { background: rgba(249, 115, 22, 0.15); color: var(--orange); }

/* Pipeline Funnel */
.pipeline-funnel {
  margin-bottom: 20px;
}

.funnel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.funnel-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.funnel-track {
  flex: 1;
  height: 14px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 0;
}

.funnel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Enrichment Rate */
.enrichment-rate {
  display: flex;
  gap: 16px;
}

.rate-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rate-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.rate-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .service-indicators { grid-template-columns: 1fr; }
  .enrichment-rate { flex-direction: column; }
}

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
