:root {
  --bg: #fbf7f2; --panel: #fff; --ink: #2b2420; --muted: #7a6c63; --line: #e8ddd3;
  --accent: #d2691e; --accent-dark: #a94f12; --ok: #2e8b57; --fout: #c0392b; --warn: #b7791f;
  --radius: 12px; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
header { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); }
header h1 { margin: 0; font-size: 20px; }
header .sub { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 8px; }
header nav a { color: var(--accent-dark); text-decoration: none; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }

/* ---- layout: links stappen, rechts voorbeeld --------------------------- */
.layout { max-width: 1320px; margin: 0 auto; padding: 20px 24px 60px; display: grid; grid-template-columns: minmax(360px, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
.stappen { min-width: 0; }
.voorbeeld { position: sticky; top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .voorbeeld { position: static; order: -1; }
}

/* ---- stappen --------------------------------------------------------------- */
.stap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 18px; margin-bottom: 14px; }
.stap h2 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.stap h2 .nr { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.stap h2 .switch { margin-left: auto; }
.rij { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rij > label, label.inline { font-weight: 600; font-size: 14px; margin: 0; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=number], select, textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--ink);
}
#naam { width: 100%; font-size: 16px; }
label > input[type=number], label > input[type=text], label > select { display: block; width: 100%; margin-top: 4px; }
label > input[type=range] { width: 100%; margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 10px; flex-wrap: wrap; }
label.check input[type=checkbox] { margin: 0; }
label.check .mini { display: inline; width: 64px; margin: 0 4px; padding: 3px 6px; }
label.kleiner { font-size: 13px; margin-top: 0; }
.profiel-rij { margin-top: 12px; }
.profiel-rij select { min-width: 190px; }
.aangepast { font-size: 13px; color: var(--warn); }
.aangepast a { color: var(--accent-dark); }

/* segment (cm / inch) */
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.segment button { border: 0; border-radius: 0; padding: 7px 16px; background: #fff; font-weight: 600; }
.segment button.actief { background: var(--ink); color: #fff; }
/* maat-chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.actief { background: #fff1e6; border-color: var(--accent); color: var(--accent-dark); }
.chip .weg { font-weight: 400; color: var(--muted); font-size: 13px; }
.andere-maat input { width: 90px; }
.gemeten select { min-width: 160px; }
#maat-uitleg { margin-top: 10px; }

/* info-i met tooltip */
.info { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 11px; font-weight: 700; font-style: normal; cursor: help; position: relative; margin-left: 4px; }
.info::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%); width: 280px; background: #3a322d; color: #fff; padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 400; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; }
.info:hover::after, .info:focus::after { opacity: 1; }

/* schakelaar */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knop { position: absolute; inset: 0; background: #ccc; border-radius: 24px; cursor: pointer; transition: .15s; }
.switch .knop::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .knop { background: var(--accent); }
.switch input:checked + .knop::before { transform: translateX(20px); }

/* tekst-tabel */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tekst-tabel textarea { width: 100%; min-height: 44px; resize: vertical; padding: 5px 7px; font-size: 13px; }
.tekst-tabel input[type=number] { width: 66px; padding: 5px 6px; font-size: 13px; }
.tekst-tabel tr.actief td { background: #fff6ee; }
.tekstplek { font-size: 14px; }

/* knoppen */
button, .button { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.klein, .button.klein { padding: 5px 11px; font-size: 13px; font-weight: 600; }
button.groot { padding: 12px 26px; font-size: 16px; }
.acties { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.status { color: var(--muted); font-size: 14px; }
button.aandacht { box-shadow: 0 0 0 3px #ffd9b8; animation: puls 1.2s ease-in-out 3; }
@keyframes puls { 50% { box-shadow: 0 0 0 7px #ffd9b8; } }

/* dropzone */
.dropzone { border: 2px dashed #d9c7b8; border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; background: #fffdfb; transition: background .15s; }
.dropzone.over { background: #fff1e6; border-color: var(--accent); }
.dz-inner { display: flex; align-items: center; justify-content: center; gap: 16px; }
.dz-inner img { max-height: 96px; max-width: 160px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* resultaat */
.resultaat-lijst { list-style: none; padding: 0; margin: 10px 0 0; }
.resultaat-lijst li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.resultaat-lijst li .maat { font-weight: 600; min-width: 80px; cursor: pointer; }
.resultaat-lijst li.actief .maat { color: var(--accent-dark); }
.resultaat-lijst li .rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.fout { background: #fbe4e1; color: var(--fout); }
.badge.bezig { background: #fdf0d5; color: var(--warn); }
.badge.wacht { background: #eee; color: var(--muted); }
.waarschuwing { color: var(--warn); font-weight: 600; margin-top: 8px; font-size: 14px; }
.waarschuwing.zacht { color: #8a6a1f; font-weight: 500; }
.verouderd { background: #fdf0d5; color: #7a5410; border: 1px solid #f0d9a8; border-radius: 9px; padding: 9px 13px; margin-top: 12px; font-size: 14px; }
.checks-detail { margin-top: 12px; font-size: 13px; color: var(--muted); }
.checks-detail summary { cursor: pointer; }
.checks-detail table { margin-top: 8px; }
.checks-detail td:first-child { white-space: nowrap; }
.checks-detail .ok { color: var(--ok); font-weight: 600; }
.checks-detail .nok { color: var(--fout); font-weight: 600; }
pre.fout { color: var(--fout); white-space: pre-wrap; font-size: 12px; }
p.fout { color: var(--fout); }
#vorige-lijst { padding-left: 18px; margin: 0; }
#vorige-lijst a { color: var(--accent-dark); }

/* extra opties */
details.extra { padding: 0; }
details.extra summary { padding: 14px 20px; cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.extra summary::before { content: "▸"; color: var(--muted); font-size: 13px; }
details.extra[open] summary::before { content: "▾"; }
.extra-inhoud { padding: 0 20px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.extra-inhoud label.check { grid-column: 1 / -1; }
.extra-inhoud > label:last-child { grid-column: 1 / -1; }

/* voorbeeld */
.tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs > button { padding: 6px 14px; font-size: 14px; }
.tabs > button.actief { background: var(--ink); color: #fff; border-color: var(--ink); }
.maat-knoppen { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
.maat-knoppen button { padding: 4px 10px; font-size: 13px; }
.maat-knoppen button.actief { background: #fff1e6; border-color: var(--accent); color: var(--accent-dark); }
.leeg { padding: 80px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.canvas3d { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #f4efe9; overflow: hidden; }
canvas#canvas2d { width: 100%; max-width: 640px; aspect-ratio: 1; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; cursor: grab; display: block; margin: 0 auto; }
.canvas-tools { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.stip { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.stip.rood { background: #c0392b; } .stip.oranje { background: #e8a33d; }

/* login */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.loginbox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 34px; width: 360px; }
.loginbox input { width: 100%; padding: 10px; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.loginbox button { width: 100%; background: var(--accent); color: #fff; border-color: var(--accent); }
