/* Declaratietool — huisstijl Dunamare Maritiem (huisstijlhandboek V2: blauw #6a98b7 + tinten, diep zwart, logo op wit, webletter Barlow) */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/barlow-Regular.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/barlow-Italic.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/barlow-Medium.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/barlow-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/barlow-Bold.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/barlow-BoldItalic.ttf) format("truetype"); }

:root {
  --ink: #100c08;
  --ink-2: #26303a;
  --blue: #6a98b7;
  --blue-dark: #3d6c8c;
  --blue-60: #a6c1d4;  /* 60% blauw (huisstijl) */
  --blue-20: #e1eaf1;  /* 20% blauw (huisstijl) */
  --blue-soft: #edf3f8;
  --blue-line: #c6d7e4;
  --red: #bd1722;
  --bg: #f3f6f9;
  --card: #ffffff;
  --line: #dde5ec;
  --text: #16202a;
  --muted: #5b6671;
  --ok: #1f7a4a;
  --ok-soft: #e4f4ea;
  --warn-soft: #fff5d6;
  --warn-line: #efd488;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 12, 8, .05), 0 6px 20px rgba(16, 30, 45, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--blue-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 600; letter-spacing: 0; }
h1 { font-size: 1.75rem; color: var(--blue); font-weight: 500; }
h2 { color: var(--blue-dark); }
h2 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
[hidden] { display: none !important; }

/* ---------- knoppen & velden ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.05rem; border-radius: 999px; border: 1.5px solid var(--blue-line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.accent { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.accent:hover { background: #335e7b; }
.btn.danger { color: var(--red); border-color: #efc0c3; }
.btn.danger:hover { background: #fdf0f1; }
.btn.link { border: 0; background: none; color: var(--blue-dark); padding: .3rem .2rem; min-height: 0; font-weight: 600; text-decoration: underline; border-radius: 4px; }
.btn.small { min-height: 36px; padding: .3rem .8rem; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #9fc2dc; outline-offset: 2px; }
.btnrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

label { display: block; font-size: .8rem; font-weight: 600; color: #34414d; letter-spacing: .01em; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; min-height: 44px; padding: .55rem .7rem;
  border: 1.5px solid var(--blue-line); border-radius: 8px; background: var(--blue-soft);
  font: inherit; font-size: .95rem; font-weight: 500; color: var(--text);
}
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0 .5rem 0 0; vertical-align: middle; accent-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f5; color: #3b444c; border-color: #e0e5ea; }
input.invalid, select.invalid { border-color: var(--red); background: #fdf0f1; }
.stack > * + * { margin-top: .85rem; }
.grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.grid > * { min-width: 0; }
.grid.pair { grid-template-columns: 1fr 1fr; align-items: end; }
.grid.pair.three > :last-child:nth-child(3) { grid-column: span 2; }
input[type=date] { min-width: 0; }
@supports (-webkit-touch-callout: none) { input[type=date] { -webkit-appearance: none; appearance: none; } }
@media (min-width: 640px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three, .grid.pair.three { grid-template-columns: 1fr 1fr 1fr; }
  .grid.pair.three > :last-child:nth-child(3) { grid-column: auto; }
  .span2 { grid-column: span 2; }
}
.checkline { display: flex; align-items: center; font-weight: 500; font-size: .9rem; }

/* ---------- inlogpagina's ---------- */
body.auth { background: var(--ink); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px;
  background: linear-gradient(180deg, #fff 0%, var(--blue-20) 100%); }
.auth-brand { display: flex; justify-content: center; margin: 4px 0 18px; }
.auth-brand img { width: 176px; max-width: 60vw; height: auto; display: block; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(61,108,140,.18); border: 1px solid var(--blue-line); padding: 28px 24px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--blue) 0 72%, var(--blue-60) 72% 100%); }
.auth-kicker { color: var(--blue-dark); font-weight: 700; margin: 0 0 .25rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.auth-foot { color: var(--blue-dark); font-size: .78rem; margin-top: 18px; text-align: center; }
.checklist { list-style: none; padding: 0; }
.checklist .ok { color: var(--ok); } .checklist .bad { color: var(--red); font-weight: 600; }
.linkbox { word-break: break-all; background: var(--blue-soft); padding: .7rem; border-radius: 8px; }
.totp-box { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 420px) { .totp-box { grid-template-columns: 1fr; } }
.qr svg { width: 150px; height: 150px; display: block; }
.secret { display: inline-block; word-break: break-all; font-size: .95rem; }
.code-input { font-size: 1.4rem; letter-spacing: .25em; text-align: center; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; margin: 1.1rem 0 .8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.passkey { width: 100%; }

/* ---------- meldingen ---------- */
.notice { padding: .75rem .95rem; border-radius: 10px; margin: .8rem 0; font-size: .92rem; border: 1px solid transparent; }
.notice.err { background: #fdeeef; color: #8a111a; border-color: #f2c4c7; }
.notice.ok { background: var(--ok-soft); color: #185c38; border-color: #bfe2cd; }
.notice.warn { background: var(--warn-soft); color: #5c4400; border-color: var(--warn-line); }
.notice.info { background: var(--blue-soft); color: #23425a; border-color: var(--blue-line); }
.notice > :first-child { margin-top: 0; } .notice > :last-child { margin-bottom: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1.15rem; border-radius: 999px; box-shadow: var(--shadow);
  z-index: 60; max-width: calc(100% - 32px); font-size: .9rem; font-weight: 500;
}
.toast.err { background: var(--red); border-radius: 12px; }

/* ---------- app-kader: logo op wit, golf in huisstijlblauw ---------- */
.topbar { background: #fff; color: var(--ink); position: relative; border-bottom: 0; }
.topbar-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: .55rem 16px .2rem; padding-top: calc(.55rem + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 60px; width: auto; display: block; }
.brand-app { border-left: 1px solid var(--blue-line); padding-left: .75rem; font-weight: 500; font-size: 1.05rem; line-height: 1.1; color: var(--blue); letter-spacing: .02em; }
.wave { display: block; width: 100%; height: 18px; margin-top: -2px; }
.wave .w1 { fill: none; stroke: var(--blue); stroke-width: 2.2; }
.wave .w2 { fill: none; stroke: var(--blue-60); stroke-width: 1.6; }
.topnav { display: flex; gap: .15rem; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.topnav .ico { display: none; }
.topnav a, .topnav button {
  font: inherit; font-size: .95rem; font-weight: 500; color: var(--ink); text-decoration: none; background: none; border: 0; white-space: nowrap;
  padding: .45rem .75rem; border-radius: 999px; cursor: pointer; min-height: 38px; display: inline-flex; align-items: center; gap: .35rem;
}
.topnav a:hover, .topnav button:hover { background: var(--blue-20); }
.topnav a.active { background: var(--blue-dark); color: #fff; font-weight: 600; }
.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; align-items: center; justify-content: center; line-height: 1; }
.topnav .short { display: none; }
@media (max-width: 1000px) { .topnav .long { display: none; } .topnav .short { display: inline; } .brand-app { display: none; } }
@media (max-width: 860px) {
  .topbar-in { flex-direction: column; align-items: stretch; gap: .35rem; }
  .brand img { height: 46px; }
  .topnav { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .topnav .logout { margin-left: auto; }
}
@media (max-width: 700px) {
  .topnav { justify-content: flex-start; gap: .1rem; }
  .topnav .logout { margin-left: auto; }
  .topnav a, .topnav button { padding: .4rem .55rem; font-size: .9rem; }
  .topnav .logout .txt { display: none; } .topnav .ico { display: inline; }
}
.container { max-width: 1040px; margin: 0 auto; padding: 10px 16px 90px; }
.loading { padding: 3rem 0; text-align: center; color: var(--muted); }

/* ---------- formulierkop ---------- */
.formhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin: .4rem 0 1rem; }
.formhead h1 { margin: 0; }
.formhead .sub { color: var(--blue-dark); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .2rem; }
.formhead .meta { text-align: right; font-size: .8rem; color: var(--muted); display: grid; gap: .25rem; justify-items: end; }
.chip { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: #eef1f4; color: #36414b; }
.chip.concept { background: #eef1f4; color: #36414b; }
.chip.retour { background: var(--warn-soft); color: #6b4d00; }
.chip.ondertekend { background: var(--blue-soft); color: var(--blue-dark); }
.chip.ingediend { background: #fff0db; color: #8a4b00; }
.chip.goedgekeurd, .chip.doorgestuurd, .chip.afgehandeld { background: var(--ok-soft); color: #185c38; }
.chip.afgewezen { background: #fdeeef; color: var(--red); }
.savestate { font-size: .78rem; color: var(--muted); }
@media (max-width: 700px) {
  .formhead { flex-direction: column; gap: .5rem; }
  .formhead .meta { text-align: left; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
}

/* ---------- secties ---------- */
.section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 1rem; overflow: hidden; border: 1px solid var(--line); }
.section > .sec-h {
  padding: .85rem 1rem .1rem; font-weight: 600; font-size: .86rem; letter-spacing: .1em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--blue-dark);
}
.section > .sec-h::before { content: ""; width: 4px; height: 1.05em; background: var(--blue); border-radius: 2px; margin-right: .1rem; flex: none; }
.section > .sec-h > :first-child { flex: 1; }
.section > .sec-h .small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.section > .sec-b { padding: .75rem 1rem 1rem; }
.section.intro { background: linear-gradient(135deg, #fff 0%, var(--blue-soft) 100%); }
.section.note { background: var(--warn-soft); border-color: var(--warn-line); box-shadow: none; }
.section.note .sec-b { font-size: .86rem; }
.section.action { border: 2px solid var(--blue); }
.section.action > .sec-h::before { background: var(--ink); }
.summary-line { display: flex; justify-content: space-between; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* ---------- uitgaven ---------- */
.line { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .85rem; margin-bottom: .8rem; }
.line-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.line-nr { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex: none; }
.line-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipts { margin-top: .85rem; border-top: 1px dashed var(--blue-line); padding-top: .75rem; }
.receipts-h { font-size: .8rem; font-weight: 600; color: #34414d; margin-bottom: .45rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .55rem; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: #f3f5f7; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pdf { display: flex; height: 100%; align-items: center; justify-content: center; font-weight: 800; color: var(--red); font-size: .85rem; }
.thumb a { display: block; height: 100%; }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(16,12,8,.75); color: #fff; font-size: 16px; line-height: 26px; cursor: pointer; padding: 0; }
.thumb.busy { display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--muted); }
.no-receipt { color: var(--red); font-size: .84rem; font-weight: 500; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 1rem; background: var(--ink); color: #fff; border-radius: 10px; font-weight: 600; }
.total-row .amt { font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; min-height: 0; }

/* ---------- handtekening ---------- */
.sigpad { background: #fff; border: 1.5px dashed #9fb6c8; border-radius: 10px; touch-action: none; width: 100%; height: 180px; display: block; cursor: crosshair; }
.sigimg { background: #fff; border: 1px solid var(--line); border-radius: 10px; max-width: 100%; height: 110px; object-fit: contain; display: block; padding: 6px; }
.sigbox { margin-top: .4rem; }
.sig-pair { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .sig-pair { grid-template-columns: 1fr 1fr; } }
.sig-slot { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; background: #fbfcfd; }
.sig-slot h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .4rem; }

/* ---------- lijsten ---------- */
.cards { display: grid; gap: .6rem; }
.card { display: flex; justify-content: space-between; gap: .8rem; align-items: center; background: #fff; border-radius: 12px; padding: .85rem 1rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 1px solid var(--line); border-left: 4px solid var(--blue); }
.card:hover { border-color: var(--blue); }
.card.retour, .card.ingediend { border-left-color: #e0a100; }
.card.goedgekeurd, .card.doorgestuurd, .card.afgehandeld { border-left-color: var(--ok); }
.card.afgewezen { border-left-color: var(--red); }
.card .t { font-weight: 600; }
.card .m { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.card .amt { font-weight: 700; white-space: nowrap; text-align: right; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); background: #fff; border-radius: 12px; border: 1px dashed var(--blue-line); }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.subhead { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .6rem; font-weight: 700; }
table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
table.list th, table.list td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid #e8edf2; vertical-align: top; }
table.list th { background: var(--ink); color: #fff; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }

.checks { list-style: none; padding: 0; margin: 0 0 .9rem; }
.checks li { padding: .2rem 0; font-size: .9rem; }
.checks li.ok::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.checks li.bad::before { content: "• "; color: var(--red); font-weight: 700; }
.checks li.bad { color: #7a1a1a; }

.options { display: grid; gap: .6rem; }
@media (min-width: 700px) { .options { grid-template-columns: repeat(3, 1fr); } }
.option { border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; }
.option h3 { font-size: .95rem; margin: 0; }
.option p { margin: 0; font-size: .84rem; color: var(--muted); flex: 1; }
.option.recommended { border-color: var(--ink); }

.timeline { list-style: none; padding: 0; margin: 0; font-size: .84rem; }
.timeline li { padding: .35rem 0 .35rem 1rem; border-left: 2px solid var(--blue-line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .7rem; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.timeline .when { color: var(--muted); }
.timeline .note { display: block; background: var(--blue-soft); border-radius: 6px; padding: .35rem .55rem; margin-top: .25rem; white-space: pre-wrap; }

.modal-back { position: fixed; inset: 0; background: rgba(16, 12, 8, .55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 580px; border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 16px; } }
.preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.kd-preview { max-height: 180px; overflow: auto; background: var(--blue-soft); border-radius: 8px; padding: .5rem .7rem; font-size: .84rem; margin: .5rem 0; }

.kp-selects { margin-top: .4rem; }
.kp-chosen { color: var(--ok); font-weight: 600; margin-top: .35rem; }
.kp-readonly { margin-top: .3rem; padding: .55rem .7rem; background: #f1f3f5; border-radius: 8px; font-weight: 500; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.radio-list { display: grid; gap: .45rem; }
.radio-list .checkline { font-size: .95rem; }

/* ---------- v2.2: waarvoor + soort kosten ---------- */
.wv-picker optgroup { font-weight: 700; }
.wv-hint { margin-top: .35rem; min-height: 1em; }
.wv-result { margin-top: .45rem; color: var(--muted); }
.wv-result .ok { color: var(--ok); font-weight: 600; }
.wv-picker label[hidden] { display: none; }
.tag { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--blue-soft); color: var(--blue-dark); border: 1px solid var(--blue-line); }
.tag.warn { background: var(--warn-soft); color: #7a5a00; border-color: var(--warn-line); }
table.list.small td, table.list.small th { font-size: .85rem; padding-top: .35rem; padding-bottom: .35rem; }

/* ---------- v2.3: wacht op jou, vragen, formulieren per project, mobiel ---------- */
.section.todo { border-left: 4px solid var(--blue); }
.section.todo .sec-h { display: flex; align-items: center; gap: .5rem; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li + li { border-top: 1px solid var(--line); }
.todo-list a { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .2rem; text-decoration: none; color: var(--text); min-height: 44px; }
.todo-list a:hover { background: var(--blue-soft); }
.todo-why { font-weight: 700; color: var(--ink); }
.todo-why::after { content: ' ›'; color: var(--blue-dark); }
.todo-what { font-size: .88rem; color: var(--muted); }
.wv-vraag { margin-top: .35rem; padding: .4rem .6rem; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; font-size: .88rem; }
.apart-box .checkline { margin-top: .3rem; }
.parts-links { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.ask-row { border-top: 1px dashed var(--line); margin-top: .9rem; }
.chip.vraag { background: var(--warn-soft); color: #7a5a00; }
.card.vraag { border-left-color: var(--warn-line); }
input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; width: 100%; }

/* Telefoon: grotere tikvlakken, knoppen over de volle breedte in actiepanelen, geen horizontaal scrollen. */
@media (max-width: 640px) {
  select, input, textarea { font-size: 16px; } /* voorkomt inzoomen op iPhone */
  .section.action .btnrow > .btn, .section.action .btnrow > button { flex: 1 1 100%; justify-content: center; }
  .parts-links { width: 100%; }
  .parts-links .btn { flex: 1 1 100%; justify-content: center; }
  .modal { max-height: 92vh; overflow: auto; }
  .wv-picker .grid.two { grid-template-columns: 1fr; }
}
/* Veilige marge onder op iPhone (thuisbalk) in de geïnstalleerde app. */
@supports (padding: env(safe-area-inset-bottom)) {
  body.app { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 480px) {
  .topnav { gap: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a, .topnav button { padding: .4rem .42rem; font-size: .8rem; }
  .topnav .badge { min-width: 17px; height: 17px; font-size: .66rem; padding: 0 4px; margin-left: 2px; }
}
.notice, .kp-readonly, .wv-result { overflow-wrap: anywhere; }
.sec-b { overflow-wrap: break-word; }

/* v2.4 associatief kiezen */
.wv-sug { margin: 0 0 .7rem; padding: .55rem .6rem .45rem; border: 1px dashed var(--blue-line); border-radius: 10px; background: var(--blue-soft); }
.wv-sug[hidden], .wv-learn[hidden] { display: none; }
.wv-sug-h { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.wv-sug-f { margin-top: .2rem; }
.sug { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .05rem; margin: 0 .35rem .35rem 0; padding: .4rem .65rem; border: 1px solid var(--blue-line);
  border-radius: 9px; background: #fff; color: inherit; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; max-width: 100%; }
.sug:hover, .sug:focus-visible { border-color: var(--blue-dark); box-shadow: 0 0 0 2px rgba(61,108,140,.18); outline: none; }
.sug strong { font-weight: 600; overflow-wrap: anywhere; }
.sug-sub { font-size: .78rem; color: var(--muted); }
.sug.small { display: inline-block; padding: .25rem .55rem; font-size: .82rem; }
.sug:disabled { opacity: .5; cursor: default; }
.sug-group { margin: 0 0 .35rem; }
.sug-label { display: block; font-size: .88rem; margin-bottom: .25rem; }
.wv-learn { margin-top: .45rem; }
.wv-learn .sug.small { margin: .2rem .25rem 0 0; }
@media (max-width: 480px) { .sug { display: flex; width: 100%; margin-right: 0; } .sug.small { display: inline-block; width: auto; } }

/* v2.5 pilotfeedback, opmerkingen */
.fb-btn { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border: 0; border-radius: 99px;
  background: var(--ink); color: #fff; font: inherit; font-size: .88rem; font-weight: 600; box-shadow: 0 4px 14px rgba(16,12,8,.25); cursor: pointer; }
.fb-btn:hover, .fb-btn:focus-visible { background: var(--blue-dark); outline: none; }
.fb-btn:disabled { opacity: .6; }
.fb-btn svg { fill: currentColor; }
body.has-fb main { padding-bottom: 4.5rem; }
@media (max-width: 480px) { .fb-btn { right: 12px; bottom: 12px; padding: .6rem; } .fb-btn span { display: none; } }
@media print { .fb-btn { display: none !important; } }
.modal.wide { max-width: min(960px, calc(100vw - 24px)); width: 100%; }
.fb-modal h2 { margin-top: 0; }
.fb-kinds { margin: .2rem 0 .7rem; }
.fb-tools { margin: .5rem 0 .4rem; }
.fb-shot[hidden] { display: none; }
.fb-canvas-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.fb-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.fb-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; margin-bottom: .7rem; }
.fb-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.fb-card-b { display: flex; gap: .8rem; align-items: flex-start; }
.fb-thumb { flex: 0 0 180px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: block; }
.fb-thumb img { display: block; width: 100%; height: auto; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-card-a { display: grid; grid-template-columns: 170px 1fr auto; gap: .6rem; align-items: end; margin-top: .7rem; }
@media (max-width: 640px) { .fb-card-b { flex-direction: column; } .fb-thumb { flex-basis: auto; width: 100%; } .fb-card-a { grid-template-columns: 1fr; } }
.linkbtn { background: none; border: 0; padding: .2rem 0; color: var(--blue-dark); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.line-opm { margin-top: .4rem; }
.decl-opm { margin-top: .85rem; padding: .5rem .7rem; background: var(--blue-soft); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; }

/* v3.0 aanvragen, projectindeling, al vergoed, concept-watermerk */
.afile { display: flex; flex-direction: column; gap: .25rem; width: 120px; }
.afile .thumb { width: 120px; height: 90px; }
.aanv-pick { margin-top: .6rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.aanv-opt { align-items: flex-start; padding: .25rem 0; }
.aanv-linked { margin-top: .5rem; display: grid; gap: .5rem; }
.aanv-linked-i { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.aanv-linked-i.open { border-color: var(--warn, #e0a100); }
.indeling { margin-top: .55rem; }
.section.al-vergoed { border-color: var(--red); }
#app.wm-concept { position: relative; }
#app.wm-concept::before { content: 'CONCEPT'; display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-35deg);
  font-size: min(22vw, 220px); font-weight: 800; letter-spacing: .08em; color: rgba(110, 120, 130, .10); pointer-events: none; z-index: 5; white-space: nowrap; }
#app.wm-concept.wm-screen::before { display: block; }
@media print { #app.wm-concept::before { display: block; color: rgba(110, 120, 130, .22); } }

/* v3.1 startscherm, meekijken, beheer */
.start-head { align-items: flex-end; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 0 0 1rem; }
.stat { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .85rem 1rem; border-top: 4px solid var(--blue-60); }
.stat:hover { border-color: var(--blue); }
.stat.hot { border-top-color: var(--red); }
.stat-n { font-size: 2rem; font-weight: 600; line-height: 1; color: var(--blue-dark); display: flex; align-items: center; gap: .45rem; }
.stat.hot .stat-n { color: var(--red); }
.stat-l { font-weight: 600; margin-top: .3rem; }
.stat-s { font-size: .82rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr 1fr; gap: .45rem; } .stat { padding: .6rem .6rem; } .stat-n { font-size: 1.5rem; } .stat-s { display: none; } .stat-l { font-size: .82rem; } }
.start-list { list-style: none; margin: 0; padding: 0; }
.start-list li + li { border-top: 1px solid var(--line); }
.start-list a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main amt" "why amt"; gap: .1rem .8rem; padding: .55rem .2rem; text-decoration: none; color: var(--ink); }
.start-list a:hover { background: var(--blue-20); }
.sr-main { grid-area: main; font-weight: 600; overflow-wrap: anywhere; }
.sr-ref { color: var(--blue-dark); font-weight: 600; font-size: .86rem; }
.sr-why { grid-area: why; font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.sr-amt { grid-area: amt; align-self: center; font-weight: 600; white-space: nowrap; }
.viewas-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem; padding: .5rem 16px;
  background: #e8890c; color: #1b1100; font-size: .92rem; }
.viewas-bar .btn { background: #fff; border-color: #fff; }
.btnrow.nowrap { flex-wrap: nowrap; }
tr.dim td { opacity: .55; }
select.mini { min-height: 32px; padding: .2rem .4rem; font-size: .82rem; width: auto; }
h1 { color: var(--blue); }
.formhead h1 { color: var(--blue); }
.line-nr { background: var(--blue-dark); }

/* v3.1.2: concepten opruimen */
.trash-wrap { display: flex; align-items: stretch; gap: .4rem; }
.trash-wrap > .card { flex: 1; min-width: 0; }
.trash { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; padding: 0; }
.trash:hover, .trash:focus-visible { color: var(--red); border-color: #efc0c3; background: #fdf0f1; }
.start-list li.has-trash { display: flex; align-items: center; gap: .4rem; }
.start-list li.has-trash > a { flex: 1; min-width: 0; }
.start-list li.has-trash > .trash { width: 36px; min-height: 36px; }
.subhead.with-act { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.sec-h-act { display: inline-flex; align-items: center; gap: .6rem; }
.sec-h-act .btn.small { min-height: 30px; padding: .15rem .7rem; font-size: .8rem; text-transform: none; letter-spacing: 0; }
.cleanup-list { border: 1px solid var(--line); border-radius: 10px; max-height: 50vh; overflow: auto; margin-top: .5rem; }
.cleanup-row { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; align-items: center; padding: .55rem .7rem; cursor: pointer; font-weight: 400; margin: 0; }
.cleanup-row + .cleanup-row { border-top: 1px solid var(--line); }
.cleanup-row:hover { background: var(--blue-20); }
.cleanup-row .cr-main { display: flex; flex-direction: column; min-width: 0; }
.cleanup-row .cr-amt { font-weight: 700; white-space: nowrap; }
.cleanup-row input { width: 18px; height: 18px; }

/* v3.2: berichten */
.bericht-card .t { display: flex; align-items: center; gap: .45rem; }
.bericht-card:not(.unread) .t { font-weight: 500; }
.bericht-card.unread { border-left-color: var(--red); }
.bericht-title { margin: 0 0 .2rem; font-size: 1.45rem; }
.bericht-body { font-size: 1rem; line-height: 1.6; max-width: 68ch; }
.bericht-body h2 { font-size: 1.15rem; color: var(--blue-dark, #3d6c8c); margin: 1.2rem 0 .4rem; text-transform: none; letter-spacing: 0; }
.bericht-body h3 { font-size: 1rem; margin: 1rem 0 .3rem; }
.bericht-body p { margin: 0 0 .8rem; }
.bericht-body ul, .bericht-body ol { margin: 0 0 .8rem; padding-left: 1.4rem; }
.bericht-body blockquote { margin: 0 0 .8rem; padding: .5rem .9rem; border-left: 3px solid var(--blue); background: var(--blue-20); }
.bericht-body a:not(.btn) { color: var(--blue-dark, #3d6c8c); }
.bericht-sign { white-space: pre-line; margin-top: 1.2rem !important; }
.bericht-files { margin-top: 1rem; display: grid; gap: .35rem; }
.bericht-file { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.bericht-new .sec-h { color: var(--red); }
.rich-wrap { border: 1px solid var(--line); border-radius: 10px; margin-top: .7rem; background: #fff; overflow: hidden; }
.rich-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-20); }
.rich-bar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; border-bottom: 1px solid var(--line); background: #f7fafc; }
.rich-bar .tb { border: 1px solid transparent; background: transparent; border-radius: 7px; padding: .3rem .55rem; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); min-height: 32px; }
.rich-bar .tb:hover { background: var(--blue-20); border-color: var(--line); }
.rich-bar .tb.b { font-weight: 800; } .rich-bar .tb.i { font-style: italic; } .rich-bar .tb.u { text-decoration: underline; }
.rich { min-height: 220px; max-height: 60vh; overflow: auto; padding: .8rem 1rem; outline: none; line-height: 1.6; font-size: 1rem; }
.rich h2 { font-size: 1.15rem; color: #3d6c8c; margin: .9rem 0 .3rem; text-transform: none; letter-spacing: 0; }
.rich h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
.rich p { margin: 0 0 .6rem; }
.rich ul, .rich ol { padding-left: 1.4rem; margin: 0 0 .6rem; }
.rcpt-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .4rem 1.2rem; }
.rcpt-people { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .3rem .6rem; margin-top: .4rem; }
.rcpt-people .checkline { margin: .2rem 0; }
.rcpt-sum { margin-top: .8rem; padding: .6rem .8rem; border-radius: 10px; background: var(--blue-20); font-size: .9rem; }
.mail-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #f3f6f9; }
.bericht-preview .mail-frame { height: 640px; }
.modal.wide { max-width: 760px; }
.progress { height: 10px; border-radius: 99px; background: var(--blue-20); overflow: hidden; margin: .4rem 0 .8rem; }
.progress-in { height: 100%; background: var(--blue); transition: width .3s; }
.rcpt-groups .checkline .small, .rcpt-people .checkline .small { margin-left: .35rem; }

/* v3.3: declaratie naar de administratie */
.mail-meta { display: grid; gap: .25rem; margin: 0 0 .9rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #f7fafc; font-size: .9rem; }
.mail-meta > div { display: grid; grid-template-columns: 96px 1fr; gap: .6rem; align-items: baseline; }
.mail-meta .mm-l { color: var(--muted); font-size: .8rem; }
.sent-mails { display: grid; gap: .5rem; }
.sent-mail { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.manual-send { margin-top: .9rem; }
.manual-send summary { cursor: pointer; color: var(--blue-dark); font-size: .9rem; margin-bottom: .5rem; }

/* v3.4: bon en betaalbewijs apart */
.receipts-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .9rem; }
.receipts-pair .receipts { margin-top: 0; }
.receipts-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .78rem; }
.receipts.pay { border-left: 2px solid var(--blue-20); padding-left: .8rem; }
.receipts.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 60% { background: #fff3cd; } 100% { background: transparent; } }
.no-receipt.warn { color: #7a5600; }
.checks li.warn::before { content: "! "; color: #b07a00; font-weight: 700; }
.checks li.warn { color: #7a5600; }
@media (max-width: 700px) { .receipts-pair { grid-template-columns: 1fr; } .receipts.pay { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line); padding-top: .7rem; } }
.no-receipt.soft { color: #7a5600; }
