/* ============================================================
   DiviDash — design tokens
   Donkergroene "beursvloer" met twee betekenisvolle accenten:
   groen = koers & waarde, goud = dividendinkomen.
   Cijfers altijd in IBM Plex Mono (tabular), koppen in Space Grotesk.
   ============================================================ */

:root {
  color-scheme: light;

  --bg: #f1f5f2;
  --bg-2: #e9efeb;
  --card: #ffffff;
  --card-2: #f7faf8;
  --line: rgba(16, 36, 28, 0.10);
  --line-strong: rgba(16, 36, 28, 0.18);

  --ink: #152019;
  --muted: #5c7167;

  --green: #14966a;
  --green-rgb: 20, 150, 106;
  --green-hover: #0f8259;
  --green-ink: #ffffff;
  --green-soft: rgba(20, 150, 106, 0.11);
  --gold: #a97a1c;
  --gold-rgb: 169, 122, 28;
  --gold-dim: #8a6417;
  --gold-soft: rgba(169, 122, 28, 0.12);
  --red: #cf3a46;
  --red-rgb: 207, 58, 70;
  --red-soft: rgba(207, 58, 70, 0.10);
  --slate: #4f6e99;

  --glow-1: rgba(20, 150, 106, 0.07);
  --glow-2: rgba(169, 122, 28, 0.06);
  --topbar-bg: rgba(241, 245, 242, 0.88);
  --banner-line: rgba(169, 122, 28, 0.35);
  --overlay: rgba(15, 25, 20, 0.38);
  --overlay-soft: rgba(255, 255, 255, 0.55);
  --hover: rgba(16, 36, 28, 0.05);
  --scroll-thumb: #b7c5bd;

  --grid-line: rgba(16, 36, 28, 0.09);
  --tt-bg: #ffffff;
  --tt-border: rgba(16, 36, 28, 0.16);
  --donut-ring: #ffffff;

  --font-display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 26px rgba(22, 44, 35, 0.09);
  --shadow-lg: 0 20px 60px rgba(22, 44, 35, 0.18);
  --shadow-panel: -18px 0 50px rgba(22, 44, 35, 0.15);
  --maxw: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c1512;
  --bg-2: #0f1a15;
  --card: #131f19;
  --card-2: #16241d;
  --line: rgba(226, 240, 232, 0.08);
  --line-strong: rgba(226, 240, 232, 0.16);

  --ink: #e9f2ec;
  --muted: #8fa69b;

  --green: #35c28f;
  --green-rgb: 53, 194, 143;
  --green-hover: #40d29d;
  --green-ink: #0a2018;
  --green-soft: rgba(53, 194, 143, 0.12);
  --gold: #e8b54d;
  --gold-rgb: 232, 181, 77;
  --gold-dim: rgba(232, 181, 77, 0.8);
  --gold-soft: rgba(232, 181, 77, 0.12);
  --red: #f4737b;
  --red-rgb: 244, 115, 123;
  --red-soft: rgba(244, 115, 123, 0.12);
  --slate: #8aa2c4;

  --glow-1: rgba(53, 194, 143, 0.07);
  --glow-2: rgba(232, 181, 77, 0.05);
  --topbar-bg: rgba(12, 21, 18, 0.86);
  --banner-line: rgba(232, 181, 77, 0.3);
  --overlay: rgba(5, 10, 8, 0.6);
  --overlay-soft: rgba(12, 21, 18, 0.45);
  --hover: rgba(226, 240, 232, 0.05);
  --scroll-thumb: #2a3a32;

  --grid-line: rgba(226, 240, 232, 0.07);
  --tt-bg: #16241d;
  --tt-border: rgba(226, 240, 232, 0.16);
  --donut-ring: #131f19;

  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-panel: -18px 0 50px rgba(0, 0, 0, 0.45);
}


* { box-sizing: border-box; }

/* Het hidden-attribuut wint altijd, ook van display: flex/grid op een class. */
[hidden] { display: none !important; }

html { scrollbar-color: var(--scroll-thumb) var(--bg); }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, var(--glow-2), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.gold { color: var(--gold); }
.red { color: var(--red); }
.pos { color: var(--green); }
.neg { color: var(--red); }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============ banner ============ */
.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: var(--gold-soft);
  border-bottom: 1px solid var(--banner-line);
  color: var(--gold);
  font-size: 13px;
  text-align: center;
}
.banner-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* ============ topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(var(--green-rgb), 0.5);
  animation: pulse 2.4s ease-out infinite;
}
.live-dot.is-off { background: var(--muted); animation: none; box-shadow: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--green-rgb), 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(var(--green-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--green-rgb), 0); }
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--card); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.is-spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--green); }

/* ============ layout ============ */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.view { display: flex; flex-direction: column; gap: 18px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.grid-2-uneven { grid-template-columns: 1.4fr 1fr; }

/* ============ hero ============ */
.hero { padding: 22px 22px 16px; }
.hero-top {
  display: flex;
  gap: 26px;
  align-items: stretch;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hero-block { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.hero-divider { width: 1px; background: var(--line-strong); align-self: stretch; }
.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.label-gold { color: var(--gold-dim); }
.hero-value {
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
.hero-value-gold { color: var(--gold); font-size: clamp(24px, 3.2vw, 32px); }
.hero-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.pos { background: var(--green-soft); border-color: rgba(53, 194, 143, 0.35); color: var(--green); }
.chip.neg { background: var(--red-soft); border-color: rgba(244, 115, 123, 0.35); color: var(--red); }
.chip.gold-chip { background: var(--gold-soft); border-color: rgba(232, 181, 77, 0.35); color: var(--gold); }

/* ============ charts ============ */
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chart-wrap { position: relative; height: 320px; }
.chart-wrap-mid { height: 300px; }
.chart-sm { position: relative; height: 250px; }
.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-soft);
  border-radius: var(--radius-sm);
  z-index: 2;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot-green { background: var(--green); }
.dot-slate { background: var(--slate); }

/* segmented control */
.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-num);
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: var(--green); color: var(--green-ink); font-weight: 600; }
.seg-wide { width: 100%; }
.seg-wide .seg-btn { flex: 1; font-family: var(--font-body); font-size: 14px; padding: 8px; }

/* ============ KPI's ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: none; }
.kpi-num { font-size: 19px; font-weight: 600; }
.kpi-sub { font-size: 12px; }

/* ============ knoppen ============ */
.btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--card-2); border-color: rgba(226, 240, 232, 0.28); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-danger { border-color: rgba(var(--red-rgb), 0.5); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-file { position: relative; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* ============ tabellen ============ */
.table-card { padding: 6px 0 10px; }
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.num-h { text-align: right; }
td.num-cell { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--ink); }
.th-sort.is-sorted-asc::after { content: " ↑"; color: var(--green); }
.th-sort.is-sorted-desc::after { content: " ↓"; color: var(--green); }
.th-actions { width: 70px; }

tr.row-click { cursor: pointer; transition: background 0.12s; }
tr.row-click:hover { background: rgba(var(--green-rgb), 0.06); }

.cell-main { font-weight: 500; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sub-line { display: block; font-size: 11.5px; margin-top: 1px; }

.ticker {
  display: inline-block;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(var(--green-rgb), 0.3);
}
.ticker-gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(var(--gold-rgb), 0.3); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-buy { background: var(--green-soft); color: var(--green); }
.badge-sell { background: var(--red-soft); color: var(--red); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.mini-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.mini-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.mini-btn.danger:hover { color: var(--red); border-color: rgba(244, 115, 123, 0.5); }

.table-note { margin: 10px 14px 4px; }
.warn-flag { color: var(--gold); cursor: help; }

/* ============ upcoming lijst ============ */
.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.upcoming li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.upcoming li:last-child { border-bottom: 0; }
.up-date {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--muted);
  min-width: 74px;
}
.up-main { flex: 1; min-width: 0; }
.up-amount { font-family: var(--font-num); color: var(--gold); font-weight: 600; white-space: nowrap; }
.up-freq { font-size: 11px; color: var(--muted); }

/* ============ leeg / onboarding ============ */
.empty {
  text-align: center;
  padding: 46px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-art { width: 180px; opacity: 0.9; }
.empty h1 { font-size: 26px; }
.empty p { max-width: 520px; margin: 0; color: var(--muted); }
.empty-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* ============ formulieren ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 13px; font-weight: 500; }
.field input, .field select {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.16);
}
.field input[type="number"] { font-family: var(--font-num); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--red); font-size: 13px; margin: 12px 0 0; }

/* autocomplete */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
}
.ac-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ac-list li:hover, .ac-list li.is-hl { background: var(--green-soft); }
.ac-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.ac-exch { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ac-empty { color: var(--muted); font-size: 13px; padding: 10px; cursor: default; }
.ac-empty:hover { background: transparent; }

.chosen {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.chosen-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }

/* ============ modals & panel ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  z-index: 50;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  z-index: 60;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.set-group { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }

.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: linear-gradient(180deg, var(--card-2), var(--bg-2));
  border-left: 1px solid var(--line-strong);
  z-index: 60;
  box-shadow: var(--shadow-panel);
  transform: translateX(12px);
  opacity: 0;
  transition: transform 0.18s ease-out, opacity 0.18s ease-out;
}
.panel.is-open { transform: translateX(0); opacity: 1; }
.panel-inner { height: 100%; overflow-y: auto; padding: 20px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-title h2 { font-size: 19px; margin-bottom: 4px; }
.detail-price { margin: 14px 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.detail-price .big { font-size: 27px; font-weight: 600; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 14px 0;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.detail-grid > div { display: flex; flex-direction: column; gap: 1px; }
.detail-grid .label { font-size: 10.5px; }
.detail-grid .val { font-family: var(--font-num); font-size: 14px; font-weight: 500; }
.detail-chart { height: 190px; position: relative; margin: 14px 0; }
.detail-list { list-style: none; margin: 8px 0 0; padding: 0; }
.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.detail-list li:last-child { border-bottom: 0; }

/* ============ toasts ============ */
.toasts {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  align-items: center;
}
.toast {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--green);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  max-width: min(440px, calc(100vw - 32px));
}
.toast.err { border-left-color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ skeleton ============ */
.skel {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--card-2) 25%, var(--card) 50%, var(--card-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  color: transparent !important;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ footer ============ */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* ============ responsive ============ */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-2-uneven { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar-inner { padding: 10px 14px 6px; gap: 10px; }
  .topbar-status { display: none; }
  .page { padding: 16px 14px 32px; }
  .kpi-grid, .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 18px 16px 12px; }
  .hero-top { gap: 16px; }
  .hero-divider { display: none; }
  .chart-wrap { height: 250px; }
  .chart-wrap-mid { height: 240px; }
  .hide-sm { display: none !important; }
  .field-row { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ verdeling (breakdown met tabbladen) ============ */
.bd-tabs {
  display: flex;
  gap: 2px;
  margin: 2px 0 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.bd-tabs::-webkit-scrollbar { display: none; }
.bd-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 13px;
  color: var(--muted);
  font: 600 13px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s;
}
.bd-tab:hover { color: var(--ink); }
.bd-tab.is-active { color: var(--ink); border-bottom-color: var(--green); }
.bd-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 8px 30px;
  align-items: center;
  padding-top: 14px;
}
.bd-donut { position: relative; height: 250px; }
.bd-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 2px 26px;
  align-content: center;
}
.bd-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
  padding: 7px 8px 9px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
}
.bd-item:hover { background: var(--hover); }
.bd-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: inset 0 0 0 1.5px var(--c);
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 4px;
}
.bd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-pct { font-family: var(--font-num); font-size: 13px; color: var(--muted); }
.bd-bar {
  grid-column: 2 / -1;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
  width: var(--w);
  min-width: 6px;
  margin-top: 5px;
  opacity: 0.9;
  transition: width 0.25s;
}
.bd-item.is-off .bd-swatch { background: transparent; }
.bd-item.is-off .bd-name { color: var(--muted); }
.bd-item.is-off .bd-bar { opacity: 0.15; }
.bd-item.is-off .bd-pct { opacity: 0.5; }
.bd-note { color: var(--muted); font-size: 13px; padding: 10px 4px; }

@media (max-width: 840px) {
  .bd-body { grid-template-columns: 1fr; }
  .bd-donut { height: 210px; }
  .bd-legend { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
}
