:root {
  --black:     #0a0a0a;
  --white:     #ffffff;
  --green:     #2af065;
  --grey-bg:   #f5f5f5;
  --grey-mid:  #e8e8e8;
  --grey-text: #666666;
}

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

body {
  font-family: 'Archivo', sans-serif;
  background: var(--grey-bg);
  color: var(--black);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 290px;
  height: 100vh;
  background: var(--black);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.sidebar-nav { flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-icon { opacity: 0.5; }

.section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.28);
  margin-bottom: 4px;
  margin-top: 6px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 18px 0;
}

.sidebar-select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--white);
  font-family: 'Archivo', sans-serif;
  font-size: 12.5px;
  padding: 8px 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.sidebar-select:focus { outline: none; border-color: var(--green); }
.sidebar-select option { background: #1a1a1a; color: var(--white); }

.sidebar-footer {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0; left: 290px; right: 0;
  height: 54px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.mode-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-text);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 4px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Archivo', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-btn:hover { background: var(--grey-bg); color: var(--black); }
.mode-btn.active { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── Status indicator ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grey-mid);
  flex-shrink: 0;
}

.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(42,240,101,0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(42,240,101,0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(42,240,101,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,240,101,0); }
}

.status-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--grey-text);
}

/* ── Main content area ── */
.main-content {
  margin-left: 290px;
  margin-top: 54px;
  padding: 40px;
  min-height: calc(100vh - 54px);
}

.workspace {
  max-width: 720px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--green);
  color: var(--black);
  border: none;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { font-size: 12px; padding: 7px 14px; }
.btn-md { font-size: 13px; padding: 10px 20px; }
.btn-lg { font-size: 14px; padding: 12px 24px; }

.btn-ghost {
  background: transparent;
  color: var(--grey-text);
  border: 1.5px solid var(--grey-mid);
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover { border-color: var(--black); color: var(--black); }

.btn-danger {
  background: #ff4444;
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-danger:hover { opacity: 0.85; }

/* ── Badge / pill ── */
.badge-pill {
  display: inline-block;
  background: var(--green);
  color: var(--black);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
}

.badge-pill.grey {
  background: var(--grey-mid);
  color: var(--grey-text);
}

/* ── Icons ── */
.icon { width: 14px; height: 14px; vertical-align: middle; stroke-width: 2; }
.icon-lg { width: 18px; height: 18px; stroke-width: 2; }
.icon-xl { width: 22px; height: 22px; stroke-width: 1.5; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: 8px;
  padding: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: 8px;
  padding: 20px 24px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-text);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--black);
  line-height: 1;
}

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

.data-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-text);
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey-mid);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--grey-bg);
  color: var(--black);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--grey-bg); }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  border: 1.5px solid var(--grey-mid);
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  color: var(--black);
  background: var(--white);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--black);
}

.form-input::placeholder { color: #aaa; }

textarea.form-input { resize: vertical; min-height: 80px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: #e8fdf0; color: #1a7a3a; border: 1px solid #b3f0c9; }
.alert-error   { background: #fff0f0; color: #b00020; border: 1px solid #ffc0c0; }
.alert-warning { background: #fffbe6; color: #7a5c00; border: 1px solid #ffe580; }
.alert-info    { background: #f0f7ff; color: #1a4a7a; border: 1px solid #b3d4f5; }

/* ── Modal ── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

#modal-overlay.visible { display: flex; }
#modal-overlay.open { opacity: 1; }

.modal {
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey-text);
  padding: 2px;
  line-height: 1;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--grey-text);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--grey-text);
}

.empty-state-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 13px;
  margin-bottom: 24px;
}

/* ── Utility ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--grey-text); }
.font-bold { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

/* ── Report wide workspace ── */
.workspace-wide { max-width: 1100px; }

/* ── Report sections ── */
.report-section { margin-bottom: 52px; }

.report-section.hidden-section { opacity: 0.35; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--grey-mid);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
}

.period-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--grey-text);
  background: var(--grey-bg);
  border: 1px solid var(--grey-mid);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Stat change indicator ── */
.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.positive { color: #1a7a3a; }
.stat-change.negative { color: #b00020; }
.stat-change.neutral  { color: var(--grey-text); }
.stat-change .icon { width: 11px; height: 11px; }

/* ── Date filter panel ── */
.date-filter-panel {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 36px;
}

.date-filter-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.date-filter-group {}

.date-filter-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-text);
  margin-bottom: 5px;
}

.date-range-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.date-range-row span {
  color: var(--grey-text);
  font-size: 11px;
}

/* ── AI insights panel ── */
.insights-panel {
  background: #f8fff9;
  border: 1px solid #b3f0c9;
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 16px;
}

.insights-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  color: #1a7a3a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.insights-samenvatting {
  font-size: 13px;
  line-height: 1.7;
  color: var(--black);
  margin-bottom: 16px;
}

.insights-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.insights-list-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-text);
  margin-bottom: 8px;
}

.insights-list {
  list-style: none;
  padding: 0;
}

.insights-list li {
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px solid var(--grey-mid);
  color: var(--black);
}

.insights-list li:last-child { border-bottom: none; }
.insights-list li::before { content: "→ "; color: var(--green); font-weight: 700; }

.insights-sentiment {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 6px;
}

.insights-sentiment.positief { background: #e8fdf0; color: #1a7a3a; }
.insights-sentiment.neutraal { background: var(--grey-bg); color: var(--grey-text); }
.insights-sentiment.negatief { background: #fff0f0; color: #b00020; }

/* ── Not connected state ── */
.not-connected-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  background: var(--grey-bg);
  border: 2px dashed var(--grey-mid);
  border-radius: 8px;
  text-align: center;
  gap: 10px;
}

.not-connected-state p {
  font-size: 13px;
  color: var(--grey-text);
}

/* ── Visibility toggle button ── */
.vis-btn {
  background: none;
  border: 1.5px solid var(--grey-mid);
  border-radius: 4px;
  cursor: pointer;
  padding: 5px 8px;
  color: var(--grey-text);
  line-height: 1;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Archivo', sans-serif;
}

.vis-btn:hover { border-color: var(--black); color: var(--black); }
.vis-btn.hidden-state { border-color: #ff4444; color: #ff4444; background: #fff0f0; }

/* ── Table helpers ── */
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.num { text-align: right; }
.data-table td.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Chart containers ── */
.chart-container { position: relative; height: 220px; }

/* ── Spinning loader ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.8s linear infinite; display: inline-block; }

/* ── Mock data banner ── */
.mock-banner {
  background: #fffbe6;
  border: 1px solid #ffe580;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 12px;
  color: #7a5c00;
  font-weight: 500;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Subsection label ── */
.subsection-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--grey-text);
  margin-bottom: 14px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subsection-label:first-child { margin-top: 0; }

/* ── Conversietrechter ── */
.funnel-chart {
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: 8px;
  padding: 28px 32px;
}

.funnel-chart-title {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--black);
  margin-bottom: 24px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.funnel-row-label {
  width: 140px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  flex-shrink: 0;
}

.funnel-row-track {
  flex: 1;
  display: flex;
  justify-content: center;
}

.funnel-row-bar {
  height: 46px;
  background: #1e2030;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.funnel-row-bar.green-bar { background: var(--green); }

.funnel-row-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  padding: 0 16px;
}

.funnel-row-bar.green-bar .funnel-row-value { color: var(--black); }

.funnel-row-pct {
  width: 58px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.funnel-row-pct.pct-normal { color: var(--grey-text); }

.funnel-gap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 5px 0;
}

.funnel-gap-space { width: 140px; flex-shrink: 0; }

.funnel-gap-content {
  flex: 1;
  display: flex;
  justify-content: center;
}

.funnel-dropoff {
  font-size: 11px;
  font-weight: 600;
  color: #b00020;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── 5-koloms grid ── */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

/* ══════════════════════════════════════════════════════════════
   TABBLADEN
══════════════════════════════════════════════════════════════ */

.report-tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--grey-mid);
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.report-tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Archivo', sans-serif;
  color: var(--grey-text);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active {
  color: var(--black);
  border-bottom-color: var(--green);
}
.tab-btn .icon { width: 14px; height: 14px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Vergelijking-balk bovenin elke tab */
.tab-cmp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--grey-bg);
  border-radius: 0 0 8px 8px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--grey-text);
  flex-wrap: wrap;
}
.tab-cmp-bar label {
  font-weight: 600;
  color: var(--black);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tab-cmp-bar select {
  font-size: 12px;
  font-family: 'Archivo', sans-serif;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--grey-mid);
  border-radius: 6px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none;
  appearance: none;
  color: var(--black);
  cursor: pointer;
}
.tab-cmp-bar select:focus { outline: none; border-color: var(--green); }
.tab-cmp-period {
  font-size: 11px;
  color: var(--grey-text);
  background: var(--white);
  border: 1px solid var(--grey-mid);
  border-radius: 20px;
  padding: 3px 10px;
}
