:root {
  --achtergrond: #f6f4f1;
  --kaart: #ffffff;
  --rand: #e3ded7;
  --tekst: #2c2a27;
  --tekst-licht: #8a847c;
  --accent: #4a5d7a;
  --accent-donker: #38495f;
  --waarschuwing: #9a6b1f;
  --fout: #9a2f2f;
  --ok: #3d7a4a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--achtergrond);
  color: var(--tekst);
}
.verborgen { display: none !important; }

.knop {
  border: 1px solid var(--rand);
  background: var(--kaart);
  color: var(--tekst);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.knop:hover { border-color: var(--accent); color: var(--accent); }
.knop.primair {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.knop.primair:hover { background: var(--accent-donker); }
.knop.stil { border: none; background: none; color: var(--tekst-licht); }
.knop.stil:hover { color: var(--accent); }
.knop.klein { padding: 2px 8px; font-size: 13px; border-radius: 6px; }

/* ---------- startscherm ---------- */
#start { display: flex; justify-content: center; padding: 8vh 20px; }
.start-kaart { width: 620px; max-width: 100%; }
.start-kaart h1 { font-weight: 300; font-size: 34px; margin: 0 0 6px; }
.start-kaart h1 span { color: var(--tekst-licht); }
.intro { color: var(--tekst-licht); margin: 0 0 26px; }
#nieuw-form { display: flex; gap: 10px; margin-bottom: 28px; }
#nieuw-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-size: 15px;
  background: var(--kaart);
}
.dienst-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
}
.dienst-item:hover { border-color: var(--accent); }
.dienst-item .naam { flex: 1; font-weight: 600; }
.dienst-item .meta { color: var(--tekst-licht); font-size: 13px; }

/* ---------- editor ---------- */
#editor header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: var(--kaart);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 10;
}
#dienst-titel {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--tekst);
  padding: 6px 8px;
}
#dienst-titel:focus { outline: 1px solid var(--rand); border-radius: 6px; }
#save-status { color: var(--tekst-licht); font-size: 13px; min-width: 84px; text-align: right; }

.editor-body { display: flex; gap: 26px; padding: 26px; max-width: 1200px; margin: 0 auto; }
aside { width: 250px; flex-shrink: 0; }
aside h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--tekst-licht); margin: 4px 0 14px; }
main { flex: 1; min-width: 0; }

.veld { display: block; font-size: 13px; color: var(--tekst-licht); margin-bottom: 16px; }
.veld select, .veld input[type=text] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--kaart);
  font-size: 14px;
  color: var(--tekst);
}

/* ---------- blokken ---------- */
.blok {
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.blok.sleep-over { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.blok-kop { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.greep { cursor: grab; color: var(--tekst-licht); font-size: 17px; user-select: none; }
.blok-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--achtergrond);
  border: 1px solid var(--rand);
  color: var(--tekst-licht);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.blok-kop input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--tekst);
  padding: 4px 6px;
  min-width: 0;
}
.blok-kop input:focus { outline: 1px solid var(--rand); border-radius: 6px; }
.blok-acties { display: flex; gap: 2px; }
.blok-inhoud { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.blok-opties { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--tekst-licht); min-width: 180px; }
.blok-opties select { padding: 6px 8px; border: 1px solid var(--rand); border-radius: 6px; background: var(--kaart); }
.blok-opties label.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.dropzone {
  border: 1.5px dashed var(--rand);
  border-radius: 10px;
  padding: 10px;
  min-width: 130px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--tekst-licht);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  background: #fbfaf8;
}
.dropzone:hover, .dropzone.sleep-over { border-color: var(--accent); color: var(--accent); }
.dropzone img { max-width: 110px; max-height: 76px; border-radius: 6px; }
.dropzone .bestand { font-size: 12px; color: var(--tekst); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone .duur { font-size: 12px; }

.foto-strip { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.foto-thumb { position: relative; }
.foto-thumb img { width: 86px; height: 62px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rand); display: block; }
.foto-thumb .weg, .foto-thumb .schuif-l, .foto-thumb .schuif-r {
  position: absolute;
  background: rgba(30,30,30,.65);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  display: none;
}
.foto-thumb:hover .weg, .foto-thumb:hover .schuif-l, .foto-thumb:hover .schuif-r { display: block; }
.foto-thumb .weg { top: 3px; right: 3px; }
.foto-thumb .schuif-l { bottom: 3px; left: 3px; }
.foto-thumb .schuif-r { bottom: 3px; right: 3px; }

.calc { width: 100%; font-size: 13px; color: var(--tekst-licht); }
.calc.te-kort { color: var(--waarschuwing); font-weight: 600; }

.blok-toevoegen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 4px;
  color: var(--tekst-licht);
  font-size: 14px;
}

/* ---------- genereren ---------- */
#genereer-status { font-size: 13px; margin-top: 20px; }
#genereer-status .bezig { color: var(--tekst-licht); }
#genereer-status .fout { color: var(--fout); white-space: pre-wrap; }
#genereer-status .waarschuwing { color: var(--waarschuwing); margin-top: 6px; }
#genereer-status .klaar { color: var(--ok); }
#genereer-status a.knop { display: inline-block; margin-top: 10px; text-decoration: none; }

.leeg-melding {
  text-align: center;
  color: var(--tekst-licht);
  padding: 46px 20px;
  border: 1.5px dashed var(--rand);
  border-radius: 12px;
}

/* ---------- inloggen ---------- */
#auth { display: flex; justify-content: center; padding: 10vh 20px; }
.auth-kaart { width: 440px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs .knop.actief { border-color: var(--accent); color: var(--accent); font-weight: 600; }
#auth-form { display: flex; flex-direction: column; gap: 10px; }
#auth-form input {
  padding: 10px 14px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-size: 15px;
  background: var(--kaart);
}
#auth-fout { color: var(--fout); font-size: 13px; margin-top: 10px; min-height: 18px; }
.auth-voetnoot { color: var(--tekst-licht); font-size: 12px; margin-top: 18px; }

/* ---------- topbalk ---------- */
.topbalk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--kaart);
  border-bottom: 1px solid var(--rand);
}
.topbalk-titel { font-weight: 600; }
.topbalk .ruimte { flex: 1; }
.topbalk a.knop { text-decoration: none; display: inline-block; }
.saldo-chip {
  background: var(--achtergrond);
  border: 1px solid var(--rand);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
#start { display: block; padding: 0; }
#start .start-kaart { margin: 6vh auto 40px; padding: 0 20px; }

/* ---------- status-badges ---------- */
.status-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  border: 1px solid var(--rand);
  color: var(--tekst-licht);
}
.status-badge.definitief { border-color: var(--ok); color: var(--ok); }
.status-badge.vergrendeld { border-color: var(--waarschuwing); color: var(--waarschuwing); }

/* ---------- venster-banner ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 22px;
  font-size: 14px;
}
.banner.ok { background: #eaf3ec; color: var(--ok); }
.banner.slot { background: #f7efe2; color: var(--waarschuwing); }

/* vergrendeld: alles zichtbaar maar niet bewerkbaar */
#editor.readonly .editor-body { opacity: .75; }
#editor.readonly .editor-body main,
#editor.readonly aside .veld { pointer-events: none; }
#editor.readonly #genereer-status { pointer-events: auto; }

/* ---------- modals ---------- */
.modal-achtergrond {
  position: fixed;
  inset: 0;
  background: rgba(30, 28, 25, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: var(--kaart);
  border-radius: 14px;
  padding: 22px 26px;
  width: 520px;
  max-width: 100%;
  max-height: 85vh;
  overflow: auto;
}
.modal-kop { display: flex; align-items: center; justify-content: space-between; }
.modal h2 { margin: 0; font-size: 20px; font-weight: 600; }
.modal h3 { font-size: 14px; margin: 20px 0 8px; }
.modal .fout { color: var(--fout); font-size: 13px; min-height: 18px; margin-top: 8px; }
#ww-form { display: flex; gap: 8px; flex-wrap: wrap; }
#ww-form input { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; }
#ww-melding { font-size: 13px; color: var(--tekst-licht); margin-top: 8px; }

/* ---------- shop ---------- */
.pakket {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.pakket-naam { font-weight: 600; width: 90px; }
.pakket-prijs { font-size: 17px; width: 90px; }
.pakket-per { flex: 1; color: var(--tekst-licht); font-size: 13px; }

/* ---------- tabellen (account/admin) ---------- */
.mini-tabel { border-collapse: collapse; width: 100%; font-size: 13px; }
.mini-tabel th {
  text-align: left;
  color: var(--tekst-licht);
  font-weight: 600;
  border-bottom: 1px solid var(--rand);
  padding: 6px 8px 6px 0;
}
.mini-tabel td { border-bottom: 1px solid var(--rand); padding: 6px 8px 6px 0; }
.mini-tabel .plus { color: var(--ok); font-weight: 600; }
.mini-tabel .min { color: var(--fout); font-weight: 600; }

/* ---------- editor-extra ---------- */
.veld input[type=date] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--kaart);
  font-size: 14px;
  color: var(--tekst);
}
.veld-uitleg { display: block; font-size: 11.5px; color: var(--tekst-licht); margin-top: 4px; line-height: 1.4; }
#genereer-status a.knop { margin-right: 8px; }

/* ---------- admin ---------- */
.admin-body { max-width: 1100px; margin: 0 auto; padding: 26px 20px; }
.stat-rij { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.stat {
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 130px;
}
.stat .waarde { font-size: 24px; font-weight: 600; }
.stat .label { font-size: 12px; color: var(--tekst-licht); }
.admin-body h2 { font-size: 16px; margin: 26px 0 10px; }
.admin-body .mini-tabel { background: var(--kaart); border: 1px solid var(--rand); border-radius: 10px; }
.admin-body .mini-tabel th, .admin-body .mini-tabel td { padding: 8px 12px; }
.admin-acties { display: flex; gap: 4px; flex-wrap: wrap; }
