@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');
/* =====================================================================
   THEMA "VOL KLEUR" — licht, bold, kleur = betekenis.
   Tokens + componentnamen ongewijzigd t.o.v. de oude opzet, zodat de
   bestaande views niet breken. Het lef zit op één plek: de hero (violet).
   ===================================================================== */
:root {
  --bg: #161226;
  --surface: #221b3a;
  --surface-2: #2c2450;
  --surface-3: #362c60;
  --line: rgba(216,190,255,.16);
  --line-soft: rgba(216,190,255,.08);
  --ink: #ece6f7;
  --ink-dim: #9d90bd;
  --ink-faint: #675c8a;

  /* merk / actie = violet */
  --accent: #4caf82;
  --accent-press: #3f9a70;
  --accent-soft: #17321f;
  --good: #34d399;
  --pos: #4ade80;

  /* categoriekleuren = betekenis */
  --vast: #60a5fa;     --vast-soft: #1f2a4e;     --vast-ink: #93b4fb;
  --reserve: #fbbf24;  --reserve-soft: #3a2e18;  --reserve-ink: #fcd34d;
  --huis: #4ade80;     --huis-soft: #17321f;     --huis-ink: #6ee7a0;
  --alert: #f87171;    --alert-soft: #3a1d2a;    --alert-ink: #fca5a5;

  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.55);
  --nav-bg: rgba(34,27,58,.88);

  color-scheme: dark;
}

/* =====================================================================
   PLATFORMTHEMA (nachtpaars + roze gloed) — één vast donker thema. Het
   dark-blok krijgt exact dezelfde waarden als :root, zodat de bestaande
   ap-theme-toggle een no-op is en niets flikkert.
   ===================================================================== */
:root[data-theme="dark"] {
  --bg: #161226;
  --surface: #221b3a;
  --surface-2: #2c2450;
  --surface-3: #362c60;
  --line: rgba(216,190,255,.16);
  --line-soft: rgba(216,190,255,.08);
  --ink: #ece6f7;
  --ink-dim: #9d90bd;
  --ink-faint: #675c8a;

  --accent: #4caf82;
  --accent-press: #3f9a70;
  --accent-soft: #17321f;
  --good: #34d399;
  --pos: #4ade80;

  --vast: #60a5fa;     --vast-soft: #1f2a4e;     --vast-ink: #93b4fb;
  --reserve: #fbbf24;  --reserve-soft: #3a2e18;  --reserve-ink: #fcd34d;
  --huis: #4ade80;     --huis-soft: #17321f;     --huis-ink: #6ee7a0;
  --alert: #f87171;    --alert-soft: #3a1d2a;    --alert-ink: #fca5a5;

  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.55);
  --nav-bg: rgba(34,27,58,.88);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(120% 70% at 50% -8%, rgba(215,138,184,.12), rgba(215,138,184,0) 55%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font: inherit; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 24px 20px 112px; }
.main.bare { padding-bottom: 24px; }

.display { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; letter-spacing: -.01em; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.c-vast { color: var(--vast); } .c-reserve { color: var(--reserve-ink); }
.c-huis { color: var(--huis-ink); } .c-alert { color: var(--alert-ink); }
.bold { font-weight: 600; } .semib { font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; }
.pl1 { padding-left: 4px; }

/* headings */
h1.page { font-family: 'DM Sans'; font-size: 20px; font-weight: 600; margin: 0 0 16px; padding-left: 4px; }
h3.sec { font-family: 'DM Sans'; font-size: 15px; font-weight: 600; margin: 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-card); }
.card.lg { border-radius: 20px; }
.card.grad { background: linear-gradient(145deg, var(--accent-soft), var(--surface)); border-radius: 20px; }
.pad { padding: 14px; } .pad-lg { padding: 18px; }

/* hero — het lef: vol violet kleurvlak */
.eyebrow { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-faint); }
.hero-num { font-family: 'DM Sans'; font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -.03em; margin: 6px 0 4px; }
.hero { background: var(--accent); color: #fff; border-radius: 18px; padding: 18px 16px 16px; box-shadow: 0 14px 30px -16px rgba(76,175,130,.5); }
.hero .eyebrow { color: #d8c8f6; }
.hero .hero-num { color: #fff; }
.hero-sub { font-size: 13px; color: #cdb8f2; margin-top: 2px; }
.hero-sub b { color: #fff; }
.hero .bar { background: rgba(255,255,255,.22); border: 0; }
.hero .bar > i.amber { background:#221b3a; }

/* lists */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.item:last-child { border-bottom: 0; }
.item .grow { min-width: 0; flex: 1; }
.item .title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-dim); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.amt { font-family: 'DM Sans'; font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; flex: none; }
.amt.big { font-size: 21px; font-weight: 700; }
.amt.pos { color: var(--pos); }
.icon-box { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2); font-size: 16px; }

/* badges — zachte categoriekleur + donkere inkt */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; }
.badge.vast { background: var(--vast-soft); color: var(--vast-ink); }
.badge.reserve { background: var(--reserve-soft); color: var(--reserve-ink); }
.badge.huis { background: var(--huis-soft); color: var(--huis-ink); }
.badge.na { background: var(--surface-2); color: var(--ink-dim); }
.badge.impuls { background: var(--alert-soft); color: var(--alert-ink); }

/* dots */
.dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.dot.vast { background: var(--vast); } .dot.reserve { background: var(--reserve); } .dot.huis { background: var(--huis); }

/* bars */
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-soft); }
.bar > i { display: block; height: 100%; border-radius: 6px; }
.bar > i.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar > i.huis { background: var(--huis); }

/* vessel — signatuur potjes-vulling (amber; groen = vol) */
.vessel { height: 13px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-soft); overflow: hidden; position: relative; }
.vessel > .liquid { position: relative; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #f59e0b, #fbbf24); transition: width .7s cubic-bezier(.22,1,.36,1); }
.vessel > .liquid::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: rgba(255,255,255,.5); border-radius: 6px 6px 0 0; }
.vessel.green > .liquid { background: linear-gradient(90deg, #16a34a, #34d399); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 13px; padding: 11px 15px; font-family: 'DM Sans'; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn.block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-sm { padding: 6px 12px; border-radius: 11px; font-size: 12px; }
.iconbtn { background: none; border: 0; color: var(--ink-faint); cursor: pointer; padding: 4px; }
.iconbtn:hover { color: var(--alert); }

/* forms */
.field { display: block; margin-bottom: 12px; }
.field > span { font-size: 11px; color: var(--ink-faint); }
.field input, .field select { width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); outline: none; font-size: 14px; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: flex; gap: 8px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-dim); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); }
.err { color: var(--alert-ink); font-size: 12px; margin: 0 0 12px; }
.codeinput { width: 100%; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .3em; padding: 12px; }

/* bottom nav */
.nav { position: fixed; inset: auto 0 0 0; z-index: 30; max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-around; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--nav-bg); backdrop-filter: blur(14px); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--ink-faint); }
.nav a.active { color: var(--accent); }
.nav a.active svg { color: var(--accent); }
.nav svg { width: 20px; height: 20px; }
.nav .add { flex: none; margin-top: -16px; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 8px 18px -6px rgba(109,40,217,.55); }
.nav .add svg { width: 24px; height: 24px; color: #fff; }

/* auth screens */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 18px; }
.auth-logo { width: 56px; height: 56px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -6px rgba(109,40,217,.55); }
.auth-logo svg { width: 28px; height: 28px; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.empty { padding: 32px 16px; text-align: center; font-size: 13px; color: var(--ink-dim); }
.note { font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); padding: 0 4px; margin-top: 12px; }
.secret { font-family: 'DM Sans'; font-size: 18px; letter-spacing: .12em; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px; text-align: center; }

@media (prefers-reduced-motion: reduce) { .vessel > .liquid { transition: none; } }

/* Dashboard-wrappers: op mobiel onzichtbaar (inhoud stroomt zoals voorheen) */
.dash-grid, .dash-main, .dash-side { display: contents; }

/* ---------- Desktop: zijbalk-navigatie + brede inhoud ---------- */
@media (min-width: 900px) {
  .app { max-width: 1320px; flex-direction: row; align-items: stretch; }

  /* Onderbalk wordt een vaste zijbalk links */
  .nav {
    inset: auto; position: sticky; top: 0; order: -1;
    width: 216px; max-width: none; height: 100dvh; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px;
    padding: 22px 12px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--surface); backdrop-filter: none;
  }
  .nav a {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 13.5px; padding: 11px 14px; border-radius: 11px;
  }
  .nav a:hover { background: var(--surface-2); }
  .nav a.active { background: var(--accent-soft); color: var(--accent); }
  .nav .add {
    order: 5; margin: 6px 0 0; width: auto; height: auto;
    flex-direction: row; justify-content: center; gap: 8px;
    padding: 11px 14px; border-radius: 11px; box-shadow: none;
  }
  .nav .add::after { content: "Nieuw"; font-size: 13.5px; font-weight: 600; color: #fff; }
  .nav .add svg { width: 20px; height: 20px; }

  /* Inhoud: comfortabele leesbreedte, gecentreerd naast de zijbalk. */
  .main { width: 100%; max-width: 880px; margin: 0 auto; padding: 32px 36px; }
  .main.page-dashboard { max-width: 1060px; }
  .main.bare { max-width: 460px; padding: 48px 36px; }

  /* Dashboard: hoofdkolom + rechterkolom naast elkaar */
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .dash-main, .dash-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .dash-main > section, .dash-side > section { margin-bottom: 0 !important; }

  /* De drie Nibud-kaarten naast elkaar; label boven het bedrag i.p.v. afbreken */
  section.stack { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  section.stack .row-between { flex-direction: column; align-items: flex-start; gap: 2px; }
}
