/* HMB Callcenter dashboard v2 — Vercel dark professional */

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

:root {
  --bg: #000;
  --surface: #0a0a0a;
  --surface-hover: #111;
  --border: #1a1a1a;
  --border-strong: #333;
  --text: #fafafa;
  --text-secondary: #888;
  --text-tertiary: #666;
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.12);
  --cyan: #22d3ee;
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --transition: all 0.15s ease;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── LAYOUT ────────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 10;
}
.sidebar-logo {
  padding: 4px 18px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-logo h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}
.sidebar-logo .subtitle {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
/* ─── Mode toggle (warm/cold) ───────────────────────── */
.mode-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 18px;
  margin-bottom: 8px;
}
.mode-btn {
  flex: 1;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.mode-btn:hover { color: var(--text); border-color: var(--border-strong); }
.mode-btn.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-secondary);
  font-weight: 500;
}
body.mode-cold .mode-btn[data-mode="cold"] { border-color: var(--blue); color: var(--blue); }
body.mode-cold .topbar { border-bottom-color: var(--blue-dim); }

.nav-group {
  padding: 8px 0;
}
.nav-group-label {
  padding: 0 18px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-left-color: var(--text);
  font-weight: 500;
}
.nav-item .icon { font-size: 14px; opacity: 0.75; }

.main { margin-left: 220px; flex: 1; min-width: 0; }

/* ─── TOPBAR ────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.topbar-title {
  display: flex; align-items: baseline; gap: 16px;
}
.topbar-title .page-name { font-weight: 600; color: var(--text); font-size: 14px; }
.topbar-title .datetime { color: var(--text-tertiary); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.refresh-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-tertiary);
}
.refresh-indicator .dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.refresh-indicator.paused .dot { background: var(--orange); animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: var(--transition);
}
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

/* ─── PAGE / CARDS ──────────────────────────────────────── */

.page { padding: 24px; display: none; }
.page.active { display: block; }

.page-grid { display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title { font-size: 13px; color: var(--text); font-weight: 500; }
.card-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.card-meta { font-size: 11px; color: var(--text-tertiary); }
.card-link { font-size: 11px; color: var(--text-secondary); }
.card-link:hover { color: var(--text); }

/* ─── METRIC NUMBERS ────────────────────────────────────── */

.metric-hero {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}
.metric-large {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}
.metric-medium {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}
.metric-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px;
  font-weight: 500;
}
.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }
.metric-delta.neutral { color: var(--text-tertiary); }
.metric-delta.warn { color: var(--orange); }

/* ─── STATUS PILL ───────────────────────────────────────── */

.status-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: var(--border);
}
.status-card.active { border-color: var(--green); }
.status-card.warn { border-color: var(--orange); }
.status-card.error { border-color: var(--red); }
.status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-dim);
}
.status-dot.orange { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-dim); }
.status-dot.red { background: var(--red); box-shadow: 0 0 0 4px var(--red-dim); }
.status-text { font-size: 22px; font-weight: 600; }
.status-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.status-detail .ok { color: var(--green); }
.status-detail .warn { color: var(--orange); }

/* ─── FUNNEL ────────────────────────────────────────────── */

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { }
.funnel-row-header {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-bottom: 4px;
}
.funnel-row-header .label { color: var(--text-secondary); }
.funnel-row-header .value { color: var(--text); }
.funnel-row-header .pct { color: var(--text-tertiary); font-size: 11px; margin-left: 4px; }
.funnel-row.final .funnel-row-header .label { color: var(--text); font-weight: 500; }
.funnel-row.final .funnel-row-header .value { color: var(--green); font-weight: 600; }
.funnel-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.funnel-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ─── ACTIVITY LIST ─────────────────────────────────────── */

.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px;
}
.activity-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot.green { background: var(--green); }
.activity-dot.gray { background: var(--text-tertiary); }
.activity-dot.red { background: var(--red); }
.activity-dot.orange { background: var(--orange); }
.activity-time {
  color: var(--text-tertiary);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  flex-shrink: 0;
  width: 38px;
}
.activity-text { color: var(--text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-text.highlight { color: var(--text); }

/* ─── ALERTS STRIP ──────────────────────────────────────── */

.alerts-row { display: flex; gap: 12px; flex-wrap: wrap; }
.alert-chip {
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
}
.alert-chip.ok { border-color: var(--border-strong); }
.alert-chip.warn { border-color: var(--orange); }
.alert-chip.error { border-color: var(--red); }
.alert-chip .ok { color: var(--green); }
.alert-chip .warn { color: var(--orange); }
.alert-chip .error { color: var(--red); }
.alert-chip .neutral { color: var(--text-secondary); }

/* ─── SPARKLINE ─────────────────────────────────────────── */

.sparkline { width: 100%; height: 56px; }
.sparkline-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-tertiary);
  margin-top: 4px;
}

/* ─── PLACEHOLDER (skeleton) ────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--border) 0%, var(--surface-hover) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: inline-block;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton.metric-hero-skel { width: 80px; height: 48px; }
.skeleton.metric-skel { width: 40px; height: 24px; }
.skeleton.line { width: 100%; height: 12px; }

/* ─── COMING SOON ──────────────────────────────────────── */

.coming-soon {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--text-tertiary);
}
.coming-soon h2 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.coming-soon p { font-size: 13px; }
.coming-soon .badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  margin-top: 12px;
}

/* ─── TOAST ────────────────────────────────────────────── */

#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  animation: slide-in 0.2s ease-out;
}
.toast.error { border-color: var(--red); }
.toast.warn { border-color: var(--orange); }
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── DATE-RANGE BUTTONS ───────────────────────────────── */

.date-range-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-date {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-date:hover { color: var(--text); border-color: var(--border-strong); }
.btn-date.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 500;
}
.date-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
}

/* ─── DATA TABLE ───────────────────────────────────────── */

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 8px 0;
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table th:not(:first-child) { text-align: right; }
.data-table td {
  padding: 10px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.data-table td:not(:first-child) { text-align: right; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .num-good { color: var(--green); }
.data-table .num-warn { color: var(--orange); }
.data-table .num-bad  { color: var(--red); }

/* ─── COSTS LEGEND ─────────────────────────────────────── */

.kosten-legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-secondary); flex-wrap: wrap; }
.kosten-legend-item { display: flex; align-items: center; gap: 6px; }
.kosten-legend-swatch { width: 8px; height: 8px; border-radius: 2px; }

/* ─── FILTER BAR ───────────────────────────────────────── */

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.filter-actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.select-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
  min-width: 110px;
}
.select-input:hover { border-color: var(--border-strong); }
.select-input:focus { outline: none; border-color: var(--text-secondary); }
input[type="checkbox"] { accent-color: var(--text-secondary); }

/* ─── TABLE EXTRAS ─────────────────────────────────────── */

.data-table { width: 100%; }
.data-table-clickable tbody tr { cursor: pointer; transition: var(--transition); }
.data-table-clickable tbody tr:hover { background: var(--surface-hover); }
.data-table thead {
  background: var(--surface);
  position: sticky;
  top: 0;
}
.data-table th { padding: 10px 14px; }
.data-table td { padding: 10px 14px; font-size: 13px; }
.data-table .arrow { color: var(--text-tertiary); font-size: 16px; }

/* Outcome pills */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
}
.pill.green   { color: var(--green);  border-color: var(--green); background: var(--green-dim); }
.pill.red     { color: var(--red);    border-color: var(--red);   background: var(--red-dim); }
.pill.orange  { color: var(--orange); border-color: var(--orange); background: var(--orange-dim); }
.pill.blue    { color: var(--blue);   border-color: var(--blue);  background: var(--blue-dim); }
.pill.purple  { color: var(--purple); border-color: var(--purple); background: var(--purple-dim); }

/* ─── MONTH-GRID KALENDER (agenda) ─────────────────────── */

.month-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.month-grid-header > div {
  padding: 8px 10px;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(96px, auto);
}
.month-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  overflow: hidden;
}
.month-cell:nth-child(7n) { border-right: none; }
.month-cell.other-month {
  background: rgba(255,255,255,0.01);
}
.month-cell.other-month .month-cell-num { color: var(--text-tertiary); opacity: 0.4; }
.month-cell.today { background: rgba(16,185,129,0.04); }
.month-cell.today .month-cell-num {
  background: var(--green);
  color: var(--bg);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-cell-num {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.appt-pill {
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.appt-pill:hover {
  background: var(--surface);
  border-color: var(--text-secondary);
  border-left-color: var(--green);
}
.appt-pill .appt-time {
  color: var(--text-tertiary);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  margin-right: 4px;
}

@media (max-width: 640px) {
  .month-grid { grid-auto-rows: minmax(64px, auto); }
  .month-cell { padding: 4px 6px; min-height: 64px; }
  .appt-pill { font-size: 10px; padding: 2px 4px; }
  .month-grid-header > div { padding: 6px 4px; font-size: 10px; }
}

/* ─── AGENDA DAYS ──────────────────────────────────────── */

.agenda-day { margin-bottom: 16px; }
.agenda-day-header {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
  padding: 0 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.agenda-day-header .count { font-size: 11px; color: var(--text-tertiary); }
.agenda-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-time { color: var(--text); font-weight: 500; font-family: ui-monospace, SFMono-Regular, monospace; }
.agenda-content { color: var(--text-secondary); min-width: 0; }
.agenda-content .name { color: var(--text); font-weight: 500; }
.agenda-content .ctx { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.agenda-link {
  color: var(--text-secondary);
  font-size: 11px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}
.agenda-link:hover { color: var(--text); border-color: var(--text-secondary); }
.agenda-empty {
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 14px;
  text-align: center;
}

/* ─── MODAL ────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
}

/* Modal detail-grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.detail-item .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.detail-item .value { font-size: 14px; color: var(--text); }

/* Audio player */
.audio-block { margin: 16px 0; }
.audio-block audio {
  width: 100%;
  height: 36px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  filter: invert(0.9) hue-rotate(180deg);
}

/* Transcript */
.transcript {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-hover);
  max-height: 320px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}
.transcript-turn { margin-bottom: 10px; }
.transcript-turn:last-child { margin-bottom: 0; }
.transcript-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.transcript-role.user      { color: var(--purple); }
.transcript-role.assistant { color: var(--green); }
.transcript-text { color: var(--text); }

/* Section heading binnen modal */
.modal-section-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ─── BANDIT-GRID ──────────────────────────────────────── */

.bandit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.bandit-arm {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.bandit-arm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.bandit-arm-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.bandit-arm-pct {
  font-size: 13px;
  font-weight: 600;
}
.bandit-arm-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bandit-arm-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
}
.bandit-arm-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ─── TOPIC LIST (inzichten) ───────────────────────────── */

.topic-list { display: flex; flex-direction: column; gap: 8px; }
.topic-row {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.topic-label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.topic-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}
.topic-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ─── BOT HEALTH KPI GRID ──────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.kpi-tile {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.kpi-tile .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.kpi-tile .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* Variant mix bars */
.variant-mix-row {
  display: flex;
  gap: 6px;
  font-size: 12px;
}
.variant-mix-row .seg {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

/* ─── SETTINGS ─────────────────────────────────────────── */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .label { color: var(--text-secondary); }
.settings-row .value { color: var(--text); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 22px;
  cursor: pointer;
  transition: var(--transition);
}
.switch-slider::before {
  position: absolute;
  content: '';
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: var(--transition);
}
.switch input:checked + .switch-slider { background: var(--green); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ─── RESPONSIVE (best-effort tablet + mobile) ──────────── */

/* Tables: min-width zodat ze niet pletten op mobile, card-met-tabel
   krijgt horizontale scroll. :has() selector wordt door alle moderne
   browsers ondersteund (Chrome 105+, Safari 15.4+, FF 121+). */
.data-table { min-width: 600px; }
.card:has(.data-table) { overflow-x: auto; }

@media (max-width: 960px) {
  .grid-2-1 { grid-template-columns: 1fr !important; }
  .grid-4col { grid-template-columns: repeat(2, 1fr) !important; }
  .topbar-title { gap: 8px; }
  .topbar-title .datetime { display: none; }  /* spaart ruimte */
  .filter-bar { gap: 10px; }
  .filter-bar .filter-group { flex: 1; min-width: 110px; }
}

@media (max-width: 640px) {
  .sidebar {
    width: 56px;
    transition: width 0.2s ease;
  }
  .sidebar-logo h1, .sidebar-logo .subtitle, .nav-group-label,
  .nav-item span:not(.icon) { display: none; }
  .sidebar:hover { width: 200px; }  /* expand on hover for navigatie */
  .sidebar:hover .sidebar-logo h1,
  .sidebar:hover .sidebar-logo .subtitle,
  .sidebar:hover .nav-group-label,
  .sidebar:hover .nav-item span:not(.icon) { display: inline; }
  .main { margin-left: 56px; }
  .grid-4col { grid-template-columns: 1fr !important; }
  .topbar { padding: 12px 14px; }
  .topbar-actions .btn-icon { padding: 6px 8px; font-size: 11px; }
  .page { padding: 14px; }
  .card { padding: 14px; }
  .metric-hero { font-size: 36px; }
  .modal { max-width: 100%; max-height: 95vh; }
  .modal-body { padding: 14px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .bandit-grid { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1fr 40px 50px; }
  .date-range-buttons { gap: 4px; }
  .btn-date { padding: 5px 8px; font-size: 11px; }
}
