:root {
    --tekst: #1c2b3a;
    --grijs: #5b6b7a;
    --lichtgrijs: #8a97a3;
    --rand: #dde4ea;
    --achtergrond-koel: #f4f7f9;
    --accent: #1c2b3a;
    --rood: #a3271e;
    --roodlicht: #fdecec;
    --groen: #1c7a4d;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--tekst);
    margin: 0;
    background: #fff;
}

.pagina {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 20px 0 8px; }

.koptekst-label {
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 2px;
}

.header-balk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
}

.knoppenrij { display: flex; gap: 8px; flex-wrap: wrap; }

a.knop, button, input[type=submit] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
a.knop.secundair, button.secundair {
    background: #fff;
    color: var(--tekst);
    border: 1px solid var(--rand);
}
a.knop.gevaar, button.gevaar {
    background: var(--roodlicht);
    color: var(--rood);
}

.filterbalk {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.filterbalk input[type=text], .filterbalk select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--rand);
    font-size: 14px;
}
.zoekrij { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; }
.zoekrij input[type=text] { flex: 1 1 auto; min-width: 0; width: auto; }
.zoekrij button { flex: 0 0 auto; justify-content: center; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid var(--rand);
    border-radius: 10px;
    overflow: hidden;
}
.tabel-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}
.tabel-scroll table {
    border-radius: 0;
}
thead th {
    background: var(--achtergrond-koel);
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
}
thead th a { color: var(--tekst); text-decoration: none; font-weight: 600; }
tbody td {
    padding: 9px 12px;
    border-top: 1px solid #eef1f4;
}
tbody tr:hover { background: #fafcfd; }
td.acties { white-space: nowrap; }
td.acties a { margin-right: 10px; font-size: 13px; }

@media (max-width: 640px) {
    .pagina { padding: 12px; }
    h1 { font-size: 18px; }
    .header-balk { gap: 8px 10px; }
    .knoppenrij { gap: 6px; }
    a.knop, button, input[type=submit] {
        padding: 10px 12px;
        font-size: 13px;
    }
    .filterbalk { flex-direction: column; align-items: stretch; }
    .filterbalk input[type=text], .filterbalk select { width: 100%; box-sizing: border-box; }
    .zoekrij input[type=text] { width: auto; }
    form.formulier { max-width: 100%; }
    .keuzekaarten { flex-direction: column; }
    .keuzekaart { width: 100%; box-sizing: border-box; }

    /* Records-tabel wordt een reeks kaartjes i.p.v. opzij scrollen. */
    .tabel-scroll { overflow-x: visible; }
    .records-tabel { border: none; }
    .records-tabel thead { display: none; }
    .records-tabel, .records-tabel tbody, .records-tabel tr, .records-tabel td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .records-tabel tr {
        border: 1px solid var(--rand);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 4px 10px;
        background: #fff;
    }
    .records-tabel td {
        border-top: none;
        border-bottom: 1px solid #f0f2f4;
        padding: 7px 0;
        display: flex;
        justify-content: space-between;
        gap: 10px;
        text-align: right;
    }
    .records-tabel td:last-child { border-bottom: none; }
    .records-tabel td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--grijs);
        text-align: left;
        flex: 0 0 auto;
    }
    .records-tabel td.bulk-td {
        justify-content: flex-start;
        border-bottom: 1px solid #f0f2f4;
    }
    .records-tabel td.acties {
        justify-content: flex-end;
        gap: 14px;
    }
}

.leeg-bericht { text-align: center; padding: 30px; color: var(--lichtgrijs); }
.telling { margin-top: 10px; font-size: 12px; color: var(--lichtgrijs); }

form.formulier {
    max-width: 480px;
}
form.formulier label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--grijs);
}
form.formulier input, form.formulier select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--rand);
    font-size: 14px;
    font-family: inherit;
}

.foutmelding { color: var(--rood); background: var(--roodlicht); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.succesmelding { color: var(--groen); background: #eaf7f0; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

.login-pagina { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--achtergrond-koel); }
.login-vak { background: #fff; padding: 30px; border-radius: 12px; border: 1px solid var(--rand); width: 280px; }
.login-vak h1 { margin-bottom: 16px; }
.login-vak label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.login-vak input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--rand); }
.login-vak button { width: 100%; margin-top: 6px; justify-content: center; }

.keuzekaarten { display: flex; gap: 14px; flex-wrap: wrap; }
.keuzekaart {
    border: 1px solid var(--rand);
    border-radius: 10px;
    padding: 16px;
    width: 260px;
    text-align: left;
    cursor: pointer;
    background: #fff;
}
.keuzekaart:hover { border-color: var(--accent); }
.keuzekaart h3 { margin: 0 0 6px; font-size: 15px; }
.keuzekaart p { margin: 0; font-size: 12px; color: var(--grijs); }

.sectie { border: 1px solid var(--rand); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.sectie h3 { margin: 0 0 8px; font-size: 14px; }
.regel { padding: 3px 0; font-size: 13px; }

.leerlingknoppen { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.leerlingknoppen button { background: #fff; color: var(--tekst); border: 1px solid var(--rand); justify-content: flex-start; width: 100%; text-align: left; }
.leerlingknoppen button:hover { border-color: var(--accent); }

.logo-home { display: inline-block; line-height: 0; }
.logo-home img { display: block; border-radius: 6px; }
.kop-met-logo { display: flex; align-items: center; gap: 10px; }

@media print {
    .header-balk .knoppenrij,
    .filterbalk,
    td.acties,
    th:last-child,
    .logo-home,
    .telling,
    .succesmelding {
        display: none !important;
    }
    body { color: #000; }
    table { border: 1px solid #000; }
    thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.bulk-td { display: none; }
.bulk-balk { display: none; }
body.bulk-actief .bulk-td { display: table-cell; }
body.bulk-actief .bulk-balk { display: flex; }

/* Locatie-tekening: compact overzicht + volledig detailoverzicht, altijd
   allebei zichtbaar (op zowel mobiel als PC). */
.locatie-mobiel { display: block; }
.locatie-desktop { display: block; margin-top: 4px; }

/* Zoom-bediening voor het volledige locatie-overzicht op desktop. */
.zoom-balk { display: flex; gap: 8px; margin-bottom: 8px; }
.zoom-scroll {
    overflow: auto;
    max-height: none;
    border: 1px solid var(--rand);
    border-radius: 8px;
    padding: 4px;
    cursor: grab;
    background: var(--achtergrond-koel);
    /* Firefox: scrollbalk verbergen (blijft wel scrollbaar/sleepbaar) */
    scrollbar-width: none;
}
/* Chrome, Edge, Safari: scrollbalk verbergen */
.zoom-scroll::-webkit-scrollbar {
    display: none;
}
.zoom-scroll.slepen {
    cursor: grabbing;
    user-select: none;
}
[id^="zoom-inner-"] { transition: transform 0.15s ease; width: fit-content; }

/* Klassen-kiezer (meerdere klassen tegelijk selecteren) op klas.php. */
.klassen-kiezer {
    display: flex;
    flex-direction: column;
    gap: 6px 12px;
    border: 1px solid var(--rand);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.klas-checkbox { display: flex; align-items: center; gap: 5px; font-size: 14px; white-space: nowrap; }
