:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --border: #e5e2da;
  --text: #2a2724;
  --muted: #6f6a62;
  --primary: #6b1e2a;
  --primary-dark: color-mix(in srgb, var(--primary) 70%, black);
  --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
  --accent: #c9a24a;
  --green: #3a7d44;
  --green-soft: #e6f3e8;
  --amber: #b87b2a;
  --amber-soft: #fbf0dc;
  --blue: #2b5d99;
  --blue-soft: #e6eef9;
  --red: #a52a2a;
  --red-soft: #f8e6e6;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-size: .85em; }

h1, h2, h3 { font-family: var(--font-heading, Georgia, "Times New Roman", serif); font-weight: 600; }
.brand-text strong, .stat-value { font-family: var(--font-heading, Georgia, "Times New Roman", serif); }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--primary); }

/* Topbar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .75rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  background: var(--primary); color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.brand-mark.big { width: 60px; height: 60px; font-size: 2rem; margin: 0 auto 1rem; }
.brand-mark.has-custom-logo { background: transparent; padding: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }

/* Compact-modus + vierkante hoeken */
body.ui-compact { font-size: 14px; }
body.ui-compact .card { padding: .9rem 1.1rem; margin-bottom: 1rem; }
body.ui-compact h1 { font-size: 1.4rem; }
body.ui-compact h2 { font-size: 1.05rem; }
body.ui-compact .table th, body.ui-compact .table td { padding: .45rem .55rem; }
body.ui-square .card,
body.ui-square .login-form-wrap input,
body.ui-square .splash-card,
body.ui-square .btn,
body.ui-square input,
body.ui-square select,
body.ui-square textarea,
body.ui-square .stat-card,
body.ui-square .kist-card { border-radius: 2px; }
body.ui-square .brand-mark { border-radius: 4px; }
body.ui-square .badge, body.ui-square .status, body.ui-square .offline-badge { border-radius: 3px; }
.brand-text strong { display: block; font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: .78rem; }

.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a { color: var(--text); padding: .5rem .85rem; border-radius: var(--radius); font-size: .92rem; }
.topnav a:hover { background: var(--bg); text-decoration: none; }
.topnav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.user-area { display: flex; align-items: center; gap: .75rem; }
.user-name { color: var(--muted); font-size: .9rem; }

/* Layout */
.main { padding: 1.5rem 1.25rem 3rem; }
.page { max-width: 1200px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.back-link { font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: .5rem; }
.footer { padding: 2rem 1rem; text-align: center; }
.footer-inner { color: var(--muted); font-size: .82rem; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.card.narrow { max-width: 560px; }
.card.center { text-align: center; }
fieldset.card { border: 1px solid var(--border); }
fieldset.card legend {
  background: var(--primary); color: #fff;
  padding: .25rem .75rem; border-radius: 4px;
  font-size: .85rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-card.stat-blue { border-left-color: var(--blue); }
.stat-card.stat-amber { border-left-color: var(--amber); }
.stat-card.stat-green { border-left-color: var(--green); }
.stat-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 600; font-family: Georgia, serif; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 1.25rem; }
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .grid-3 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.full { display: block; width: 100%; }

/* Forms */
.form { gap: 1rem; display: flex; flex-direction: column; }
.form label, fieldset.card label, .grid-3 label, .grid-2 label {
  display: flex; flex-direction: column; gap: .25rem;
  font-size: .82rem; color: var(--muted);
  min-width: 0;
}
.form input, .form select,
fieldset.card input, fieldset.card select,
.row-form input, .row-form select {
  box-sizing: border-box;
  height: 2.6rem;
  padding: 0 .65rem;
  line-height: 1.3;
  font: inherit;
  font-size: 16px; /* voorkomt zoom-bij-tap op iOS én uniforme hoogte */
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff; color: var(--text);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
/* Selects krijgen een eigen dropdown-pijl zodat appearance:none geen lege styling geeft */
.form select, fieldset.card select, .row-form select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4 L5 7 L8 4' stroke='%236f6a62' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  padding-right: 1.65rem;
}
.form textarea, fieldset.card textarea, .row-form textarea {
  box-sizing: border-box;
  padding: .6rem .7rem;
  line-height: 1.5;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff; color: var(--text);
  width: 100%;
  min-height: 4.5rem;
}
input[type="color"] {
  height: 38px;
  padding: 2px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
}
input[type="file"] {
  height: auto;
  padding: .35rem;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
textarea { resize: vertical; }

.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

.row-form { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.row-form > * { flex: 1; min-width: 140px; }
.row-form button { flex: 0 0 auto; }
.checkbox-inline { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; }
.checkbox-inline input { width: auto; }

/* Form-dichtheid (instelbaar via Settings) — alle inputs/selects krijgen
   een uniforme hoogte; alleen die en padding/spacing variëren */

body.density-compact .grid-3 { gap: 1rem .85rem; }
body.density-compact .form { gap: .75rem; }
body.density-compact fieldset.card { padding: 1rem 1.25rem; }
body.density-compact .form input,
body.density-compact .form select,
body.density-compact fieldset.card input,
body.density-compact fieldset.card select,
body.density-compact .row-form input,
body.density-compact .row-form select { height: 2.3rem; padding: 0 .55rem; font-size: 15px; }
body.density-compact .form textarea,
body.density-compact fieldset.card textarea,
body.density-compact .row-form textarea { padding: .45rem .55rem; font-size: 15px; min-height: 3.6rem; }

/* density-normaal = default styles, geen overrides nodig */

body.density-ruim .grid-3 { gap: 1.85rem 1.25rem; }
body.density-ruim .form { gap: 1.25rem; }
body.density-ruim fieldset.card { padding: 1.5rem 1.75rem; }
body.density-ruim .form input,
body.density-ruim .form select,
body.density-ruim fieldset.card input,
body.density-ruim fieldset.card select,
body.density-ruim .row-form input,
body.density-ruim .row-form select { height: 3rem; padding: 0 .85rem; font-size: 16px; }
body.density-ruim .form textarea,
body.density-ruim fieldset.card textarea,
body.density-ruim .row-form textarea { padding: .75rem .85rem; font-size: 16px; min-height: 5rem; }
body.density-ruim .form label, body.density-ruim fieldset.card label { gap: .4rem; }

body.density-extraruim .grid-3 { gap: 2.25rem 1.5rem; }
body.density-extraruim .form { gap: 1.5rem; }
body.density-extraruim fieldset.card { padding: 1.75rem 2rem; }
body.density-extraruim .form input,
body.density-extraruim .form select,
body.density-extraruim fieldset.card input,
body.density-extraruim fieldset.card select,
body.density-extraruim .row-form input,
body.density-extraruim .row-form select { height: 3.4rem; padding: 0 1rem; font-size: 17px; }
body.density-extraruim .form textarea,
body.density-extraruim fieldset.card textarea,
body.density-extraruim .row-form textarea { padding: .9rem 1rem; font-size: 17px; min-height: 6rem; }
body.density-extraruim .form label, body.density-extraruim fieldset.card label { gap: .5rem; font-size: .9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem; padding: .5rem 1rem;
  border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text);
  font: inherit; font-size: .9rem;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #8b1f1f; }
.btn-block { width: 100%; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-icon { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 .35rem; line-height: 1; }
.btn-icon:hover { color: var(--red); }

/* Filter bar */
.filter-bar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 6px; }
.filter-bar input { flex: 1; min-width: 220px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tbody tr:hover { background: var(--bg); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.total-row td { background: var(--bg); border-top: 2px solid var(--border); }

/* Badges & status */
.badge { display: inline-block; padding: .15rem .55rem; background: var(--bg); color: var(--muted); border-radius: 999px; font-size: .75rem; border: 1px solid var(--border); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.status { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.status-nieuw { background: var(--blue-soft); color: var(--blue); }
.status-in_behandeling { background: var(--amber-soft); color: var(--amber); }
.status-voltooid { background: var(--green-soft); color: var(--green); }
.status-geannuleerd { background: var(--red-soft); color: var(--red); }

/* Inline status-select op detailpagina */
.status-inline {
  display: inline-block;
  padding: .15rem 1.4rem .15rem .65rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4 L5 7 L8 4' stroke='%23555' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right .4rem center;
}
.status-inline:hover { filter: brightness(.97); }
.status-inline.status-nieuw { background-color: var(--blue-soft); color: var(--blue); }
.status-inline.status-in_behandeling { background-color: var(--amber-soft); color: var(--amber); }
.status-inline.status-voltooid { background-color: var(--green-soft); color: var(--green); }
.status-inline.status-geannuleerd { background-color: var(--red-soft); color: var(--red); }

/* Kosten-toggles (gedekt / betaald) — gekleurde pillen */
.kost-toggle {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s, transform .1s;
  font-family: inherit;
  line-height: 1.3;
}
.kost-toggle:hover { filter: brightness(.96); }
.kost-toggle:active { transform: scale(.97); }
.kost-toggle.on-betaald { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.kost-toggle.off-betaald { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.kost-toggle.on-gedekt { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.kost-toggle.off-gedekt { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.table .center { text-align: center; }

/* Scan-preview na auto-crop */
.scan-preview {
  display: flex; gap: 1rem; align-items: center;
  margin-top: .75rem; padding: .75rem;
  border: 1px solid var(--green);
  background: var(--green-soft);
  border-radius: 8px;
}
.scan-preview img {
  width: 110px; height: 140px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.scan-preview-meta {
  display: flex; flex-direction: column; gap: .25rem; flex: 1;
}
.scan-preview-meta strong { color: var(--green); }
.scan-preview-actions { display: flex; gap: .35rem; margin-top: .35rem; flex-wrap: wrap; }

/* Rouwkaart-pagina */
.rouwkaart-page { padding: 1rem; }
.rouwkaart-doc {
  max-width: 460px; margin: 0 auto;
}
.rouwkaart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  color: #2a2724;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.rk-cross { font-size: 2.5rem; color: var(--primary); margin-bottom: .5rem; }
.rk-intro { font-style: italic; color: var(--muted); margin: .25rem 0 1rem; font-size: .95rem; }
.rk-foto {
  width: 140px; height: 170px;
  margin: 0 auto 1rem;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.rk-foto img { width: 100%; height: 100%; object-fit: cover; }
.rk-naam {
  font-size: 1.6rem; font-weight: 600; margin: .5rem 0 .15rem;
  font-family: Georgia, serif; border: none; padding: 0;
}
.rk-doopnaam { font-style: italic; color: var(--muted); margin-bottom: .85rem; }
.rk-data {
  margin: 1rem 0; font-size: 1rem; line-height: 1.7;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: .85rem 0;
}
.rk-symbol { color: var(--primary); font-weight: 600; display: inline-block; width: 1.2em; }
.rk-uitvaart { margin: 1rem 0; font-size: .9rem; line-height: 1.55; }
.rk-uitvaart p { margin: .35rem 0; }
.rk-familie { margin-top: 1rem; font-style: italic; color: var(--muted); }
.rk-footer {
  margin-top: 1.5rem; font-size: .7rem; color: #999;
  border-top: 1px solid var(--border); padding-top: .75rem;
}

@media print {
  body { background: #fff !important; }
  .topbar, .footer, .no-print { display: none !important; }
  .rouwkaart-page { padding: 0; margin: 0; }
  .rouwkaart-card { border: none; box-shadow: none; }
  @page { size: A5; margin: 1cm; }
}

/* Quick-contact knoppen onder Contactpersoon */
.quick-contact {
  display: flex; gap: .4rem; flex-wrap: wrap;
  margin: -.25rem 0 .85rem;
}
.quick-contact .btn { flex: 0 0 auto; }

/* Definition list */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .5rem 1.5rem; margin: 0 0 1rem; }
.dl > div { display: flex; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.dl dt { color: var(--muted); flex: 0 0 40%; font-size: .85rem; }
.dl dd { margin: 0; flex: 1; }

/* Tabs */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: .5rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; font-size: .9rem; }
.tabs a:hover { color: var(--primary); text-decoration: none; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.list li:last-child { border-bottom: none; }
.list-link strong { color: var(--text); }

.taken-list { list-style: none; padding: 0; margin: 0; }
.taken-list li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.taken-list li.voltooid .taak-tekst { text-decoration: line-through; color: var(--muted); }
.check {
  background: #fff; border: 1.5px solid var(--border); border-radius: 50%;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .85rem; color: var(--muted);
}
.check.small { width: 20px; height: 20px; font-size: .75rem; }
.taken-list li.voltooid .check { background: var(--green); color: #fff; border-color: var(--green); }
.taak-tekst { flex: 1; }
.right { margin-left: auto; }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { padding: .55rem 0; display: flex; align-items: center; gap: .65rem; border-bottom: 1px dashed var(--border); }
.doc-list a, .doc-list .link-btn { font-weight: 500; color: var(--primary); background: none; border: none; padding: 0; font-size: inherit; cursor: pointer; text-align: left; }
.doc-list .link-btn:hover { text-decoration: underline; }
.doc-list .doc-info { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 auto; min-width: 0; }
.doc-list .doc-info > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.doc-list .doc-thumb-btn {
  flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); overflow: hidden; cursor: zoom-in;
  display: flex; align-items: center; justify-content: center;
}
.doc-list .doc-thumb-btn:hover { border-color: var(--primary); }
.doc-list .doc-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-list .doc-icon {
  flex: 0 0 auto; width: 56px; height: 56px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}

.notitie-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.notitie-list li { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .75rem 1rem; margin-bottom: .5rem; }
.notitie-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .35rem; }
.prewrap { white-space: pre-wrap; word-wrap: break-word; }

/* Login — split-screen, vast op het scherm (geen scroll) */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: stretch;
  background: var(--bg);
  overflow: hidden;
}
body:has(#login-screen:not([hidden])) { overflow: hidden; }
.login-brand {
  flex: 1 1 50%;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 4vw, 3.5rem);
  display: flex; align-items: stretch;
}
.login-brand-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: clamp(1rem, 3vh, 2rem);
  width: 100%; max-width: 540px;
}
.login-brand-head { display: flex; align-items: center; gap: 1rem; }
.login-brand .brand-mark.big {
  margin: 0; width: 56px; height: 56px; font-size: 1.7rem;
  background: rgba(255,255,255,.18); color: #fff;
  backdrop-filter: blur(2px);
}
.login-brand .brand-mark.has-custom-logo { background: rgba(255,255,255,.96); }
.login-brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.login-brand-name strong { font-size: 1rem; font-weight: 700; }
.login-brand-name span { font-size: .85rem; opacity: .8; }

.login-brand-body { margin-top: auto; }
.login-brand-body h1 {
  margin: 0 0 .65rem; font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700; line-height: 1.15; color: #fff;
}
.login-brand-body p {
  margin: 0 0 1.25rem; font-size: clamp(.9rem, 1.1vw, 1rem); line-height: 1.5;
  opacity: .9; max-width: 32em;
}
.login-brand-features {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .55rem;
}
.login-brand-features li {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .95rem; line-height: 1.45; opacity: .92;
}
.login-brand-features li::before {
  content: "✓";
  flex: 0 0 1.4rem; height: 1.4rem; line-height: 1.4rem; text-align: center;
  font-weight: 700; font-size: .9rem;
  color: #fff;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  margin-top: .05rem;
}
.login-brand-foot {
  margin: clamp(1rem, 3vh, 2rem) 0 0; font-size: .8rem; opacity: .65;
}
.login-brand-orb {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none; z-index: 1;
}
.login-brand-orb-1 { width: 520px; height: 520px; top: -160px; left: -120px; }
.login-brand-orb-2 { width: 360px; height: 360px; bottom: -120px; right: -100px; opacity: .6; }

.login-form-pane {
  flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 3vh, 2.5rem) clamp(1.25rem, 3vw, 2rem);
  background: #fff;
  overflow-y: auto; /* alleen het form-paneel mag intern scrollen als 't echt te krap is */
}
.login-form-wrap { width: 100%; max-width: 420px; }
.login-form-wrap h2 {
  margin: 0 0 .3rem; padding: 0; border: none;
  font-size: 1.5rem; font-weight: 700; color: var(--text);
}
.login-form-sub { margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; }
.login-form-wrap .form label > span { font-size: .9rem; font-weight: 600; color: var(--text); }
.login-form-wrap .form input { padding: .75rem .9rem; font-size: 1rem; }
.login-actions { display: flex; gap: .5rem; margin-top: .25rem; }
.login-actions .btn-block { flex: 1 1 auto; }
.login-actions .btn-ghost { flex: 0 0 auto; min-width: 90px; }
.login-form-foot {
  margin-top: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .5rem;
  font-size: .88rem;
}
.login-form-foot a { font-weight: 600; }

@media (max-width: 880px) {
  .login-screen { flex-direction: column; }
  .login-brand {
    flex: 0 0 auto; padding: 1.25rem 1.25rem;
  }
  .login-brand-inner { gap: .85rem; max-width: none; }
  .login-brand-body h1 { font-size: 1.45rem; margin-bottom: .35rem; }
  .login-brand-body p { font-size: .9rem; margin-bottom: .65rem; }
  .login-brand-features { gap: .35rem; }
  .login-brand-features li { font-size: .85rem; }
  .login-brand-foot, .login-brand-orb { display: none; }
  .login-form-pane {
    flex: 1 1 auto; padding: 1.25rem 1.25rem;
  }
  .login-form-wrap { max-width: 460px; }
}
/* Echt korte schermen: bullets/onderschrift verbergen om alles passend te houden */
@media (max-width: 880px) and (max-height: 600px) {
  .login-brand-body p,
  .login-brand-features { display: none; }
}

/* WheelDate — eigen dag/maand/jaar wiel-picker (overal i.p.v. native) */
.wheeldate-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
  transition: opacity .2s ease;
}
.wheeldate-overlay.shown { pointer-events: auto; opacity: 1; }
.wheeldate-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.wheeldate-card {
  position: relative;
  background: #2c2c2e; color: #fff;
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  width: 360px; max-width: calc(100vw - 1.5rem);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  transform: scale(.96);
  transition: transform .2s ease;
}
.wheeldate-overlay.shown .wheeldate-card { transform: scale(1); }
.wheeldate-title {
  text-align: center; font-size: .9rem; font-weight: 500;
  color: rgba(255,255,255,.55);
  margin-bottom: .5rem; letter-spacing: .02em;
}
.wheeldate-wheels {
  position: relative;
  display: flex; gap: .25rem;
  height: 220px;            /* 5 × 44 px */
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.wheeldate-band {
  position: absolute;
  top: 50%; left: .25rem; right: .25rem;
  transform: translateY(-50%);
  height: 44px;
  background: rgba(255,255,255,.10);
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
}
.wheeldate-wheel {
  flex: 1 1 0; height: 100%;
  list-style: none; margin: 0; padding: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
}
.wheeldate-wheel::-webkit-scrollbar { display: none; }
.wheeldate-wheel-month { flex: 1.4 1 0; }
.wheeldate-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.4);
  transition: color .15s ease, transform .15s ease;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.wheeldate-item.selected {
  color: #fff; font-weight: 600;
  transform: scale(1.04);
}
.wheeldate-spacer { pointer-events: none; }
.wheeldate-actions {
  display: flex; gap: .5rem; margin-top: .85rem;
}
.wheeldate-actions .btn { flex: 1 1 auto; padding: .65rem .9rem; }
.wheeldate-actions .wd-clear { flex: 0 0 auto; min-width: 64px; }
.wheeldate-actions .btn-ghost {
  background: rgba(255,255,255,.08); color: #fff; border-color: transparent;
}
.wheeldate-actions .btn-ghost:hover { background: rgba(255,255,255,.14); }

/* Zichtbare wiel-datum-display: voelt klikbaar, niet als gedimde readonly */
input[data-wheel-display-for] {
  background: #fff; cursor: pointer; opacity: 1; caret-color: transparent;
}
input[data-wheel-display-for]:focus {
  outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary);
}

/* Postcode-autofill hint */
.pcode-hint {
  display: block; margin-top: .25rem;
  color: var(--green); opacity: 0;
  transform: translateY(-2px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.pcode-hint.pcode-hint-show { opacity: 1; transform: translateY(0); }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.alert-error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.alert-success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.alert-info { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

/* Kist-preview naast dropdown */
.kist-picker {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: .75rem;
  align-items: start;
}
@media (max-width: 720px) {
  .kist-picker { grid-template-columns: 1fr; }
}
.kist-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafaf6;
  padding: .5rem;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.kist-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 110px;
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
}
.kist-img {
  width: 100%;
  aspect-ratio: 12/7;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  display: block;
  padding: 4px;
}
.kist-img svg { width: 100%; height: 100%; display: block; }
.kist-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kist-meta { display: flex; flex-direction: column; gap: .1rem; padding: .15rem .25rem .25rem; }
.kist-meta strong { font-size: .9rem; color: var(--text); }
.kist-price { color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .9rem; }

.kist-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Inline kist-thumb in overzicht */
.kist-thumb-inline {
  display: inline-block;
  width: 90px;
  height: 50px;
  vertical-align: middle;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  margin-right: .4rem;
  overflow: hidden;
}
.kist-thumb-inline svg, .kist-thumb-inline img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* Kistenbeheer-galerij */
.kist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.kist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: opacity .15s;
}
.kist-card.is-uploading { opacity: .55; }
.kist-card.is-uploading::after {
  content: 'Bezig met uploaden...';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.7);
  font-weight: 600;
  color: var(--primary);
}
.kist-card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
button.kist-card-img-btn {
  border: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  display: block;
  padding: 6px;
  transition: transform .15s ease;
}
button.kist-card-img-btn:hover { transform: scale(1.01); }
button.kist-card-img-btn:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.kist-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kist-card-svg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f0ece2; border-radius: 4px; }
.kist-card-svg svg { width: 90%; height: 90%; }
.kist-card-no-img {
  position: absolute; top: .35rem; right: .5rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .7rem; padding: .15rem .45rem; border-radius: 3px;
  letter-spacing: .03em; text-transform: uppercase;
}
.kist-card-meta { padding: .6rem .75rem .25rem; display: flex; flex-direction: column; gap: .15rem; }
.kist-card-actions {
  padding: .35rem .75rem .65rem;
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-top: auto;
}
.kist-card-actions .btn { flex: 1; }

/* Handtekeningen */
.signatures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.signature-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem;
}
.signature-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; margin-bottom: .5rem;
}
.signature-pad {
  width: 100%;
  height: 180px;
  background: #fff;
  border: 1px dashed #b6aa90;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
  display: block;
}
.signature-pad:active { border-color: var(--primary); }
.signature-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; margin-top: .35rem;
}
.signature-status.signed { color: var(--green); font-weight: 600; }

.signatures-readonly .signature-img {
  width: 100%; max-height: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: contain;
  display: block;
}

/* Handtekening-velden beheer in instellingen */
.sig-row {
  display: flex; gap: .5rem; align-items: center;
  padding: .35rem 0;
  border-bottom: 1px dashed var(--border);
}
.sig-row:last-child { border-bottom: none; }
.sig-row .sig-label { flex: 1; }
.sig-row .btn-icon { font-size: 1.3rem; }

/* Parochies-beheer in instellingen */
.parochie-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  gap: .5rem; align-items: center;
  padding: .35rem 0;
  border-bottom: 1px dashed var(--border);
}
.parochie-row:last-child { border-bottom: none; }
.parochie-row .btn-icon { font-size: 1.3rem; }
@media (max-width: 540px) {
  .parochie-row { grid-template-columns: 1fr auto; }
  .parochie-row .parochie-priester { grid-column: 1 / 2; }
}

/* Pop-up modal (waarschuwing / fout / succes / info) */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal.shown { opacity: 1; pointer-events: auto; }
.modal.fading { opacity: 0; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 18, 16, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.75rem 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 6px 18px rgba(0,0,0,.12);
  transform: translateY(12px) scale(.96);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .25s ease;
}
.modal.shown .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal.fading .modal-card { transform: translateY(-6px) scale(.98); opacity: 0; }

.modal-card h2 {
  margin: .25rem 0 .5rem;
  font-size: 1.25rem;
  border: none; padding: 0;
  color: var(--text);
}
.modal-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: .95rem;
}
.modal-card .btn { min-width: 140px; }
.modal-buttons {
  display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap;
  margin-top: .5rem;
}
.modal-card #modal-message { text-align: left; }
.modal-card #modal-message ul { padding-left: 1.25rem; margin: .35rem 0; }

.modal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  margin: 0 auto .85rem;
}
.modal-offline .modal-icon, .modal-warning .modal-icon {
  background: var(--amber-soft); color: var(--amber);
}
.modal-error .modal-icon {
  background: var(--red-soft); color: var(--red);
}
.modal-success .modal-icon {
  background: var(--green-soft); color: var(--green);
}
.modal-info .modal-icon {
  background: var(--blue-soft); color: var(--blue);
}

/* Factuur-pagina (printbaar) */
.factuur-doc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2.5rem 2rem;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.factuur-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--primary); padding-bottom: 1rem; margin-bottom: 1.25rem;
}
.factuur-meta { text-align: right; }
.factuur-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.factuur-party { padding: .85rem 1rem; background: var(--bg); border-radius: 6px; }
.factuur-verzekering {
  background: var(--blue-soft); color: var(--blue);
  padding: .65rem 1rem; border-radius: 6px; margin-bottom: 1rem;
  font-size: .9rem;
}
.factuur-table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.factuur-table th, .factuur-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.factuur-table th { background: var(--bg); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.factuur-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.factuur-table .center { text-align: center; }
.factuur-table tfoot td { padding: .65rem; }
.factuur-table .factuur-totalrow td { background: var(--primary-soft); border-top: 2px solid var(--primary); font-size: 1.05rem; }
.factuur-betaling {
  background: var(--bg); padding: .85rem 1rem; border-radius: 6px;
  font-size: .9rem; margin: 1rem 0;
}
.factuur-footer { margin-top: 1.5rem; text-align: center; }

@media print {
  .topbar, .footer, .no-print, body.is-offline .topbar { display: none !important; }
  .factuur-page { margin: 0; padding: 0; }
  .factuur-doc { border: none; box-shadow: none; padding: 0; max-width: 100%; }
}

/* Lightbox — grotere afbeelding-preview (niet fullscreen) */
.lightbox {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.shown { opacity: 1; pointer-events: auto; }
.lightbox.fading { opacity: 0; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 18, 16, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  max-width: min(720px, 92vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(.94);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.lightbox.shown .lightbox-card { transform: scale(1); }
.lightbox-close {
  position: absolute; top: .5rem; right: .65rem;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--text);
  font-size: 1.4rem; font-weight: 600; line-height: 1;
  cursor: pointer; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.lightbox-close:hover { background: #fff; }
.lightbox-img-wrap {
  background: #fff;
  padding: 1.5rem 1.5rem .5rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
  flex: 1; min-height: 0;
}
.lightbox-img-wrap img,
.lightbox-img-wrap .lightbox-svg {
  max-width: 100%; max-height: 60vh;
  object-fit: contain;
  display: block;
}
.lightbox-img-wrap .lightbox-svg svg { width: 100%; max-width: 480px; height: auto; }
.lightbox-meta {
  padding: .85rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .15rem;
  text-align: center;
}
.lightbox-meta strong { font-size: 1.05rem; }
.lightbox-meta .kist-price { font-size: 1rem; }

/* Welkomscherm / splash */
.splash {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(107,30,42,.07), transparent 60%),
    radial-gradient(900px 600px at 80% 90%, rgba(201,162,74,.10), transparent 60%),
    linear-gradient(135deg, #f6f4ef, #ede5d8);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
  transition:
    opacity .7s cubic-bezier(.4,0,.2,1),
    filter .55s ease,
    transform .8s cubic-bezier(.4,0,.2,1);
  will-change: opacity, filter, transform;
}
.splash.fading { pointer-events: none; }

.splash-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem 1.75rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.04);
  animation: splashIn .7s cubic-bezier(.2,.8,.2,1) both;
  transition:
    opacity .5s ease,
    transform .65s cubic-bezier(.4,0,.2,1),
    filter .5s ease;
  will-change: opacity, transform, filter;
}
@keyframes splashIn {
  from { transform: translateY(14px) scale(.97); opacity: 0; filter: blur(6px); }
  to   { transform: translateY(0)    scale(1);   opacity: 1; filter: blur(0); }
}

/* Animatievarianten — alleen bij wegfaden */
.splash.anim-glass.fading                { opacity: 0; filter: blur(14px); }
.splash.anim-glass.fading .splash-card   { opacity: 0; transform: translateY(-12px) scale(.96); filter: blur(4px); }

.splash.anim-fade.fading                 { opacity: 0; }
.splash.anim-fade.fading .splash-card    { opacity: 0; }

.splash.anim-scale.fading                { opacity: 0; transform: scale(1.06); }
.splash.anim-scale.fading .splash-card   { opacity: 0; transform: scale(.92); }

.splash.anim-slide.fading                { opacity: 0; }
.splash.anim-slide.fading .splash-card   { opacity: 0; transform: translateY(-32px); }
.splash-card h1 {
  margin: .2rem 0 .15rem;
  font-size: 1.7rem;
  color: var(--primary);
}
.splash-sub { margin: 0 0 1.25rem; color: var(--muted); font-size: .92rem; }

.splash-state { margin-top: .75rem; }
.splash-msg { margin: .25rem 0; font-size: .95rem; color: var(--text); }
.splash-msg-sub { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }

.splash-spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: .35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.splash-state-offline { color: var(--amber); }
.splash-icon-offline {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 50%;
  margin: 0 auto .25rem;
}
.splash-state-offline .splash-msg { color: var(--text); }
.splash-state-offline .splash-msg strong { color: var(--amber); }

.splash-card #splash-continue { margin-top: 1.25rem; min-width: 160px; }
.splash-hint { margin-top: .75rem; }
.splash-version { margin: 1rem 0 0; font-size: .72rem; opacity: .55; letter-spacing: .03em; }
.footer-version { font-size: .72rem; opacity: .7; }

/* Logo-upload preview */
.logo-row { display: flex; align-items: center; gap: 1rem; padding: .35rem 0; }
.logo-preview {
  width: 72px; height: 72px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--primary);
  font-size: 2rem;
  flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.logo-actions .btn { justify-content: flex-start; }

/* Color picker overschrijving — bovenaan al gedefinieerd; deze regel is leeg gehouden */

/* Lettertype-voorbeeldblok */
.font-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin: -.35rem 0 .35rem;
}
.font-preview h3 { color: var(--text); }
.font-preview p { color: var(--muted); font-size: .95rem; line-height: 1.55; }

/* Offline-badge */
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .55rem;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.offline-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  display: inline-block;
}
body.is-offline .topbar { box-shadow: inset 0 -2px 0 var(--amber); }

/* Autosave status-indicator */
.autosave-status {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  align-self: center;
  min-height: 1.1em;
  transition: color .15s;
}
.autosave-status.saving { color: var(--amber); }
.autosave-status.saved { color: var(--green); }
.autosave-status.error { color: var(--red); }

/* Preset buttons (kosten-catalogus) */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem; margin-top: .5rem; }
.preset-btn { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem .75rem; text-align: left; }
.preset-btn span { flex: 1; font-size: .85rem; }
.preset-btn strong { color: var(--primary); font-variant-numeric: tabular-nums; }

/* Kosten — gegroepeerd per categorie */
.kosten-groups { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }
.kosten-group { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.kosten-group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .75rem; padding: .55rem .85rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.kosten-group-title {
  font-family: var(--font-heading, Georgia, serif);
  font-weight: 600; font-size: 1rem; color: var(--primary);
}
.kosten-group-sub { white-space: nowrap; }
.kosten-table { margin: 0; table-layout: fixed; width: 100%; }
.kosten-table tbody tr { border-bottom: 1px dashed var(--border); }
.kosten-table tbody tr:last-child { border-bottom: none; }
.kosten-table td { padding: .55rem .85rem; vertical-align: middle; }
.kosten-table .num { font-variant-numeric: tabular-nums; }
.kosten-table .btn-icon { font-size: 1.1rem; }
/* Vaste kolommen — zo staan prijzen/knoppen in elke categorie precies onder elkaar */
.kosten-table col.kc-col-omschrijving { width: auto; }
.kosten-table col.kc-col-aantal       { width: 80px; }
.kosten-table col.kc-col-bedrag       { width: 120px; }
.kosten-table col.kc-col-dekking      { width: 150px; }
.kosten-table col.kc-col-wie          { width: 150px; }
.kosten-table col.kc-col-status       { width: 120px; }
.kosten-table col.kc-col-del          { width: 44px; }
.kosten-table .kc-aantal-input {
  width: 100%; max-width: 64px; padding: .25rem .35rem; height: 2rem;
  font-size: .9rem; text-align: center; -moz-appearance: textfield;
}
.kosten-table .kc-aantal-input::-webkit-outer-spin-button,
.kosten-table .kc-aantal-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kosten-table .kc-dekking { font-size: .82rem; line-height: 1.3; text-align: right; }
.kosten-table .kc-dekking .dekking-deel { color: var(--green); font-weight: 600; }
.kosten-table .kc-dekking .familie-deel { color: var(--muted); }
.kosten-table .kc-omschrijving { word-wrap: break-word; overflow-wrap: anywhere; }
.kosten-table .kc-bedrag       { text-align: right; white-space: nowrap; }
.kosten-table .kc-wie          { text-align: center; }
.kosten-table .kc-status       { text-align: center; }
.kosten-table .kc-del          { text-align: right; padding-left: 0; padding-right: .5rem; }
.kosten-table .kc-status .kost-toggle,
.kosten-table .kc-wie .kost-toggle { width: 100%; max-width: 130px; }
@media (max-width: 720px) {
  .kosten-table col.kc-col-bedrag { width: 110px; }
  .kosten-table col.kc-col-wie    { width: 120px; }
  .kosten-table col.kc-col-status { width: 100px; }
  .kosten-table td { padding: .55rem .55rem; }
}

.kosten-totals {
  margin-top: 1rem; padding: .85rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; gap: .35rem;
}
.kosten-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; font-size: .95rem;
}
.kosten-total-row .num { font-variant-numeric: tabular-nums; }
.kosten-total-row.total-open {
  margin-top: .35rem; padding-top: .55rem;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}
.kosten-total-row.total-open strong { color: var(--amber); }
.kosten-totals-divider {
  height: 1px; background: var(--border); margin: .5rem 0 .15rem;
}
.kosten-total-row.total-familie {
  margin-top: .25rem;
  font-size: 1.05rem;
}
.kosten-total-row.total-familie strong { color: var(--primary); }

/* Helpers */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
[hidden] { display: none !important; }
