:root {
    --achtergrond: #f7f3ee;
    --kaart: #ffffff;
    --tekst: #2b2622;
    --zacht: #776d64;
    --rand: #e6ddd3;
    --accent: #b3261e;
    --accent-donker: #8c1c16;
    --groen: #2e7d4f;
    --groen-licht: #e3f2e8;
    --geel-licht: #fff4d6;
    --grijs-licht: #f0ece7;
    --rood-licht: #fde7e5;
    --radius: 12px;
    --schaduw: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tekst);
    background: var(--achtergrond);
}

.binnen { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.binnen { padding-top: 24px; padding-bottom: 32px; min-height: 70vh; }

a { color: var(--accent); }
h1, h2 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }

/* --- Kopbalk ------------------------------------------------------------ */
.kopbalk { background: var(--accent); color: #fff; }
.kopbalk .binnen { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.logo { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.menu a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 999px; opacity: .9; }
.menu a:hover { background: rgba(255,255,255,.15); opacity: 1; }
.menu a.actief { background: #fff; color: var(--accent); opacity: 1; font-weight: 600; }
.gebruiker { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.gebruiker a, .gebruiker .link { color: #fff; opacity: .85; }
.gebruiker .naam { font-weight: 600; }
@media (max-width: 700px) {
    .kopbalk .binnen { justify-content: space-between; }
    .menu { order: 3; flex-basis: 100%; justify-content: space-between; }
    .menu a { padding: 6px 10px; }
}

/* --- Kaarten & raster ----------------------------------------------------- */
.kaart { background: var(--kaart); border-radius: var(--radius); box-shadow: var(--schaduw); padding: 20px; margin-bottom: 20px; }
.kaart.smal { max-width: 420px; margin: 24px auto; }
.raster { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .raster { grid-template-columns: 1fr; } }

.zacht { color: var(--zacht); }
.klein { font-size: .875rem; }
.leeg { color: var(--zacht); background: var(--grijs-licht); padding: 16px; border-radius: 8px; text-align: center; }
.aantal { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 999px; background: var(--grijs-licht); color: var(--zacht); font-size: .9rem; text-align: center; vertical-align: middle; }

/* --- Formulieren ----------------------------------------------------------- */
.formulier { display: flex; flex-direction: column; gap: 6px; }
.formulier label { font-weight: 600; font-size: .9rem; margin-top: 8px; }
input[type=text], input[type=password], input[type=url], select, textarea {
    width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
.teller { font-size: .8rem; text-align: right; }

.knop {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; text-decoration: none; white-space: nowrap;
}
.knop.primair { background: var(--accent); color: #fff; }
.knop.primair:hover { background: var(--accent-donker); }
.knop.secundair { background: var(--groen); color: #fff; }
.knop.zacht-knop { background: var(--grijs-licht); color: var(--tekst); border-color: var(--rand); }
.knop.zacht-knop:hover { background: var(--rand); }
.knop.gevaar { background: #fff; color: var(--accent); border-color: var(--accent); }
.knop.gevaar:hover { background: var(--rood-licht); }
.knop.breed { width: 100%; margin-top: 12px; padding: 12px; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* --- Lijsten met items ------------------------------------------------------ */
.lijst { list-style: none; margin: 12px 0; padding: 0; }
.item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--rand); }
.item:first-child { border-top: 0; }
.item-tekst { flex: 1; overflow-wrap: anywhere; }
.item-knoppen { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
.item.bezet .item-tekst { color: var(--zacht); }
.voor { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--zacht); }
.extlink { font-size: .85rem; white-space: nowrap; }
@media (max-width: 560px) { .item { flex-direction: column; } .item-knoppen { justify-content: flex-start; } }

.bewerk { display: inline-block; }
.bewerk summary { list-style: none; }
.bewerk summary::-webkit-details-marker { display: none; }
.bewerk[open] { display: block; width: 100%; }
.bewerk[open] .formulier { margin-top: 10px; padding: 12px; background: var(--grijs-licht); border-radius: 8px; min-width: 260px; }

.status { margin-top: 4px; }
.label { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.label.vrij { background: var(--groen-licht); color: var(--groen); }
.label.mijn { background: var(--geel-licht); color: #7a5600; }
.label.bezet { background: var(--grijs-licht); color: var(--zacht); }

/* --- Familie ------------------------------------------------------------------ */
.personen { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.persoon { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border: 1px solid var(--rand); border-radius: var(--radius); text-decoration: none; color: var(--tekst); text-align: center; transition: transform .1s, box-shadow .1s; }
.persoon:hover { transform: translateY(-2px); box-shadow: var(--schaduw); border-color: var(--accent); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; }
.persoon-naam { font-weight: 600; }

/* --- Meldingen -------------------------------------------------------------- */
.melding { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.melding-ok { background: var(--groen-licht); color: #1d5435; }
.melding-fout { background: var(--rood-licht); color: var(--accent-donker); }
.melding-info { background: var(--geel-licht); color: #6b4c00; }

/* --- Beheer -------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 8px; text-decoration: none; background: var(--kaart); color: var(--tekst); box-shadow: var(--schaduw); }
.tabs a.actief { background: var(--accent); color: #fff; }
.tabel-wrap { overflow-x: auto; }
table.tabel { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tabel th, .tabel td { padding: 8px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.tabel th { font-size: .8rem; text-transform: uppercase; color: var(--zacht); letter-spacing: .03em; }
.tabel input[type=text], .tabel select { padding: 6px 8px; min-width: 120px; }
.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.rij-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.rij-form > * { flex: 0 1 auto; }

.voet { color: var(--zacht); font-size: .8rem; text-align: center; padding-bottom: 24px; }
