.reports-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Section grouping ─────────────────────────────────────── */

.reports-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reports-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.reports-section-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}

.reports-section-icon.accent { background: var(--accent); }
.reports-section-icon.warm   { background: var(--accent-warm); }
.reports-section-icon.sky    { background: var(--accent-sky); }
.reports-section-icon.gold   { background: var(--accent-gold); }

.reports-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.reports-section-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reports-title h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.reports-title p {
  margin: 0;
  color: var(--muted);
  /* Zonder bovengrens duwt een lange lede de datumvelden en de knop naar de
     volgende regel, want .reports-filters wrapt. Geldt voor alle rapportkoppen. */
  max-width: 60ch;
}

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

.reports-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.reports-date label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

/* ── KPI kaarten ────────────────────────────────────────────── */

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

.report-kpi {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px 18px 14px;
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-kpis .report-kpi:nth-child(4n+1) { border-top-color: var(--accent); }
.report-kpis .report-kpi:nth-child(4n+2) { border-top-color: var(--accent-warm); }
.report-kpis .report-kpi:nth-child(4n+3) { border-top-color: var(--accent-sky); }
.report-kpis .report-kpi:nth-child(4n+4) { border-top-color: var(--accent-gold); }

.report-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.report-kpi-value {
  font-size: 30px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.report-kpi-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  flex: 1;
}

.report-kpi-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.report-drill-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-ghost);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.report-drill-link:hover {
  background: var(--accent-ghost-strong);
  color: var(--accent);
}

.report-charts {
  margin-top: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 0;
}

.report-card-wide {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

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

.report-card-header > strong {
  font-size: 13px;
  font-weight: 700;
}

.report-pill {
  background: var(--accent-ghost-strong);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.report-chart-host {
  width: 100%;
}

/* ApexCharts in Sarrai-stijl. As-teksten, raster, tooltip, gradient-vulling en
   lijn-stroke volgen de merk-tokens; die flippen automatisch mee met [data-theme]. */
.report-chart-host .apexcharts-text,
.report-chart-host .apexcharts-xaxis-label,
.report-chart-host .apexcharts-yaxis-label {
  fill: var(--muted) !important;
  font-family: var(--font-sans);
}

.report-chart-host .apexcharts-gridline {
  stroke: var(--border) !important;
}

/* Gradient-stops + lijn volgen --accent (navy in light, lichter navy in dark)
   zodat de vulling en lijn leesbaar blijven op de donkere kaart. */
.report-chart-host stop {
  stop-color: var(--accent) !important;
}

.report-chart-host .apexcharts-area-series path[fill="none"] {
  stroke: var(--accent) !important;
}

.report-chart-host .apexcharts-tooltip.apexcharts-theme-light {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-soft) !important;
}

.report-chart-host .apexcharts-tooltip-title {
  background: var(--bg-elevated) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-sans);
}

.report-empty-state {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--accent-ghost);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.report-table,
.report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-ghost);
}

.report-row-link {
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.report-row-link:hover {
  background: var(--accent-ghost-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.report-row.compact {
  padding: 8px 10px;
}

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

.report-value {
  font-weight: 700;
}

.report-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-chat-row {
  display: flex;
}

.report-chat-row.user {
  justify-content: flex-end;
}

.report-chat-row.assistant {
  justify-content: flex-start;
}

.report-chat-bubble {
  max-width: min(84%, 760px);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 9px 11px;
  box-shadow: 0 2px 6px color-mix(in oklab, var(--text) 7%, transparent);
}

.report-chat-bubble.user {
  background: color-mix(in oklab, var(--accent) 14%, white);
  border-color: color-mix(in oklab, var(--accent) 26%, var(--border));
}

.report-chat-bubble.assistant {
  background: color-mix(in oklab, var(--accent-sky) 12%, white);
  border-color: color-mix(in oklab, var(--accent-sky) 22%, var(--border));
}

.report-chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

.report-chat-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.report-chat-focus-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.report-chat-focus-label.question {
  color: #7b5a12;
  background: #fff7e8;
  border: 1px solid #ead2a2;
}

.report-chat-focus-label.answer {
  color: #b34848;
  background: #fdf3f3;
  border: 1px solid #e2b6b6;
}

.report-chat-bubble.flagged-question {
  border-color: #dec183;
  box-shadow: 0 0 0 1px #f6e6c6;
}

.report-chat-bubble.flagged-answer {
  border-color: #dca1a1;
  box-shadow: 0 0 0 1px #f6dede;
}

.report-chat-feedback-badge {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.report-chat-feedback-badge.negative {
  color: #b34848;
  background: #fdf3f3;
  border: 1px solid #e2b6b6;
}

.report-chat-feedback-badge.positive {
  color: #2e8b57;
  background: #f1f9f4;
  border: 1px solid #9cc8af;
}

.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform 160ms ease, box-shadow 160ms ease;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-mid);
  position: relative;
  overflow: hidden;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
  background: linear-gradient(0deg, var(--accent-ghost), var(--accent-ghost)), var(--card);
}

.report-card-disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.report-card-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-mid);
  background: var(--card);
}

.report-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 43, 72, 0.48);
  display: grid;
  place-items: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(2px);
}

.report-overlay-upgrade {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}

.report-upgrade-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px;
}

.report-upgrade-message {
  line-height: 1.35;
}

.report-upgrade-action {
  font-weight: 600;
}

.report-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
}

.report-icon.accent { background: var(--accent); }
.report-icon.warm { background: var(--accent-warm); }
.report-icon.sky { background: var(--accent-sky); }
.report-icon.gold { background: var(--accent-gold); }

.report-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-meta strong {
  font-size: 14px;
}

.report-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-author {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-link {
  margin-left: auto;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  text-decoration: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}

.report-drill-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(37, 43, 72, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: modalFadeIn 180ms ease;
}

.report-drill-modal {
  width: min(980px, 100%);
  max-height: min(85vh, 860px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-float), 0 4px 16px rgba(37, 43, 72, 0.14);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: modalSlideIn 240ms cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}

.report-drill-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm, var(--accent)));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

.report-drill-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px 14px;
}

.report-drill-header-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 5px;
}

.report-drill-header-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.report-drill-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.report-drill-header p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}


.report-drill-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-ghost);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  white-space: nowrap;
}

.report-drill-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-drill-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
}

.report-drill-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

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

.report-drill-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--accent-ghost);
  transition: background 140ms ease, border-color 140ms ease;
}

.report-drill-row:hover {
  background: var(--accent-ghost-strong);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.report-drill-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.report-drill-main strong {
  overflow-wrap: anywhere;
}

.report-drill-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 170px;
  text-align: right;
}

.report-drill-skel {
  background: var(--border);
  border-radius: 4px;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

.report-drill-title-skel {
  height: 16px;
  width: 52%;
}

.report-drill-desc-skel {
  height: 12px;
  width: 68%;
}

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

.report-card {
  border-radius: var(--radius-lg);
}

.report-icon {
  border-radius: var(--radius-md);
}

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

@media (max-width: 768px) {
  .reports-page {
    gap: 20px;
  }

  .reports-section-header {
    gap: 10px;
  }

  .reports-section-title {
    font-size: 14px;
  }

  .reports-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .reports-title h1 {
    margin: 0 0 4px;
    font-size: 24px;
  }

  .reports-title p {
    font-size: 14px;
    line-height: 1.35;
  }

  .reports-filters {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
  }

  .reports-date {
    width: min(200px, 100%);
  }

  .reports-date label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .reports-date .form-control {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 13px;
  }

  .reports-filters .btn {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.2;
  }

  .reports-filters .btn-with-icon {
    gap: 5px;
  }

  .report-drill-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-drill-meta {
    width: 100%;
    min-width: 0;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 460px) {
  .reports-title h1 {
    font-size: 22px;
  }

  .reports-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .reports-date {
    width: 100%;
  }

  .reports-filters .btn {
    width: 100%;
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
  }
}

[data-theme="dark"] .report-chat-bubble.user {
  background: var(--accent-ghost-strong);
  border-color: var(--accent-strong);
}

[data-theme="dark"] .report-chat-bubble.assistant {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .report-chat-focus-label.question {
  color: var(--brand-orange-300);
  background: rgba(235, 120, 14, 0.12);
  border-color: rgba(235, 120, 14, 0.28);
}

[data-theme="dark"] .report-chat-focus-label.answer {
  color: #e88080;
  background: rgba(180, 35, 24, 0.12);
  border-color: rgba(180, 35, 24, 0.28);
}

[data-theme="dark"] .report-chat-bubble.flagged-question {
  border-color: rgba(235, 120, 14, 0.45);
  box-shadow: 0 0 0 1px rgba(235, 120, 14, 0.18);
}

[data-theme="dark"] .report-chat-bubble.flagged-answer {
  border-color: rgba(232, 128, 128, 0.45);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.18);
}

[data-theme="dark"] .report-chat-feedback-badge.negative {
  color: #e88080;
  background: rgba(180, 35, 24, 0.12);
  border-color: rgba(180, 35, 24, 0.28);
}

[data-theme="dark"] .report-chat-feedback-badge.positive {
  color: var(--action);
  background: var(--action-ghost);
  border-color: rgba(52, 199, 138, 0.30);
}

/* ── Gebroken links ──────────────────────────────────────────── */

.bl-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--action-ghost, var(--accent-ghost));
  border: 1px solid color-mix(in srgb, var(--action, var(--accent)) 26%, transparent);
  color: var(--text);
  font-size: 14px;
}

.bl-empty i {
  font-size: 18px;
  color: var(--action, var(--accent));
}

/* Toolbar: taal-tabjes links, her-scan-knop rechts. */
.bl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bl-toolbar__spacer {
  flex: 1;
}

.bl-langtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bl-langtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.bl-langtab:hover {
  border-color: var(--border-strong, var(--accent-strong));
  color: var(--text);
}

.bl-langtab.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--text);
  background: var(--accent-ghost);
}

.bl-langtab__code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bl-langtab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-ghost-strong);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.bl-langtab.is-active .bl-langtab__count {
  background: var(--accent);
  color: #fff;
}

.bl-rescan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 140ms ease, opacity 140ms ease;
}

.bl-rescan:hover:not(:disabled) {
  filter: brightness(1.06);
}

.bl-rescan:disabled {
  opacity: 0.65;
  cursor: default;
}

.bl-rescan i {
  font-size: 14px;
}

.bl-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.bl-panel__empty {
  padding: 22px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.bl-table-scroll {
  overflow-x: auto;
}

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

.bl-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bl-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.bl-table tbody tr:last-child td {
  border-bottom: 0;
}

.bl-table tbody tr:hover {
  background: var(--accent-ghost);
}

.bl-source {
  min-width: 160px;
}

.bl-source__title {
  font-weight: 600;
  color: var(--text);
}

.bl-source__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.bl-source__sep {
  font-size: 8px;
  color: var(--border-strong, var(--muted));
}

.bl-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--text);
}

.bl-type i {
  font-size: 13px;
  color: var(--muted);
}

.bl-ref {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-width: 320px;
}

.bl-ref__anchor {
  font-size: 12px;
  color: var(--text);
  background: var(--accent-ghost);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  overflow-wrap: anywhere;
}

.bl-ref__url {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.bl-ref__url:hover {
  color: var(--accent);
  text-decoration: underline;
}

.bl-reason {
  color: var(--text);
  white-space: nowrap;
}

.bl-table__actions {
  text-align: right;
  white-space: nowrap;
}

.bl-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong, var(--border));
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.bl-open:hover {
  background: var(--accent-ghost);
  border-color: var(--accent-strong);
  color: var(--accent);
}

.bl-open i {
  font-size: 12px;
}

@media (max-width: 720px) {
  .bl-toolbar {
    align-items: stretch;
  }

  .bl-rescan {
    justify-content: center;
  }

  .bl-ref {
    max-width: none;
  }

  .bl-open span {
    display: none;
  }

  .bl-open {
    padding: 6px 9px;
  }
}

/* ── Kennishiaten (Phase 3) ──────────────────────────────────────────── */

.kg-empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  color: var(--muted);
}

.kg-empty h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.kg-empty p {
  margin: 0;
  font-size: 13px;
}

.kg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  box-shadow: var(--shadow-mid);
}

.kg-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: linear-gradient(0deg, var(--accent-ghost), var(--accent-ghost)), var(--card);
}

.kg-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ghost-strong);
}

.kg-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-ghost);
  color: var(--accent);
  font-size: 18px;
}

.kg-card__main strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text);
}

.kg-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.kg-card__metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kg-card__metrics i {
  font-size: 12px;
}

.kg-card__state .badge {
  font-size: 11px;
  padding: 5px 9px;
}

.kg-card__state a.badge {
  text-decoration: none;
}

.kg-detail {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-mid);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kg-detail__header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.kg-detail__header p {
  margin: 0;
  font-size: 13px;
}

.kg-detail__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.kg-metric {
  background: var(--accent-ghost);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kg-metric strong {
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.kg-metric span {
  font-size: 12px;
  color: var(--muted);
}

.kg-detail__examples h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.kg-detail__examples ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kg-detail__examples li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.kg-freq {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 36px;
}

.kg-detail__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 16px;
}

/* ── Lichtgewicht editor (modal) ────────────────────────── */

.kg-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 19, 41, 0.55);
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.kg-editor {
  background: var(--card);
  border-radius: 16px;
  width: min(720px, 100%);
  padding: 22px 24px;
  box-shadow: var(--shadow-float, var(--shadow-mid));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kg-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kg-editor__header h3 {
  margin: 0;
  font-size: 18px;
}

.kg-editor__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .kg-card {
    grid-template-columns: 32px 1fr;
  }

  .kg-card__state {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }
}

/* ── Gesprekstaxonomie: kruistabel ──────────────────────────────────────────
   .report-table is een flexlijst van twee kolommen en dus geen kruistabel. Dit
   is een echt <table>, met een sticky eerste kolom zodat de domeinnaam blijft
   staan terwijl je horizontaal scrolt. */

.report-matrix-scroll {
  overflow-x: auto;
  /* Ruimte voor de focusring van de celknoppen, anders knipt de scrollbox hem af. */
  padding: 2px;
  margin: -2px;
}

.report-matrix {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.report-matrix th,
.report-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.report-matrix thead th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}

.report-matrix th.report-matrix-topic,
.report-matrix td.report-matrix-topic {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--card);
  min-width: 200px;
  max-width: 280px;
  white-space: normal;
  /* Randje in plaats van een schaduw: de sticky kolom moet los lezen van wat
     eronder doorschuift. */
  box-shadow: 1px 0 0 var(--border);
}

.report-matrix tbody tr:hover td {
  background: var(--accent-ghost);
}

.report-matrix tbody tr:hover td.report-matrix-topic {
  background: var(--accent-ghost);
}

.report-matrix-name {
  font-weight: 600;
}

.report-matrix-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.report-matrix-zero {
  color: var(--muted);
}

.report-matrix-total,
.report-matrix thead th.report-matrix-total {
  font-weight: 700;
  background: var(--accent-ghost);
}

.report-matrix tfoot td {
  font-weight: 700;
  border-top: 1px solid var(--border-strong);
  border-bottom: none;
  background: var(--accent-ghost);
}

.report-matrix tfoot td.report-matrix-topic {
  background: var(--accent-ghost);
}

.report-matrix tr.report-matrix-unassigned td {
  background: var(--bg-elevated);
}

.report-matrix tr.report-matrix-unassigned td.report-matrix-topic {
  background: var(--bg-elevated);
}

.report-matrix-cta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}

/* De celknop houdt de klasse van de bestaande drill-ins, maar wordt hier een
   getal in plaats van een pil met tekst. */
.report-matrix-link {
  min-width: 42px;
  justify-content: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
}

/* ── Gesprekstaxonomie: KPI-strook, tabbladen en trendfilter ────────────────
   De cijfers zitten in de gewone .report-kpis-strook, zoals op elke andere
   datumgefilterde rapportpagina. Deze klassen dragen enkel wat daar niet in
   past: de twee voetnoten eronder, de tab-strip en het filter in de trendkaart.
   Elk blok zet zijn eigen marge, zodat de razor geen mt-3 of mb-3 nodig heeft. */

.report-topics-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-topics-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-topics-notes p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Zesde kopie van de tab-strip in de admin; overgenomen van .crm-tabs, inclusief
   de focus-visible-regel die de andere varianten missen. */
.report-tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.report-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.report-tab:hover {
  color: var(--text);
}

.report-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.report-tab.is-active {
  background: var(--accent-ghost-strong);
  color: var(--accent);
}

/* Eigen klasse in plaats van .reports-date: die hoort in de paginakop en werd
   hier alleen geleend voor de labelstijl. */
.report-topics-trend-filter {
  max-width: 320px;
  margin-bottom: 16px;
}

.report-topics-trend-filter label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.report-topics-trend-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── Gesprekstaxonomie: gestapelde grafiek ──────────────────────────────────
   Eigen hostklasse, want .report-chart-host dwingt via
   "stop { stop-color: var(--accent) !important; }" elke reeks naar dezelfde
   navy. Hier koppelen we alleen as-teksten, raster en tooltip aan de tokens en
   laten we de reekskleuren met rust.

   Het palet is gevalideerd op lichtheid, chroma, kleurenblindheid-scheiding en
   contrast, tegen zowel de lichte (#FFFFFF) als de donkere (#232748) kaart. Het
   contrast van de lichtere stappen blijft onder 3:1; de kruistabel erboven en de
   legende met aantallen eronder zijn de vereiste tegenlezing. */

.report-chart-host-stacked {
  width: 100%;
  --viz-topic-1: #2A78D6;
  --viz-topic-2: #EB6834;
  --viz-topic-3: #1BAF7A;
  --viz-topic-4: #EDA100;
  --viz-topic-5: #E87BA4;
  --viz-topic-6: #008300;
}

[data-theme="dark"] .report-chart-host-stacked,
[data-theme="dark"] .report-stacked-legend {
  --viz-topic-1: #3987E5;
  --viz-topic-2: #D95926;
  --viz-topic-3: #199E70;
  --viz-topic-4: #C98500;
  --viz-topic-5: #D55181;
  --viz-topic-6: #008300;
}

.report-chart-host-stacked .apexcharts-text,
.report-chart-host-stacked .apexcharts-xaxis-label,
.report-chart-host-stacked .apexcharts-yaxis-label {
  fill: var(--muted) !important;
  font-family: var(--font-sans);
}

.report-chart-host-stacked .apexcharts-gridline {
  stroke: var(--border) !important;
}

.report-chart-host-stacked .apexcharts-tooltip.apexcharts-theme-light {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-soft) !important;
}

.report-chart-host-stacked .apexcharts-tooltip-title {
  background: var(--bg-elevated) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-sans);
}

/* Twee pixels kaartkleur tussen de segmenten, zodat aangrenzende blokken los
   lezen ook wanneer hun kleuren dicht bij elkaar liggen. */
.report-chart-host-stacked .apexcharts-bar-area {
  stroke: var(--card) !important;
  stroke-width: 2 !important;
}

.report-chart-host-stacked .apexcharts-series[rel="1"] .apexcharts-bar-area { fill: var(--viz-topic-1) !important; }
.report-chart-host-stacked .apexcharts-series[rel="2"] .apexcharts-bar-area { fill: var(--viz-topic-2) !important; }
.report-chart-host-stacked .apexcharts-series[rel="3"] .apexcharts-bar-area { fill: var(--viz-topic-3) !important; }
.report-chart-host-stacked .apexcharts-series[rel="4"] .apexcharts-bar-area { fill: var(--viz-topic-4) !important; }
.report-chart-host-stacked .apexcharts-series[rel="5"] .apexcharts-bar-area { fill: var(--viz-topic-5) !important; }
.report-chart-host-stacked .apexcharts-series[rel="6"] .apexcharts-bar-area { fill: var(--viz-topic-6) !important; }

/* Eigen legende: de markers van ApexCharts krijgen een inline achtergrondkleur
   die niet met het thema meebeweegt. Het aantal per intent staat erbij, zodat de
   grafiek ook zonder kleur te lezen valt. */
.report-stacked-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  --viz-topic-1: #2A78D6;
  --viz-topic-2: #EB6834;
  --viz-topic-3: #1BAF7A;
  --viz-topic-4: #EDA100;
  --viz-topic-5: #E87BA4;
  --viz-topic-6: #008300;
}

.report-stacked-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.report-stacked-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.report-stacked-swatch[data-series="1"] { background: var(--viz-topic-1); }
.report-stacked-swatch[data-series="2"] { background: var(--viz-topic-2); }
.report-stacked-swatch[data-series="3"] { background: var(--viz-topic-3); }
.report-stacked-swatch[data-series="4"] { background: var(--viz-topic-4); }
.report-stacked-swatch[data-series="5"] { background: var(--viz-topic-5); }
.report-stacked-swatch[data-series="6"] { background: var(--viz-topic-6); }

.report-stacked-legend-value {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .report-matrix th.report-matrix-topic,
  .report-matrix td.report-matrix-topic {
    min-width: 150px;
  }
}
