/* Randwys - oranje, wit en blou */
:root {
  --orange: #EE7623;
  --orange-d: #C95E10;
  --orange-l: #FFF1E6;
  --blue: #0B3D91;
  --blue-d: #072A66;
  --blue-m: #2F6FD0;
  --blue-l: #EAF1FC;
  --white: #FFFFFF;
  --bg: #F4F6FA;
  --ink: #14213D;
  --ink-2: #4A5672;
  --ink-3: #8590A6;
  --line: #E1E6EF;
  --good: #1F8A4C;
  --good-l: #E6F5EC;
  --bad: #C0392B;
  --bad-l: #FCEBEA;
  --warn: #D68910;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 61, 145, .06), 0 4px 16px rgba(11, 61, 145, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-m); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Skerm-uitleg ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--blue); color: #fff;
  padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 0 var(--orange);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; color: #fff; text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }
.iconbtn { background: transparent; border: 0; color: inherit; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.12); }
.iconbtn svg { width: 22px; height: 22px; }
.savestate { font-size: 12px; opacity: .8; }

.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.pagehead p { margin: 4px 0 0; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; color: var(--ink-3); text-decoration: none; font-weight: 600; }
.bottomnav a svg { width: 23px; height: 23px; }
.bottomnav a.on { color: var(--blue); }
.bottomnav a.on svg { color: var(--orange); }

.sidenav { display: none; }
@media (min-width: 900px) {
  .app { flex-direction: row; flex-wrap: wrap; }
  .topbar { width: 100%; }
  .sidenav { display: block; width: 230px; padding: 18px 12px; position: sticky; top: 60px; align-self: flex-start; }
  .sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; margin-bottom: 2px; }
  .sidenav a svg { width: 20px; height: 20px; }
  .sidenav a:hover { background: #fff; }
  .sidenav a.on { background: #fff; color: var(--blue); box-shadow: var(--shadow); }
  .sidenav a.on svg { color: var(--orange); }
  .main { width: calc(100% - 230px); flex: 1; padding-bottom: 40px; }
  .bottomnav { display: none; }
}

/* ---------- Kaarte ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.card h2 { margin-bottom: 10px; }
.card .cardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card .cardhead h2 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 700px) { .grid.g2 { grid-template-columns: 1fr 1fr; } .grid.g3 { grid-template-columns: repeat(3, 1fr); } }
.g3m { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; border-radius: 20px; padding: 18px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--orange); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.hero .muted { color: rgba(255,255,255,.75); }
.hero .stat .label { font-size: 12px; color: rgba(255,255,255,.75); }
.hero .stat .val { font-weight: 700; font-size: 16px; }

.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat .val { font-size: 20px; font-weight: 800; }

/* ---------- Knoppies ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 16px;
  font-weight: 700; cursor: pointer; background: var(--orange); color: #fff; text-decoration: none; min-height: 44px;
  transition: transform .05s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--orange-d); }
.btn svg { width: 18px; height: 18px; }
.btn.blue { background: var(--blue); } .btn.blue:hover { background: var(--blue-d); }
.btn.ghost { background: var(--blue-l); color: var(--blue); } .btn.ghost:hover { background: #dbe7fa; }
.btn.light { background: #fff; color: var(--blue); border: 1px solid var(--line); } .btn.light:hover { background: var(--bg); }
.btn.danger { background: var(--bad-l); color: var(--bad); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--blue-m); font-weight: 600; cursor: pointer; padding: 4px 0; }

/* ---------- Vorms ---------- */
label.f { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; min-height: 44px; font-size: 16px;
}
.input:focus { outline: none; border-color: var(--blue-m); box-shadow: 0 0 0 3px var(--blue-l); }
.inputgroup { display: flex; align-items: stretch; }
.inputgroup .pre { display: grid; place-items: center; padding: 0 10px; background: var(--bg); border: 1.5px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; color: var(--ink-3); font-weight: 700; }
.inputgroup .input { border-radius: 0 12px 12px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); margin-top: 1px; flex: none; }
input[type=range] { width: 100%; accent-color: var(--orange); }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Lyste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list > li.click { cursor: pointer; }
.list > li.click:hover { background: #fafbfd; }
.dot { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.dot svg { width: 18px; height: 18px; }
.prionum svg { width: 16px; height: 16px; }
.daylabel { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; padding: 14px 0 2px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--blue-l); color: var(--blue); vertical-align: middle; }
.badge.or { background: var(--orange-l); color: var(--orange-d); }
.badge.good { background: var(--good-l); color: var(--good); }
.badge.bad { background: var(--bad-l); color: var(--bad); }
.badge.grey { background: var(--bg); color: var(--ink-3); }

.bar { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue-m); border-radius: 99px; }
.bar.or > i { background: var(--orange); }
.bar.good > i { background: var(--good); }
.bar.over > i { background: var(--bad); }

.insight { border-left: 4px solid var(--orange); background: var(--orange-l); padding: 12px 14px; border-radius: 12px; }
.insight.high { border-color: var(--bad); background: var(--bad-l); }
.insight.low { border-color: var(--blue-m); background: var(--blue-l); }
.insight + .insight { margin-top: 10px; }
.insight h3 { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.insight p { margin: 0; font-size: 14px; color: var(--ink-2); }

.note { background: var(--blue-l); color: var(--blue-d); padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.note.or { background: var(--orange-l); color: #7a3a07; }
.note.bad { background: var(--bad-l); color: var(--bad); }

.empty { text-align: center; padding: 30px 16px; color: var(--ink-3); }
.empty svg { width: 54px; height: 54px; color: var(--orange); margin-bottom: 8px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

/* Tydlyn */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 16px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--blue-m); }
.timeline li.debt::before { border-color: var(--orange); }
.timeline li.goal::before { border-color: var(--good); }
.timeline li.free::before { background: var(--orange); border-color: var(--orange); }
.timeline .when { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; }

/* Tabelle */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.best td { background: var(--orange-l); font-weight: 700; }

/* Modals */
.modal-bg { position: fixed; inset: 0; background: rgba(7, 42, 102, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .2s ease-out; }
.modal.wide { max-width: 860px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }
.modal .mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.modal .mfoot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 200; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .2s; }
.toast.err { background: var(--bad); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--blue-l); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; min-height: 60vh; gap: 12px; color: var(--ink-3); }

/* Aanteken */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--blue); }
.auth .top { padding: calc(40px + var(--safe-t)) 24px 30px; color: #fff; text-align: center; position: relative; overflow: hidden; }
.auth .top::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: var(--orange); right: -110px; top: -120px; }
.auth .top > * { position: relative; }
.auth .top svg.logo { width: 64px; height: 64px; }
.auth .top h1 { font-size: 30px; margin: 10px 0 6px; letter-spacing: -.5px; }
.auth .top p { margin: 0; opacity: .85; }
.auth .panel { flex: 1; background: #fff; border-radius: 26px 26px 0 0; padding: 26px 22px calc(26px + var(--safe-b)); }
.auth .inner { max-width: 420px; margin: 0 auto; }
.recovery { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 19px; font-weight: 700; letter-spacing: 1px; background: var(--orange-l); color: var(--blue-d); border: 2px dashed var(--orange); border-radius: 14px; padding: 16px; text-align: center; word-break: break-word; }

/* Gesondheid-ring */
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 28px; display: block; line-height: 1; }

.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.fab { position: fixed; right: 18px; bottom: calc(80px + var(--safe-b)); z-index: 25; width: 56px; height: 56px; border-radius: 18px; background: var(--orange); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(238,118,35,.4); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 28px; } }

.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; background: #fff; transition: .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--orange); background: var(--orange-l); }
.dropzone svg { width: 40px; height: 40px; color: var(--orange); }

.prio { display: flex; flex-direction: column; gap: 2px; }
.prio button { border: 0; background: var(--bg); width: 30px; height: 24px; border-radius: 7px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.prio button:hover { background: var(--blue-l); color: var(--blue); }
.prio svg { width: 16px; height: 16px; }
.prionum { width: 28px; height: 28px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px; flex: none; }

details.acc { border-bottom: 1px solid var(--line); }
details.acc summary { list-style: none; cursor: pointer; padding: 12px 0; display: flex; align-items: center; gap: 12px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc[open] summary { padding-bottom: 6px; }
details.acc .accbody { padding: 0 0 12px 48px; }

/* ---------- Leer-venster ---------- */
.chipwrap { display: flex; flex-wrap: wrap; gap: 6px; }
.catgrid { max-height: 260px; overflow-y: auto; padding-right: 2px; }
.catchip { display: inline-flex; align-items: center; gap: 6px; }
.catchip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.catchip.on i { box-shadow: 0 0 0 2px #fff; }
.splitbox { background: var(--bg); border-radius: 14px; padding: 12px; }
.scopes { display: grid; gap: 8px; }
.scope { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; cursor: pointer; font-size: 14px; }
.scope input[type=radio] { width: 20px; height: 20px; accent-color: var(--orange); margin-top: 1px; flex: none; }
.scope:has(input:checked) { border-color: var(--orange); background: var(--orange-l); }
.scope > span { flex: 1; min-width: 0; }
.colbtn { width: 32px; height: 32px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.colbtn.on { box-shadow: 0 0 0 2px var(--ink); }
.learncard { border: 2px solid var(--orange); }

/* ---------- Installeer, vinnig byvoeg, strokies ---------- */
.installbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--orange); color: #fff; border: 0; border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.installbtn svg { width: 16px; height: 16px; }
@media (max-width: 380px) { .installbtn span { display: none; } }
.bigchoice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 20px 14px; border: 2px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.bigchoice:hover { border-color: var(--orange); background: var(--orange-l); }
.bigchoice svg { width: 36px; height: 36px; color: var(--orange); margin-bottom: 4px; }
.bigchoice span { font-size: 13px; color: var(--ink-3); }
.qamount { display: flex; align-items: center; gap: 6px; border-bottom: 3px solid var(--orange); padding: 4px 2px; margin: 4px 0 16px; }
.qamount span { font-size: 30px; font-weight: 800; color: var(--ink-3); }
.qamount input { border: 0; outline: 0; font-size: 34px; font-weight: 800; width: 100%; background: transparent; color: var(--ink); min-width: 0; }
.qamount input::placeholder { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.qlabel { font-weight: 700; font-size: 13px; color: var(--ink-2); margin: 12px 0 6px; }
.qcats .qmore { appearance: none; -webkit-appearance: none; padding-right: 12px; }
.qpay { margin-bottom: 12px; }
.qrow { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .qrow { grid-template-columns: 1fr 1.4fr; } }
.qphoto { border-radius: 14px; overflow: hidden; background: var(--bg); max-height: 220px; display: flex; justify-content: center; margin-bottom: 10px; }
.qphoto img { max-width: 100%; max-height: 220px; object-fit: contain; }
.duprow { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.duprow .small.muted { width: 100%; }
.duprow.ign { border-style: dashed; background: var(--bg); }
.list > li.ignored { opacity: .55; }
.list > li.ignored b.num { text-decoration: line-through; }
ol.steps { padding-left: 20px; margin: 0 0 12px; }
ol.steps li { margin-bottom: 8px; }
ol.steps svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--blue-m); }

/* Randwys Vinnig (aparte bladsy) */
body.quickpage { background: var(--bg); }
.qhead { background: var(--orange); color: #fff; padding: calc(14px + var(--safe-t)) 16px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qhead b { font-size: 18px; }
.qopen { color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; border: 1.5px solid rgba(255,255,255,.7); padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.qbody { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-b)); }
.qcam { min-height: 56px; font-size: 16px; margin-bottom: 16px; }
.qcam svg { width: 22px; height: 22px; }
.qsave { min-height: 54px; font-size: 17px; margin-top: 10px; }
.qdone { width: 64px; height: 64px; border-radius: 50%; background: var(--good-l); color: var(--good); display: grid; place-items: center; margin: 0 auto 10px; }
.qdone svg { width: 34px; height: 34px; }
