:root {
    --achtergrond: #f4f5f7;
    --paneel: #ffffff;
    --rand: #e0e3e8;
    --tekst: #1f2430;
    --tekst-gedempt: #667085;
    --primair: #2a5c8a;
    --primair-donker: #1e4566;
    --gevaar: #c0392b;
    --gevaar-achtergrond: #fbeae8;
    --succes: #2e7d4f;
    --succes-achtergrond: #e8f5ee;
    --waarschuwing-achtergrond: #fff4e0;
    --waarschuwing-tekst: #8a5a10;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--achtergrond);
    color: var(--tekst);
    display: flex;
    min-height: 100vh;
}

a {
    color: var(--primair);
}

h1,
h2,
h3 {
    margin: 0 0 0.6rem;
    font-weight: 600;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.15rem;
}

h3 {
    font-size: 1rem;
}

p {
    line-height: 1.6;
    color: var(--tekst-gedempt);
}

.login-wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--achtergrond);
}
.login-kaart {
    background: var(--paneel);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 2.2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 18px rgba(20, 25, 40, 0.06);
}

.login-kaart h1 {
    text-align: center;
}

.login-kaart p.subtitel {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.6rem;
}

.admin-zijbalk {
    width: 220px;
    background: #17202e;
    color: #cfd6e2;
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.admin-zijbalk .logo {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    padding: 0 0.4rem;
}

.admin-zijbalk nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.admin-zijbalk a {
    color: #cfd6e2;
    text-decoration: none;
    padding: 0.65rem 0.8rem;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 500;
}

.admin-zijbalk a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.admin-zijbalk a.actief {
    background: var(--primair);
    color: #fff;
}

.admin-zijbalk .onder {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-hoofd {
    flex: 1;
    padding: 2rem 2.4rem 3rem;
    max-width: 980px;
    margin-left: 220px;
}

.menu-schakel,
.menu-sluiten,
.menu-overlay {
    display: none;
}

.paneel {
    background: var(--paneel);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.6rem;
    margin-bottom: 1.6rem;
}

.melding {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.4rem;
    font-weight: 600;
    font-size: 0.92rem;
}
.melding-succes {
    background: var(--succes-achtergrond);
    color: var(--succes);
}
.melding-fout {
    background: var(--gevaar-achtergrond);
    color: var(--gevaar);
}

.knop {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.knop-primair {
    background: var(--primair);
    color: #fff;
}
.knop-primair:hover {
    background: var(--primair-donker);
}
.knop-secundair {
    background: #fff;
    border-color: var(--rand);
    color: var(--tekst);
}
.knop-secundair:hover {
    border-color: var(--primair);
    color: var(--primair);
}
.knop-gevaar {
    background: var(--gevaar-achtergrond);
    color: var(--gevaar);
}
.knop-gevaar:hover {
    background: var(--gevaar);
    color: #fff;
}
.knop-klein {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}
.knop-icoon {
    padding: 0.4rem;
    gap: 0;
}
.knop-icoon svg {
    width: 16px;
    height: 16px;
    display: block;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-rij {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.tabel-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabel-wrap table {
    min-width: 640px;
}

@media (max-width: 640px) {
    .form-rij {
        grid-template-columns: 1fr;
    }
}

.veld {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.veld[hidden] {
    display: none;
}

.veld label {
    font-weight: 600;
    font-size: 0.88rem;
}

.veld .hint {
    font-size: 0.78rem;
    color: var(--tekst-gedempt);
}

.veld input,
.veld textarea {
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--rand);
    background: #fff;
    color: var(--tekst);
}

.veld select {
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.6rem 2.2rem 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--rand);
    background-color: #fff;
    color: var(--tekst);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 8 10 13 15 8'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
}

.veld select::-ms-expand {
    display: none;
}

.veld input:focus,
.veld select:focus,
.veld textarea:focus {
    outline: none;
    border-color: var(--primair);
}

.veld textarea {
    resize: vertical;
    min-height: 100px;
}

datalist {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid var(--rand);
    vertical-align: middle;
}

th {
    color: var(--tekst-gedempt);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td.acties {
    text-align: right;
    white-space: nowrap;
}

td.acties form {
    display: inline-flex;
    flex-direction: row;
    gap: 0;
    margin: 0;
    vertical-align: middle;
}

td.acties > * {
    margin-left: 0.4rem;
    vertical-align: middle;
}

td.acties > *:first-child {
    margin-left: 0;
}

img.miniatuur {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--rand);
}

img.miniatuur.miniatuur-groot {
    width: 140px;
    height: 140px;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-vrij {
    background: var(--succes-achtergrond);
    color: var(--succes);
}

.badge-weinig {
    background: var(--waarschuwing-achtergrond);
    color: var(--waarschuwing-tekst);
}

.badge-vol {
    background: var(--gevaar-achtergrond);
    color: var(--gevaar);
}

.categorie-groep {
    margin-bottom: 2rem;
}

.categorie-groep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.categorie-groep-header h3 {
    margin-bottom: 0;
}

.foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
}

.foto-kaart {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.foto-kaart img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.foto-kaart .foto-acties {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
}

.pagina-titel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

body.modal-open {
    overflow: hidden;
}

.modal-achtergrond {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 30, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.modal-achtergrond.actief {
    display: flex;
}

.modal {
    background: var(--paneel);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(20, 25, 40, 0.25);
}

.modal-breed {
    max-width: 640px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--rand);
}

.modal-header h2 {
    margin: 0;
}

.modal-sluiten {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--tekst-gedempt);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.modal-sluiten:hover {
    color: var(--tekst);
}

.modal form {
    padding: 1.4rem;
}

.modal-inhoud {
    padding: 1.4rem 1.4rem 0;
}

.modal-inhoud table {
    font-size: 0.88rem;
}

.modal-categorie-vast {
    margin: 0;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    background: var(--achtergrond);
    border-radius: 6px;
    border: 1px solid var(--rand);
}

.modal-acties {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-direction: row;
}

.modal-acties.modal-acties--vast {
    padding: 1.4rem;
    border-top: 1px solid var(--rand);
    margin-top: 0.4rem;
}

.bericht-kaarten {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.bericht-kaart {
    background: var(--paneel);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    position: relative;
    transition: box-shadow 0.15s ease;
}

.bericht-kaart:hover {
    box-shadow: 0 4px 14px rgba(20, 25, 40, 0.06);
}

.bericht-kaart.ongelezen {
    border-left: 3px solid var(--primair);
    background: #f8fafc;
}

.bericht-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bericht-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--tekst);
    word-break: break-word;
}

.bericht-acties {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
    margin-top: -0.2rem;
    margin-right: -0.2rem;
}

.bericht-verwijder,
.bericht-gelezen {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bericht-verwijder {
    color: var(--gevaar);
}

.bericht-verwijder:hover {
    background: var(--gevaar-achtergrond);
}

.bericht-gelezen {
    color: var(--succes);
}

.bericht-gelezen:hover {
    background: var(--succes-achtergrond);
}

.bericht-verwijder svg,
.bericht-gelezen svg {
    width: 18px;
    height: 18px;
}

.bericht-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.2rem;
}

.bericht-meta-rij {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.92rem;
}

.bericht-meta-label {
    color: var(--tekst-gedempt);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    min-width: 5.5rem;
}

.bericht-meta-waarde {
    color: var(--tekst);
    word-break: break-word;
}

.bericht-meta-waarde a {
    color: var(--primair);
    text-decoration: none;
}

.bericht-meta-waarde a:hover {
    text-decoration: underline;
}

.bericht-tekst {
    border-top: 1px solid var(--rand);
    padding-top: 1rem;
}

.bericht-tekst-label {
    color: var(--tekst-gedempt);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.bericht-tekst p {
    margin: 0;
    color: var(--tekst);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    body {
        flex-direction: column;
        min-height: auto;
    }
    .admin-zijbalk {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        max-width: 80vw;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 1.4rem 1rem;
        flex-direction: column;
        align-items: stretch;
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 200;
    }

    .admin-zijbalk.open {
        transform: translateX(0);
    }

    .admin-zijbalk .logo {
        margin-bottom: 2rem;
        margin-right: 0;
        white-space: normal;
    }

    .admin-zijbalk nav {
        flex-direction: column;
        flex: 1;
        gap: 0.2rem;
    }

    .admin-zijbalk nav a,
    .admin-zijbalk .onder a {
        white-space: normal;
    }

    .admin-zijbalk .onder {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        padding-top: 0.8rem;
        padding-left: 0;
        margin-top: 0.8rem;
        margin-left: 0;
        flex-direction: column;
    }

    .admin-hoofd {
        padding: 1.4rem 1.2rem 2.4rem;
        max-width: 100%;
        margin-left: 0;
    }

    .menu-schakel {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--paneel);
        border: 1px solid var(--rand);
        color: var(--tekst);
        padding: 0.5rem;
        border-radius: 6px;
        cursor: pointer;
        margin-bottom: 1.2rem;
    }

    .menu-schakel:hover {
        border-color: var(--primair);
        color: var(--primair);
    }

    .menu-sluiten {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: #cfd6e2;
        font-size: 1.8rem;
        line-height: 1;
        cursor: pointer;
        padding: 0.2rem 0.5rem;
    }

    .menu-sluiten:hover {
        color: #fff;
    }

    .menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 20, 30, 0.5);
        z-index: 150;
    }

    .menu-overlay.actief {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    .paneel {
        padding: 1.1rem;
    }

    .pagina-titel h1 {
        font-size: 1.3rem;
    }

    .knop {
        min-height: 40px;
    }

    table,
    table thead,
    table tbody,
    table tr,
    table td {
        display: block;
        width: 100%;
    }
    table thead {
        position: absolute;
        left: -9999px;
    }
    table tr {
        border: 1px solid var(--rand);
        border-radius: var(--radius);
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.8rem;
    }
    table td {
        border-bottom: none;
        padding: 0.35rem 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
    }
    table td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--tekst-gedempt);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
    }
    td.acties {
        justify-content: flex-end;
        white-space: normal;
    }
    td.acties::before {
        display: none;
    }
    td.acties > * {
        margin-left: 0.5rem;
    }

    .foto-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.6rem;
    }

    .modal {
        max-width: 100%;
    }
    .modal-acties {
        flex-direction: column-reverse;
    }
    .modal-acties .knop {
        width: 100%;
        justify-content: center;
    }

    .bericht-kaart {
        padding: 1.1rem;
    }
    .bericht-meta-label {
        min-width: 4.5rem;
    }
}
