/* VDB Woningconfigurator — huisstijl Van den Berg Bouwkundigen
   (afgeleid van de Detailboek- en Planbord-apps: rood #d5003f, Open Sans,
   strakke kaarten, genummerde stappen met rode onderstreping) */

:root {
  --brand: #d5003f;
  --brand-dark: #b40035;
  --soft-red: #fff0f4;
  --focus: #f3a8bd;
  --ink: #29292c;
  --muted: #67686c;
  --eyebrow: #5d6d79;
  --line: #dedee1;
  --soft: #f4f4f5;
  --panel-soft: #f8f8f9;
  --bg: #ffffff;
  --radius: 2px;
  --radius-btn: 3px;
  --topbar-h: 64px;
  --sheet-h: 58vh;
  --font: "Open Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.page-config { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Topbalk ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo img { width: 40px; height: 40px; display: block; }
.wordmark { display: grid; line-height: 1.05; }
.wordmark b { font-size: 17px; font-weight: 400; letter-spacing: .01em; }
.wordmark small { font-size: 9.5px; letter-spacing: .09em; color: var(--muted); }
.divider { width: 1px; height: 30px; background: var(--line); }
.apptitle { display: grid; line-height: 1.2; min-width: 0; }
.apptitle strong { font-size: 15px; font-weight: 700; }
.apptitle small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-actions a { text-decoration: none; }
.back {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-btn);
  text-decoration: none; font-size: 18px; color: var(--ink);
}
.back:hover { border-color: var(--ink); }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: var(--soft-red); padding: 4px 8px; border-radius: var(--radius);
}

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-btn); padding: 9px 16px;
  font-weight: 700; font-size: 14px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }

/* ---------- Layout: mobiel = viewer boven, paneel als bottom-sheet ---------- */
.app { position: fixed; inset: var(--topbar-h) 0 0 0; }
.stage { position: absolute; inset: 0 0 calc(var(--sheet-h) - 12px) 0; transition: bottom .3s ease; background: #eef1f2; }
.viewer, .viewer canvas { width: 100%; height: 100%; display: block; touch-action: none; }

.panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--sheet-h);
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(41, 41, 44, .10);
  display: flex; flex-direction: column;
  transition: height .3s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
body.sheet-collapsed { --sheet-h: 196px; }
body.sheet-collapsed .panel-body,
body.sheet-collapsed .panel-head { display: none; }
.sheet-handle { border: 0; background: none; padding: 8px 0 2px; display: grid; place-items: center; }
.sheet-handle span { width: 40px; height: 4px; border-radius: 99px; background: var(--line); }

/* ---------- Overlay op de 3D ---------- */
.pick {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: #fff; color: var(--ink); border-left: 4px solid var(--brand);
  border-radius: var(--radius); padding: 7px 12px; display: flex; gap: 10px; align-items: baseline;
  font-size: 12.5px; box-shadow: 0 4px 16px rgba(41, 41, 44, .12);
}
.pick[hidden] { display: none; }
.pick code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.pick small { color: var(--muted); }
.stage-hint {
  position: absolute; bottom: 14px; left: 0; right: 0; margin: 0;
  text-align: center; font-size: 11.5px; color: var(--muted); pointer-events: none;
}
.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 14px; background: #eef1f2; transition: opacity .4s ease;
}
body.is-ready .loading { opacity: 0; pointer-events: none; }

/* ---------- Stappen (zoals Detailboek) ---------- */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 14px; border-bottom: 1px solid var(--line);
}
.step {
  border: 0; background: none; padding: 10px 2px 11px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.step-n {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted); background: #fff;
}
.step.is-done .step-n { border-color: var(--ink); color: var(--ink); }
.step.is-active { color: var(--ink); border-bottom-color: var(--brand); }
.step.is-active .step-n { background: var(--brand); border-color: var(--brand); color: #fff; }

.panel-head { padding: 16px 18px 4px; }
.eyebrow {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--eyebrow);
}
.eyebrow-brand { color: var(--brand); }
.step-title { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 18px 16px; overscroll-behavior: contain; }
.hint { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.5; }

/* ---------- Kaarten ---------- */
.cards { display: grid; gap: 10px; }
.card {
  position: relative;
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  text-align: left; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: #b9b9bf; }
.card:disabled { opacity: .45; cursor: not-allowed; }
.card:disabled:hover { border-color: var(--line); }
.card.is-active { border-color: var(--brand); background: var(--soft-red); box-shadow: inset 3px 0 0 var(--brand); }
.card-txt { display: grid; gap: 3px; }
.card-txt strong { font-size: 16px; font-weight: 700; }
.card-txt small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.card-price { font-size: 12.5px; color: var(--muted); white-space: nowrap; align-self: start; }
.card.is-active .card-price { color: var(--brand); font-weight: 700; }

.icon { display: grid; place-items: center; width: 64px; height: 48px; border-radius: var(--radius); background: var(--soft); }
.icon svg { width: 56px; height: 40px; }
.icon-plan { height: 64px; }
.icon-plan svg { height: 58px; }
.ic-ctx { fill: #d4d4d8; }
.ic-act { fill: var(--brand); }
.icon-plan .ic-wall { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.icon-plan line { stroke: var(--muted); stroke-width: 2; }
.icon-plan .ic-win { stroke: #7fb2c9; stroke-width: 4; }

/* ---------- Stalen ---------- */
.slot { padding: 14px 0; border-top: 1px solid var(--line); }
.slot:first-of-type { border-top: 0; }
.slot-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 10px; }
.slot-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.slot-head small { color: var(--muted); font-size: 12.5px; }
.slot-val { text-align: right; font-size: 13px; display: grid; gap: 2px; }
.slot-val code { font-size: 11px; color: var(--eyebrow); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative; width: 50px; height: 50px; border-radius: var(--radius);
  border: 1px solid var(--line); background-size: cover; background-position: center;
  transition: transform .12s, box-shadow .15s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }
.swatch.has-conflict::after {
  content: "!"; position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: #fff; color: var(--brand); border: 1.5px solid var(--brand);
}

.opbouw { margin-top: 8px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; }
.opbouw summary { cursor: pointer; font-weight: 600; }
.opbouw-type { margin-top: 10px; }
.opbouw ol { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.opbouw li { display: flex; justify-content: space-between; color: var(--muted); padding: 5px 8px; background: var(--soft); border-radius: var(--radius); }

/* ---------- Samenvatting (zoals 'Jouw detailboek') ---------- */
.summary {
  border-top: 4px solid var(--brand); background: var(--panel-soft);
  padding: 12px 18px 14px; display: grid; gap: 8px;
}
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price { border: 0; background: none; text-align: left; padding: 0; display: grid; }
.price small { font-size: 12px; color: var(--muted); }
.price strong { font-size: 24px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.nav-btns { display: flex; gap: 8px; }
.price-detail {
  margin: 0; padding: 8px 10px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12.5px; display: grid; gap: 4px; max-height: 150px; overflow: auto;
}
.price-detail[hidden] { display: none; }
.price-detail li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.price-detail li span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }
.disclaimer { margin: 0; font-size: 11.5px; color: var(--muted); }

/* ---------- Meldingen ---------- */
.toasts {
  position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 10; width: min(92vw, 420px);
}
.toast {
  background: #fff; color: var(--ink); padding: 10px 14px; border-radius: var(--radius);
  border-left: 4px solid var(--brand); font-size: 13px; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(41, 41, 44, .16);
  animation: in .25s ease; transition: opacity .4s, transform .4s;
}
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Mobiel ---------- */
@media (max-width: 899px) {
  :root { --topbar-h: 56px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .wordmark, .divider, .badge, .stage-hint, .disclaimer { display: none; }
  .logo img { width: 34px; height: 34px; }
  #export { padding: 9px 11px; }
  #export span { display: none; }
  .step { flex-direction: column; gap: 4px; font-size: 12px; }
  .step-title { font-size: 19px; }
  .panel-head { padding-top: 12px; }
  .price strong { font-size: 20px; }
}

/* ---------- Desktop: zijpaneel rechts ---------- */
@media (min-width: 900px) {
  .stage { inset: 0 420px 0 0; }
  .panel { top: 0; left: auto; width: 420px; height: auto; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .sheet-handle { display: none; }
  .toasts { left: calc(50% - 210px); }
  body.sheet-collapsed .panel-body, body.sheet-collapsed .panel-head { display: revert; }
}

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

/* ==========================================================================
   Pagina's: start, project (scrollen, container)
   ========================================================================== */
body.page { overflow: auto; background: var(--panel-soft); }
body.page main { padding-top: var(--topbar-h); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px 48px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.note { margin: 28px 0 0; font-size: 12.5px; color: var(--muted); }
.error { color: var(--brand-dark); }
.link { color: var(--brand); font-weight: 700; font-size: 14px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; justify-self: start; }
.btn-block { width: 100%; text-decoration: none; }

.hero { padding: 44px 0 26px; max-width: 760px; }
.hero h1 { margin: 6px 0 10px; font-size: 38px; font-weight: 600; letter-spacing: -.6px; }
.lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.section-head p { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.tile {
  display: flex; flex-direction: column; background: #fff; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { border-color: var(--brand); box-shadow: 0 10px 28px rgba(41, 41, 44, .10); transform: translateY(-2px); }
.tile-map { position: relative; aspect-ratio: 16 / 10; background: #eef1f2; border-bottom: 1px solid var(--line); }
.tile-map { overflow: hidden; }
.tile-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tag {
  position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 8px; border-radius: var(--radius); background: #fff; color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.tag-live { background: var(--brand); color: #fff; }
.tile-body { padding: 16px 18px 18px; display: grid; gap: 8px; flex: 1; }
.tile-body h2 { margin: 0; font-size: 21px; font-weight: 600; }
.tile-body p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 6px 0 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.stats dt { font-size: 11.5px; color: var(--muted); }
.stats dd { margin: 0; font-size: 17px; font-weight: 700; }
.progress { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ink); }
.tile-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 4px; }

/* ---------- Situatie (SVG) ---------- */
.situatie { display: block; width: 100%; height: 100%; }
.sit-groen { fill: #e8eee1; }
.sit-park { fill: #d6e5c9; }
.sit-water { fill: #cfe2ec; }
.sit-weg { fill: #fbfbfb; stroke: #d9d9de; stroke-width: .3; }
.sit-ring { fill: none; stroke: #fbfbfb; }
.sit-boom { fill: #a8c69a; stroke: #8fb382; stroke-width: .4; }
.sit-tuin { fill: #f2f6ee; stroke: #fff; stroke-width: .25; }
.sit-voortuin { fill: #f7f9f4; }
.sit-huis { stroke: var(--ink); stroke-width: .28; }
.sit-voorgevel { stroke: var(--ink); stroke-width: .5; }
.status-verkocht .sit-huis { stroke: #a5a5ab; }
.sit-nr { font: 700 2px var(--font); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.status-verkocht .sit-nr { fill: #8a8a90; }
.sit-config { fill: var(--brand); }
.sit-woning.is-klikbaar { cursor: pointer; }
.sit-woning.is-klikbaar:hover .sit-huis { fill: var(--soft-red); stroke: var(--brand); }
.sit-woning:focus { outline: none; }
.sit-woning:focus-visible .sit-huis { stroke: var(--brand); stroke-width: .6; }
.sit-woning.is-selected .sit-huis { fill: var(--brand); stroke: var(--brand-dark); stroke-width: .5; }
.sit-woning.is-selected .sit-nr { fill: #fff; }
.sit-woning.is-selected .sit-config { fill: #fff; }
.sit-noord path { fill: var(--ink); }
.sit-noord text { font: 700 7px var(--font); text-anchor: middle; fill: var(--ink); }
.is-compact .sit-huis { stroke-width: .35; }

/* ---------- Projectpagina ---------- */
.project { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
body.page main.project { padding-top: calc(var(--topbar-h) + 22px); }
.card-plain { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.project-map { position: sticky; top: calc(var(--topbar-h) + 22px); }
.map-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.map-head h1 { margin: 4px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.3px; }
.map { aspect-ratio: 4 / 3; background: #eef1f2; border: 1px solid var(--line); max-height: calc(100vh - 230px); width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border: 1px solid var(--ink); display: inline-block; }
.lg-beschikbaar { background: #fff; }
.lg-in_optie { background: #f9eeda; }
.lg-verkocht { background: #e2e2e6; border-color: #a5a5ab; }
.lg-config { border: 0; border-radius: 50%; background: var(--brand); width: 10px; height: 10px; }
.project-side { display: grid; gap: 16px; }
.project-side p { margin: 0 0 8px; }
.summary-card { background: var(--panel-soft); border: 1px solid var(--line); border-top: 4px solid var(--brand); padding: 16px 18px 18px; }
.selectie { display: grid; gap: 12px; }
.sel-head { display: flex; gap: 12px; align-items: center; }
.sel-nr { width: 48px; height: 48px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 20px; border-radius: var(--radius); }
.sel-head strong { display: block; font-size: 17px; }
.feiten { margin: 0; display: grid; gap: 6px; }
.feiten div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.feiten dt { color: var(--muted); }
.feiten dd { margin: 0; font-weight: 600; text-align: right; }
.table-wrap { max-height: 420px; overflow: auto; }
.woningtabel { width: 100%; border-collapse: collapse; font-size: 13px; }
.woningtabel th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.woningtabel td { padding: 7px 8px; border-bottom: 1px solid var(--soft); }
.woningtabel tr { cursor: pointer; }
.woningtabel tbody tr:hover { background: var(--soft); }
.woningtabel tr.is-selected { background: var(--soft-red); }
.ta-r { text-align: right; }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.pill-in_optie { background: #f9eeda; border-color: #ecd6ad; }
.pill-verkocht { background: #ececef; color: var(--muted); }
.pill-beschikbaar { background: #e5f4e4; border-color: #c6e3c4; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }

@media (max-width: 899px) {
  .container { padding: 0 14px 36px; }
  .hero { padding: 26px 0 16px; }
  .hero h1 { font-size: 28px; }
  .topbar-actions .btn-ghost { display: none; }
  .project { grid-template-columns: 1fr; }
  .project-map { position: static; }
  .map { max-height: none; }
}

/* ==========================================================================
   Beheer
   ========================================================================== */
.page-admin { background: var(--panel-soft); }
.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; padding-top: var(--topbar-h); }
.admin-nav {
  position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow: auto;
  background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: grid; gap: 18px; align-content: start;
}
.nav-groep { display: grid; gap: 2px; }
.nav-groep .eyebrow { padding: 0 10px 4px; font-size: 11px; }
.nav-item { display: grid; padding: 8px 10px; border-radius: var(--radius); text-decoration: none; border-left: 3px solid transparent; }
.nav-item strong { font-size: 14px; font-weight: 600; }
.nav-item small { font-size: 12px; color: var(--muted); }
.nav-item:hover { background: var(--soft); }
.nav-item.is-active { background: var(--soft-red); border-left-color: var(--brand); }
.admin-main { padding: 24px 28px 60px; outline: none; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h1 { margin: 4px 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.3px; }
.admin-head p.muted { margin: 0; max-width: 720px; font-size: 14px; line-height: 1.5; }
.head-acties { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.split-wide { grid-template-columns: 320px minmax(0, 1fr); }
.lijst { display: grid; gap: 6px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.lijst-item {
  display: flex; align-items: center; gap: 10px; text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
.lijst-item:hover { border-color: #b9b9bf; }
.lijst-item.is-active { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.li-txt { display: grid; flex: 1; min-width: 0; }
.li-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-txt small { font-size: 12px; color: var(--muted); }
.li-badges { display: flex; gap: 4px; }
.li-icoon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; border-radius: var(--radius); flex: none; }
.mini-badge { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius); background: var(--soft); color: var(--muted); white-space: nowrap; }
.detail { display: grid; gap: 14px; min-width: 0; }
.paneel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; min-width: 0; }
.paneel h3 { margin: 0; font-size: 15px; font-weight: 700; }
.paneel-kop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.paneel-kop h3 { margin-bottom: 2px; }
.admin-main > div > .paneel { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 4px; font-size: 12.5px; min-width: 0; align-content: start; }
.field > span { font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.field-actions { display: flex; align-items: end; }
.page-admin input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=color]),
.page-admin select, .page-admin textarea {
  width: 100%; font: inherit; font-size: 13.5px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: var(--radius-btn); background: #fff; color: var(--ink); min-width: 0;
}
.page-admin textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.page-admin input:focus, .page-admin select:focus, .page-admin textarea:focus { outline: 2px solid var(--focus); border-color: var(--brand); }
.page-admin input:disabled { background: var(--soft); color: var(--muted); }
.page-admin input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: #fff; }
.page-admin input[type=range] { width: 100%; accent-color: var(--brand); }
.page-admin input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; }
.is-fout { border-color: var(--brand) !important; background: var(--soft-red) !important; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 42px !important; }
.input-suffix i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-danger { background: #fff; border-color: #f0c2cf; color: var(--brand-dark); }
.btn-danger:hover:not(:disabled) { background: var(--soft-red); border-color: var(--brand); }
.btn-icon { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-btn); font-size: 14px; line-height: 1; padding: 0; color: var(--muted); }
.btn-icon:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.btn-icon:disabled { opacity: .35; cursor: default; }
.gevaar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.gevaar p { margin: 0 auto 0 0; }
.tabel { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabel th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabel td { padding: 6px 8px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.tabel-compact td { padding: 4px 6px; }
.tabel-compact input, .tabel-compact select { padding: 5px 7px !important; font-size: 13px !important; }
.tabel-compact select { min-width: 78px; }
.tabel .w-prijs { width: 130px; }
.tabel .w-melding { min-width: 220px; }
.ta-c { text-align: center; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.thumb { width: 40px; height: 40px; display: block; border-radius: var(--radius); border: 1px solid var(--line); background-size: cover; padding: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar select { width: auto !important; }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: auto; }
.legend-inline i { width: 12px; height: 12px; display: inline-block; border: 1px solid var(--ink); }
.lg-ok { background: #cfe2ec; }
.lg-fout { background: var(--brand); border-color: var(--brand-dark) !important; }
.gevel-edit { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.gevel-edit > button { grid-column: 2; justify-self: start; }
.gevel-edit > p { grid-column: 2; margin: 0; }
.schets-wrap { background: var(--panel-soft); border: 1px solid var(--line); padding: 8px; }
.schets { width: 100%; height: auto; display: block; }
.sch-wand { fill: #e9d3c9; stroke: var(--ink); stroke-width: 1; }
.sch-tras { fill: #6b6461; }
.sch-rol { fill: #8b7f79; }
.sch-open { fill: #cfe2ec; stroke: var(--ink); stroke-width: 1; }
.sch-open.is-fout { fill: var(--brand); stroke: var(--brand-dark); }
.sch-plan { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.sch-bw { stroke: var(--muted); stroke-width: 2; }
.sch-label { font: 600 4.5px var(--font); fill: var(--muted); text-anchor: middle; }
.plan { max-width: 160px; }

/* Lade */
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: min(440px, 100vw); z-index: 8;
  background: #fff; border-left: 1px solid var(--line); box-shadow: -14px 0 40px rgba(41, 41, 44, .14);
  display: flex; flex-direction: column;
}
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line); border-top: 4px solid var(--brand); }
.drawer-head h2 { margin: 2px 0 0; font-size: 20px; font-weight: 600; }
.drawer-body { overflow: auto; padding: 16px 18px 28px; display: grid; gap: 12px; }
.drawer-body .paneel { padding: 14px; }
.drawer-preview { height: 150px; border: 1px solid var(--line); border-radius: var(--radius); background-size: 280px; background-repeat: repeat; }
.typenamen { display: grid; gap: 6px; }
.typenamen div { display: flex; justify-content: space-between; gap: 10px; background: var(--soft); padding: 6px 8px; border-radius: var(--radius); }
.typenamen code { font-size: 12px; }
.gebruik { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.gebruik li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; background: var(--soft); border-radius: var(--radius); }

/* 3D-modellen */
.dropzone {
  display: grid; place-items: center; gap: 2px; padding: 22px 12px; text-align: center; cursor: pointer;
  border: 1.5px dashed #c4c4ca; border-radius: var(--radius); background: #fff; font-size: 13px;
}
.dropzone small { color: var(--muted); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--soft-red); }
.gen { display: grid; gap: 6px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; }
.gen-row { display: flex; gap: 6px; }
.model-view { height: 380px; background: #eef1f2; border: 1px solid var(--line); position: relative; overflow: hidden; }
.model-view canvas { display: block; width: 100% !important; height: 100% !important; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-ok { font-size: 11px; padding: 2px 6px; background: #e5f4e4; border-radius: var(--radius); }
.leeg { background: #fff; border: 1px dashed var(--line); padding: 40px; text-align: center; }
.acties-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.acties-grid > div { border: 1px solid var(--line); padding: 12px; border-radius: var(--radius); display: grid; gap: 4px; align-content: start; justify-items: start; }
.acties-grid p { margin: 0 0 6px; }

@media (max-width: 1100px) {
  .split, .split-wide { grid-template-columns: 1fr; }
  .lijst { position: static; }
  .gevel-edit { grid-template-columns: 1fr; }
  .gevel-edit > button, .gevel-edit > p { grid-column: 1; }
}
@media (max-width: 899px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; grid-auto-flow: column; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 8px; }
  .nav-groep { grid-auto-flow: column; }
  .nav-groep .eyebrow, .nav-item small { display: none; }
  .admin-main { padding: 16px 14px 48px; }
  .form-grid, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.page main.admin-main { padding-top: 24px; }

/* ---------- Weergave-schakelaar en 3D-situatie ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-btn); background: #fff; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 2px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.section-tools { display: flex; align-items: center; gap: 14px; }
.section-head { align-items: center; }
.tile-map .tile-3d { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tiles:not(.toon-3d) .tile-3d { display: none; }
.tiles.toon-3d .tile-map svg { visibility: hidden; }
.tiles.laadt-3d .tile-map::after {
  content: "3D wordt opgebouwd…"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; color: var(--muted);
  background: linear-gradient(100deg, #eef1f2 30%, #f7f8f8 50%, #eef1f2 70%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.map3d { position: relative; overflow: hidden; background: #e9eef0; }
.map3d[hidden] { display: none; }
.map3d canvas { display: block; width: 100% !important; height: 100% !important; }
.map3d-laden { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.map3d.is-klaar .map3d-laden { display: none; }
.map3d-btn { position: absolute; right: 10px; bottom: 10px; z-index: 2; }
.map3d:not(.is-klaar) .map3d-btn { display: none; }
.legend.is-3d li:last-child { display: none; }
.map-head .seg { margin-left: auto; }
@media (max-width: 899px) {
  .section-tools #telling { display: none; }
}
