/* De Zingende Zwaan dashboard, webversie.
   Overgenomen uit Theme.swift en Components.swift. Alleen licht thema.
   Layout: één kolom van max. 1200px met kaarten van matglas op een warme
   achtergrond met kleurvlekken, kop bovenaan en zwevende menubalk onderaan. */

:root {
  /* Kleuren De Zingende Zwaan */
  --wine: #581002;     /* hoofdkleur, logo */
  --ink: #2A1510;      /* tekst */
  --muted: #7A5F57;    /* secundaire tekst */
  --ground: #F6E4DC;   /* achtergrond */
  --blush: #FBEFE9;    /* tegels in kaarten */
  --rose: #C98672;
  --gold: #C99A5B;
  --rust: #B5503A;
  --coral: #E0674A;
  --brick: #8E2A12;
  --sand: #E6BFAE;
  --track: #EBD3CA;
  --line: #E8D2C8;
  --silver: #D9B9AB;
  --good: #167A32;
  --good-bg: #DDF3E3;
  --bad: #C0261B;
  --bad-bg: #FBE0DD;
  --cream: #FFF6F0;
  --amber: #7A4A12;
  --label: #6A4A40;
  --api: #9C8A84;
  --white: #FFFFFF;

  /* Afgeleide tinten */
  --tile: rgba(251, 239, 233, .85);
  --tile-soft: rgba(251, 239, 233, .70);
  --track-85: rgba(235, 211, 202, .85);
  --track-75: rgba(235, 211, 202, .75);
  --track-60: rgba(235, 211, 202, .60);
  --line-90: rgba(232, 210, 200, .90);
  --muted-12: rgba(122, 95, 87, .12);
  --muted-10: rgba(122, 95, 87, .10);
  --gold-35: rgba(201, 154, 91, .35);
  --gold-25: rgba(201, 154, 91, .25);
  --gold-22: rgba(201, 154, 91, .22);
  --gold-20: rgba(201, 154, 91, .20);
  --gold-18: rgba(201, 154, 91, .18);
  --gold-16: rgba(201, 154, 91, .16);
  --gold-14: rgba(201, 154, 91, .14);
  --wine-10: rgba(88, 16, 2, .10);
  --bad-25: rgba(192, 38, 27, .25);
  --bad-bg-85: rgba(251, 224, 221, .85);

  /* Glas */
  --card-fill: rgba(255, 255, 255, .62);
  --card-fill-strong: rgba(255, 255, 255, .74);
  --card-edge: rgba(255, 255, 255, .92);
  --shadow-card: 0 10px 32px rgba(88, 16, 2, .12);
  --shadow-strong: 0 16px 44px rgba(88, 16, 2, .16);
  --shadow-control: 0 8px 28px rgba(88, 16, 2, .14);
  --shadow-pill: 0 4px 14px rgba(88, 16, 2, .16);

  /* Type: systeemletter, net als de SwiftUI-app (SF Pro op Apple-apparaten) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Zijmarge, ook naast de notch in liggende stand */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; font-size: inherit; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

/* ---------- Achtergrond met warme kleurvlekken ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 150px 110px, rgba(201, 154, 91, .55) 0, rgba(201, 154, 91, .40) 220px, rgba(201, 154, 91, 0) 430px),
    radial-gradient(circle at calc(100% + 100px) 620px, rgba(142, 42, 18, .30) 0, rgba(142, 42, 18, .20) 230px, rgba(142, 42, 18, 0) 450px),
    radial-gradient(circle at calc(15% + 280px) calc(100% + 40px), rgba(224, 103, 74, .28) 0, rgba(224, 103, 74, .18) 200px, rgba(224, 103, 74, 0) 410px),
    var(--ground);
}

/* ---------- Kop ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 14px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -36px 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle 900px at 0 0, rgba(214, 180, 146, .92) 0, rgba(232, 207, 190, .90) 33%, rgba(244, 228, 221, .88) 66%, rgba(246, 231, 225, .86) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 62%, rgba(0, 0, 0, .6) 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 62%, rgba(0, 0, 0, .6) 80%, transparent 100%);
}
.top-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { width: 44px; height: 38px; object-fit: contain; flex: none; }
.brand-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.5px; color: var(--wine); line-height: 1.15; text-wrap: balance; }
.page-sub { font-size: 13px; color: var(--muted); }
.topbar .period { width: 100%; max-width: 300px; }

/* ---------- Inhoud ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1232px;
  margin: 0 auto;
  padding-top: 20px;
  padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.screen { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.screen.enter { animation: enter .28s ease-out; }
.notice { font-size: 12px; font-weight: 600; color: var(--amber); background: var(--gold-25); border-radius: 999px; padding: 4px 10px; width: max-content; max-width: 100%; margin-top: 4px; }
@keyframes enter { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Menubalk ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding-top: 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.tabbar::before {
  content: "";
  position: absolute;
  inset: -40px 0 0 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle 700px at 50% 100%, rgba(228, 192, 176, .90) 0, rgba(238, 214, 203, .88) 50%, rgba(245, 230, 224, .86) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-mask-image: linear-gradient(to top, #000 0, #000 58%, rgba(0, 0, 0, .6) 78%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0, #000 58%, rgba(0, 0, 0, .6) 78%, transparent 100%);
}
.tabs { display: flex; gap: 4px; padding: 6px; width: 100%; max-width: 640px; border-radius: 999px; }
.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
  transition: background-color .2s, color .2s;
}
.tab .ic-wrap { position: relative; height: 24px; display: grid; place-items: center; }
.tab .ic { width: 21px; height: 21px; stroke-width: 1.8; }
.tab-label { font-size: clamp(9.5px, 2.65vw, 11px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab[aria-current="page"] { color: var(--wine); background: var(--wine-10); }
.tab .badge {
  position: absolute;
  top: -4px;
  left: calc(50% + 4px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bad);
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* ---------- Glas (bedieningslaag) ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: rgba(255, 255, 255, .50);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-control), inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -1px 2px rgba(255, 255, 255, .45);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 46%),
    radial-gradient(120% 90% at 50% 120%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%);
}

/* ---------- Kaarten ---------- */
.card {
  background: var(--card-fill);
  border: 1px solid var(--card-edge);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card.strong { background: var(--card-fill-strong); box-shadow: var(--shadow-strong); }
.card.r30 { border-radius: 30px; }
.card.r22 { border-radius: 22px; }
.card.g4 { gap: 4px; }
.card.g10 { gap: 10px; }
.card.g12 { gap: 12px; }
.card.pb12 { padding-bottom: 12px; }
.card.pb16 { padding-bottom: 16px; }

.card-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.card-sub { font-size: 13px; color: var(--muted); }
.section-title { font-size: 15px; font-weight: 600; }

.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.head-row > .card-head { flex: 1 1 220px; }
.head-row.baseline { align-items: baseline; }
.head-row.start { align-items: flex-start; flex-wrap: nowrap; }

.footnote { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.bold { font-weight: 700; }
.semi { font-weight: 600; }
.c-good { color: var(--good); }
.c-bad { color: var(--bad); }
.c-wine { color: var(--wine); }
.c-muted { color: var(--muted); }
.c-ink { color: var(--ink); }
.c-amber { color: var(--amber); }
.c-rust { color: var(--rust); }

.divider { height: 1px; background: var(--line-90); flex: none; }

/* ---------- Tegels ---------- */
.tile { background: var(--tile); border-radius: 18px; }
.note-tile { font-size: 13px; padding: 10px 12px; border-radius: 14px; background: var(--tile); }
.note-tile.bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.note-tile.good { background: var(--good-bg); color: var(--good); font-weight: 600; }
.note-tile.gold { background: var(--gold-16); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.note-tile.warn { background: var(--gold-18); font-size: 12px; display: flex; gap: 8px; align-items: flex-start; }
.note-tile.warn .ic { color: var(--wine); width: 14px; height: 14px; margin-top: 1px; }

/* ---------- Labels ---------- */
.chip {
  --s: 13px;
  display: inline-flex;
  align-items: center;
  height: calc(var(--s) + 12px);
  padding: 0 10px;
  border-radius: 999px;
  font-size: var(--s);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.s12 { --s: 12px; padding: 0 8px; }
.chip.s11 { --s: 11px; padding: 0 8px; }
.tone-good { color: var(--good); background: var(--good-bg); }
.tone-bad { color: var(--bad); background: var(--bad-bg); }
.tone-neutral { color: var(--muted); background: var(--muted-12); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.tag.src-soigne { background: var(--good-bg); color: var(--good); }
.tag.src-exact { background: var(--gold-25); color: var(--amber); }
.tag.src-other { background: var(--muted-12); color: var(--muted); }
.tag.big { height: 22px; padding: 0 8px; font-size: 11px; }

/* ---------- KPI-tegel en MiniStat ---------- */
.grid { display: grid; gap: 12px; }
.grid.g10 { gap: 10px; }
.grid.g8 { gap: 8px; }
.grid.g16 { gap: 16px; align-items: start; }
.grid.min160 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.min180 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.min200 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.min280 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid.min300 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid.min320 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.fit200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
/* KPI-tegels: kolommen die de rij vullen (7 en 5 tegels) */
.grid.kpis { grid-template-columns: 1fr 1fr; }
.grid.kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .grid.kpis.k7 { grid-template-columns: repeat(4, 1fr); }
  .grid.kpis.k5 { grid-template-columns: repeat(3, 1fr); }
  .grid.kpis > :last-child:nth-child(odd) { grid-column: auto; }
}
@media (min-width: 900px) { .grid.kpis.k5 { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1050px) { .grid.kpis.k7 { grid-template-columns: repeat(7, 1fr); } }
.grid.four { grid-template-columns: repeat(4, 1fr); gap: 6px; }

.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px;
  min-width: 0;
  background: var(--card-fill);
  border: 1px solid var(--card-edge);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}
.kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kpi .chip { margin-top: 6px; }

.mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  min-width: 0;
  background: var(--tile);
  border-radius: 18px;
}
.mini.gold { background: var(--gold-20); }
.mini-label { font-size: 12px; color: var(--muted); }
.mini-value { --vs: 20px; font-size: var(--vs); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.mini-note { font-size: 12px; font-weight: 600; color: var(--muted); }
.mini-row { display: flex; gap: 10px; }
.mini-row > * { flex: 1 1 0; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: none; }
.legend i.round { border-radius: 6px; }

/* ---------- Balken ---------- */
.bar { --h: 10px; position: relative; height: var(--h); border-radius: 999px; background: var(--track-85); }
.bar > .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .3s ease; }
.mbar { --h: 10px; position: relative; height: var(--h); }
.mbar > .trk { position: absolute; inset: 0; border-radius: 999px; background: var(--track-60); }
.mbar > .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.mbar > .over { position: absolute; top: 0; bottom: 0; border-radius: 0 999px 999px 0; background: var(--bad); }
.mbar > .mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 1.5px; background: var(--ink); }
.split { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; }
.split > i { display: block; height: 100%; }

/* ---------- Keuzeknoppen (pillen) ---------- */
.pills { --h: 36px; --fs: 14px; display: flex; gap: 2px; padding: 4px; border-radius: 999px; min-width: 0; }
.pills.plain { background: var(--tile); padding: 3px; }
.pill {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--h);
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.pill[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: var(--wine); box-shadow: var(--shadow-pill); }
.pills.w320 { max-width: 320px; }
.pills.w420 { max-width: 420px; }

/* ---------- Naast elkaar op breed scherm, onder elkaar op smal scherm ---------- */
.row { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row > * { min-width: 0; }
@media (min-width: 720px) {
  .row { flex-direction: row; align-items: flex-start; }
  .row > * { flex: 1 1 0; }
  .row > .w340 { flex: 0 1 340px; }
  .row > .w360 { flex: 0 1 360px; }
  .row > .w380 { flex: 0 1 380px; }
  .row > .w420 { flex: 0 1 420px; }
  .top-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .topbar .period { width: 300px; flex: none; }
}

/* ---------- Iconen ---------- */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.solid { fill: currentColor; }

/* ---------- Overzicht ---------- */
.hero { padding: 22px; gap: 18px; }
.hero-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.hero-value { font-size: 52px; font-weight: 700; letter-spacing: -1.8px; color: var(--wine); line-height: 1.1; }
.comp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  min-width: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(246, 226, 214, .95), rgba(240, 214, 200, .85));
  border: 1px solid rgba(201, 154, 91, .32);
  box-shadow: 0 6px 16px rgba(88, 16, 2, .08);
}
.comp-label { font-size: 13px; font-weight: 600; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comp-value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; white-space: nowrap; }
.comp .chip { --s: 14px; height: 30px; padding: 0 12px; font-weight: 700; }

.alert-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border-radius: 20px;
  background: var(--bad-bg-85);
  border: 1px solid var(--bad-25);
  cursor: pointer;
}
.alert-btn .count { width: 34px; height: 34px; border-radius: 50%; background: var(--bad); color: var(--cream); font-size: 15px; font-weight: 700; display: grid; place-items: center; flex: none; }
.alert-btn .txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.alert-btn .t1 { font-size: 15px; font-weight: 600; }
.alert-btn .t2 { font-size: 13px; color: var(--muted); }
.alert-btn .ic { color: var(--bad); font-size: 17px; stroke-width: 2.6; }

.result-amount { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.result-value { font-size: 40px; font-weight: 700; letter-spacing: -1.2px; line-height: 1.1; white-space: nowrap; }
.result-omzet { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cost-rows { display: flex; flex-direction: column; }
.cost-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.cost-row .lbl { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cost-row .lbl-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.cost-row .note { font-size: 12px; color: var(--muted); }
.cost-row .val { font-size: 15px; font-weight: 700; white-space: nowrap; }
.prime { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; margin-top: 4px; }
.prime .p1 { font-size: 14px; font-weight: 600; flex: 1 1 auto; min-width: 0; }
.prime .p2 { font-size: 17px; font-weight: 700; }
.prime .p3 { font-size: 12px; color: var(--muted); white-space: nowrap; }
.prime.bad { background: var(--bad-bg); color: var(--bad); }
.prime.good { background: var(--good-bg); color: var(--good); }
.prime.none { background: var(--tile); color: var(--muted); }

.online-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 84px; border-radius: 18px; background: var(--tile); }
.online-row > .ic { font-size: 24px; color: var(--wine); width: 28px; stroke-width: 1.6; }
.online-row .mid { flex: 1 1 auto; min-width: 0; }
.online-row .lbl { font-size: 13px; color: var(--muted); }
.online-row .big { display: flex; align-items: baseline; gap: 4px; }
.online-row .big b { font-size: 24px; font-weight: 700; }
.online-row .big span { font-size: 13px; font-weight: 500; color: var(--muted); }
.online-row .side { font-size: 12px; color: var(--muted); text-align: right; display: flex; flex-direction: column; }

.goal-body { display: flex; align-items: center; gap: 16px 18px; flex-wrap: wrap; justify-content: center; }
.goal-body .rings { width: 154px; height: 154px; flex: none; }
.goal-body .rings circle { transition: stroke-dasharray .4s ease; }
.goal-legend { flex: 1 1 200px; min-width: 200px; display: flex; flex-direction: column; gap: 12px; }
.goal-item .gi-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.goal-item .gi-top i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.goal-item .gi-top .lbl { flex: 1 1 auto; }
.goal-item .gi-top b { font-weight: 700; }
.goal-item .gi-detail { font-size: 12px; color: var(--muted); padding-left: 18px; }

/* Staafdiagrammen met staven in een spoor */
.cols { display: flex; align-items: flex-start; gap: 6px; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: default; color: inherit; }
button.col { cursor: pointer; }
button.col:disabled { cursor: default; }
.col .v { font-size: 11px; font-weight: 500; color: var(--muted); height: 14px; line-height: 14px; white-space: nowrap; }
.col .v.peak { font-weight: 700; color: var(--wine); }
.col .v.amber { font-weight: 700; color: var(--amber); }
.col .track { position: relative; width: 100%; max-width: 52px; height: 160px; border-radius: 12px; background: var(--track-75); overflow: hidden; }
.col .track > i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px; transition: height .35s ease; }
.col .l { font-size: 12px; font-weight: 600; white-space: nowrap; }
.col .d { font-size: 11px; font-weight: 600; min-height: 14px; white-space: nowrap; }
button.col:not(:disabled):hover .track { box-shadow: 0 0 0 2px rgba(88, 16, 2, .15); }

.sources { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; padding-top: 8px; }
.sources span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sources i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sources b { font-weight: 600; }
.sources em { font-style: normal; color: var(--muted); }

/* ---------- Inzichten ---------- */
.fc-cols { display: flex; align-items: flex-end; gap: 8px; }
.fc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fc-col .v { font-size: 11px; font-weight: 600; white-space: nowrap; }
.fc-col .stack { width: 100%; max-width: 52px; height: 170px; display: flex; flex-direction: column; justify-content: flex-end; }
.fc-col .over { background: var(--good); border-radius: 10px 10px 0 0; }
.fc-col .fc { position: relative; background: rgba(235, 211, 202, .95); border-radius: 10px; overflow: hidden; }
.fc-col .fc.flat { border-radius: 0 0 10px 10px; }
.fc-col .fc > i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--wine); border-radius: 0 0 10px 10px; }
.fc-col .l { font-size: 12px; font-weight: 600; white-space: nowrap; }

.list-rows { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: baseline; gap: 10px; font-size: 13px; padding: 8px 0; }
.lrow .day { width: 44px; flex: none; font-weight: 600; }
.lrow .mid { flex: 1 1 auto; min-width: 0; color: var(--muted); }
.lrow .end { font-weight: 600; white-space: nowrap; }

.ring-card { align-items: center; text-align: center; gap: 12px; }
.ring-card .card-title { align-self: stretch; text-align: left; }
.ring-wrap { position: relative; width: 156px; height: 156px; }
.ring-wrap svg { position: absolute; inset: 0; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 36px; font-weight: 700; letter-spacing: -1px; color: var(--wine); line-height: 1.1; }
.ring-center span { font-size: 12px; color: var(--muted); }
.ring-text { display: flex; flex-direction: column; gap: 2px; }
.ring-text .a { font-size: 15px; font-weight: 600; }
.ring-text .b { font-size: 13px; font-weight: 600; }
.ring-text .c { font-size: 12px; color: var(--muted); padding-top: 4px; }

.gauge-card { align-items: center; gap: 10px; }
.gauge-card > .card-title { align-self: stretch; }
.gauge { position: relative; width: 240px; height: 140px; }
.gauge svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gauge .ends { position: absolute; left: 14px; right: 14px; bottom: -8px; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.gauge-val { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge-val b { font-size: 36px; font-weight: 700; line-height: 1.1; }
.gauge-val span { font-size: 13px; color: var(--muted); }
.gauge-foot { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.gauge-foot .split { height: 12px; }
.kv { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.kv .k { flex: 1 1 auto; }
.kv i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.trend svg { display: block; width: 100%; height: 170px; overflow: visible; }
.trend-labels { display: flex; gap: 2px; }
.trend-labels > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.trend-labels b { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.trend-labels b.last { color: var(--bad); }
.trend-labels span { font-size: 11px; color: var(--muted); white-space: nowrap; }

.over-tile { padding: 16px; border-radius: 20px; background: var(--bad-bg); display: flex; flex-direction: column; gap: 2px; }
.over-tile .o1 { font-size: 13px; font-weight: 600; color: var(--bad); }
.over-tile .o2 { font-size: 34px; font-weight: 700; letter-spacing: -1px; color: var(--bad); line-height: 1.15; }
.over-tile .o3 { font-size: 13px; }

.brow { display: flex; flex-direction: column; gap: 6px; }
.brow .bh { display: flex; align-items: baseline; gap: 10px; font-size: 14px; padding-top: 4px; }
.brow .bh .day { width: 44px; flex: none; font-weight: 600; }
.brow .bh .mid { flex: 1 1 auto; min-width: 0; color: var(--muted); }
.brow .bh .end { font-weight: 600; white-space: nowrap; }
.brow .indent { padding-left: 54px; }
.brow .sub { font-size: 12px; color: var(--muted); padding-bottom: 4px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.table-scroll::-webkit-scrollbar { display: none; }
table.t { border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.t th { font-weight: 500; color: var(--muted); text-align: left; padding: 6px 4px; }
table.t td { padding: 9px 4px; border-top: 1px solid var(--line-90); }
table.t .r { text-align: right; }
table.t tr.hl td { background: var(--gold-14); }

.heat { display: flex; flex-direction: column; gap: 4px; }
.heat-row { display: flex; align-items: center; gap: 3px; }
.heat-row .day { width: 26px; flex: none; font-size: 12px; color: var(--muted); }
.heat-row .start { width: 42px; flex: none; text-align: right; font-size: 11px; font-weight: 600; }
.heat-row .cell { flex: 1 1 0; min-width: 0; height: 26px; border-radius: 6px; }
.heat-row .cell.terras { box-shadow: inset 0 0 0 2px var(--gold); }
.heat-row.head { font-size: 10px; color: var(--muted); }
.heat-row.head .h { flex: 1 1 0; min-width: 0; text-align: center; }
.heat-row.head .start { font-weight: 400; font-size: 10px; color: var(--muted); }
.heat-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.heat-legend > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.heat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.heat-legend i { width: 14px; height: 12px; border-radius: 4px; display: inline-block; }
.heat-legend i.sq { width: 11px; height: 11px; border-radius: 3px; }

.dp-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.dp-row.weekend { background: var(--gold-16); }
.dp-row .day { width: 40px; flex: none; font-size: 13px; font-weight: 600; }
.dp-row .barbox { flex: 1 1 auto; min-width: 0; height: 12px; }
.dp-row .split { height: 12px; }
.dp-row .pct { width: 40px; flex: none; text-align: right; font-size: 13px; font-weight: 700; }

/* ---------- Per dag ---------- */
.daypicker { display: flex; gap: 2px; padding: 4px; border-radius: 22px; }
.dp-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.dp-btn .a { font-size: 12px; font-weight: 500; }
.dp-btn .b { font-size: 16px; font-weight: 700; }
.dp-btn:disabled { color: rgba(122, 95, 87, .55); cursor: default; }
.dp-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: var(--wine); box-shadow: var(--shadow-pill); }

.day-hero .full { font-size: 14px; font-weight: 500; color: var(--muted); }
.day-hero .amt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-hero .amt b { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; color: var(--wine); line-height: 1.1; }
.pbar { display: flex; flex-direction: column; gap: 5px; }
.pbar .ph { display: flex; justify-content: space-between; font-size: 13px; }
.busy { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.busy .ic { color: var(--wine); font-size: 16px; }
.busy .k { flex: 1 1 auto; }
.busy b { font-weight: 600; }
.sec { display: flex; flex-direction: column; gap: 6px; }
.sec .sh { display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- Menu ---------- */
.menu-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .menu-grid > .courses { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .menu-grid { grid-template-columns: 1fr 1fr 1fr; }
  .menu-grid > .courses { grid-column: auto; }
}
.stack16 { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.course { display: flex; flex-direction: column; gap: 7px; padding-top: 4px; }
.course .ch { display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.course .ch .n { font-weight: 600; }
.course .ch .s { font-size: 12px; color: var(--muted); flex: 1 1 auto; }
.course .ch .a { font-weight: 600; }

.donut-wrap { position: relative; width: 170px; height: 170px; align-self: center; }
.donut-wrap svg { position: absolute; inset: 0; }
.donut-wrap svg circle { cursor: pointer; transition: stroke-width .25s ease, opacity .25s ease; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; pointer-events: none; }
.donut-center .n { font-size: 12px; color: var(--muted); }
.donut-center b { font-size: 28px; font-weight: 700; letter-spacing: -.8px; color: var(--wine); line-height: 1.1; }
.donut-center .a { font-size: 12px; font-weight: 600; }
.ch-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 13px;
  background: rgba(255, 255, 255, .35);
  border: 1px solid rgba(255, 255, 255, .9);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.ch-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .9); border-color: var(--silver); }
.ch-btn i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ch-btn .n { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-btn .p { color: var(--muted); }

.rank-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; }
.rank-row .i { width: 14px; flex: none; font-weight: 600; color: var(--muted); }
.rank-row .n { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.rank-row .s { font-size: 12px; color: var(--muted); }
.rank-row .a { width: 56px; text-align: right; font-weight: 600; flex: none; }
.card.top-list { padding-top: 18px; padding-bottom: 10px; gap: 2px; }

/* ---------- Inkoop ---------- */
.alert-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.alert-row .ab { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 17px; }
.alert-row .ab .ic { stroke-width: 2.2; }
.alert-row .at { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-row .at-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-row .at-title { font-size: 15px; font-weight: 600; }
.alert-row .sev { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.alert-row .at-detail { font-size: 13px; color: var(--muted); }
.alert-row .at-impact { font-size: 12px; font-weight: 600; color: var(--wine); }
.sev-hoog { background: var(--bad-bg); color: var(--bad); }
.sev-middel { background: var(--gold-25); color: var(--amber); }
.sev-laag { background: var(--muted-12); color: var(--muted); }
.alerts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding-bottom: 6px; }
.alerts-head > .card-head { flex: 1 1 260px; }
.alerts-head > .pills { flex: 0 1 320px; width: 320px; max-width: 100%; }

.cost-val { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.cost-val b { font-size: 24px; font-weight: 700; line-height: 1.15; }
.cost-val span { font-size: 12px; color: var(--muted); }
.cost-chart { position: relative; height: 148px; display: flex; align-items: flex-end; gap: 6px; }
.cost-chart .cb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cost-chart .cb span { font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cost-chart .cb span.over { color: var(--bad); }
.cost-chart .cb i { display: block; width: 100%; max-width: 30px; border-radius: 6px; }
.cost-chart .goal { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgba(42, 21, 16, .55); pointer-events: none; }
.wk-labels { display: flex; gap: 6px; }
.wk-labels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 10px; letter-spacing: -.2px; color: var(--muted); white-space: nowrap; overflow: hidden; }

.sup-row { display: flex; flex-direction: column; gap: 5px; }
.sup-row .sh { display: flex; align-items: baseline; gap: 8px; font-size: 14px; padding-top: 4px; }
.sup-row .sh .n { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.sup-row .sh .a { font-weight: 600; }
.sup-row .sh .d { width: 52px; text-align: right; font-size: 12px; font-weight: 700; flex: none; }
.sup-row .mbar { margin-bottom: 4px; }

.price-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.price-row .pn { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.price-row .pn b { font-size: 14px; font-weight: 600; }
.price-row .pn span { font-size: 12px; color: var(--muted); }
.price-row svg { width: 68px; height: 22px; flex: none; overflow: visible; }
.price-row .pv { width: 74px; flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.price-row .pv b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.price-row .pv span { font-size: 12px; font-weight: 700; }

table.month { min-width: 760px; width: 100%; }
table.month th { font-size: 13px; padding: 8px 0; text-align: right; }
table.month th:first-child, table.month td:first-child { text-align: left; }
table.month td { padding: 9px 0; text-align: right; border-top: 1px solid var(--line-90); }
table.month tr.total td { font-weight: 700; }
table.month td.rb { width: 150px; padding-left: 8px; }
.rbar { position: relative; height: 10px; width: 142px; margin-left: auto; }
.rbar .axis { position: absolute; top: -3px; bottom: -3px; left: 30%; width: 1px; background: rgba(122, 95, 87, .4); }
.rbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }

.center-foot { text-align: center; }

/* ---------- Socials ---------- */
.stars { position: relative; display: inline-flex; flex: none; color: var(--track); }
.stars .row-s { display: flex; gap: var(--gap, 4px); }
.stars .on { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--gold); }
.stars svg { width: var(--sz, 22px); height: var(--sz, 22px); fill: currentColor; flex: none; display: block; }

.score-top { display: flex; align-items: center; gap: 16px; }
.score-top > b { font-size: 60px; font-weight: 700; letter-spacing: -2.4px; color: var(--wine); line-height: 1; }
.score-top .st { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.goal-line { display: flex; flex-direction: column; gap: 6px; }
.goal-line .gh { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.goal-line .gh b { font-weight: 600; white-space: nowrap; }

.vbars { display: flex; align-items: flex-end; gap: 4px; height: 150px; }
.vbars > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vbars .v { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.vbars .v.last { color: var(--wine); }
.vbars i { display: block; width: 100%; max-width: 40px; border-radius: 6px; background: var(--rose); transition: height .3s ease; }
.vbars i.last { background: var(--wine); }
.vbars .l { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.sub-head > .pills { flex: 0 1 220px; width: 220px; max-width: 100%; }
.sub-head > .pills.w200 { flex-basis: 200px; width: 200px; }
.sub-block { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

.game-head { display: flex; align-items: center; gap: 10px; }
.game-head > .ic { font-size: 24px; color: var(--wine); stroke-width: 1.8; }
.leader { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--tile-soft); }
.leader.first { background: var(--gold-22); }
.leader .medal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.leader .ln { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.leader .ln b { font-size: 15px; font-weight: 600; }
.leader .ln span { font-size: 12px; color: var(--muted); }
.leader .lc { font-size: 20px; font-weight: 700; color: var(--wine); }
.empty { font-size: 14px; color: var(--muted); text-align: center; padding: 16px; border-radius: 18px; background: var(--tile-soft); }

.reviews-scroll { height: 560px; overflow-y: auto; padding-right: 6px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.review { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.review .rh { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.review .rh b { font-size: 13px; font-weight: 600; }
.review .rh .when { font-size: 12px; color: var(--muted); }
.review .flag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--wine); color: var(--cream); font-size: 11px; font-weight: 700; }
.review .flag .ic { width: 11px; height: 11px; }
.review p { font-size: 14px; line-height: 1.45; padding-bottom: 6px; }
.review mark { background: var(--gold-35); color: var(--wine); font-weight: 700; border-radius: 3px; padding: 0 1px; }

.follow-top { display: flex; align-items: center; gap: 14px; }
.follow-top > .ic { font-size: 38px; color: var(--wine); width: 44px; stroke-width: 1.3; }
.follow-top b { font-size: 52px; font-weight: 700; letter-spacing: -2px; color: var(--wine); line-height: 1.05; display: block; }
.follow-top span { font-size: 13px; color: var(--muted); }

.post { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.post .thumb { position: relative; flex: none; }
.post .thumb img { width: 72px; height: 128px; object-fit: cover; border-radius: 14px; }
.post .rank { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); color: var(--wine); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.post .pt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.post .pt .c { font-size: 14px; font-weight: 600; }
.post .pt .m { font-size: 12px; color: var(--muted); }
.post .pt .vw { display: flex; align-items: baseline; gap: 4px; }
.post .pt .vw b { font-size: 20px; font-weight: 700; color: var(--wine); }
.post .pt .vw span { font-size: 12px; font-weight: 500; color: var(--muted); }
.open-ig { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--wine); }
.open-ig .ic { width: 11px; height: 11px; stroke-width: 2.6; }
a.post:hover .c, a.post-link:hover .c { text-decoration: underline; text-decoration-color: rgba(88, 16, 2, .3); }

.post-row { display: flex; flex-direction: column; gap: 8px; }
.post-link { display: flex; align-items: flex-start; gap: 12px; padding-top: 4px; }
.post-link img { width: 60px; height: 80px; object-fit: cover; border-radius: 12px; flex: none; }
.post-link .pt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-link .c { font-size: 14px; font-weight: 600; }
.post-link .m { font-size: 12px; color: var(--muted); }
.stat { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: var(--tile); min-width: 0; }
.stat b { font-size: 14px; font-weight: 700; }
.stat span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; }
.post-row .grid.four { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
