:root {
    color-scheme: light only;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --achtergrond: #f1f5f9;
    --wit: #ffffff;
    --tekst: #1e293b;
    --subtekst: #64748b;
    --rand: #e2e8f0;
    --succes: #22c55e;
    --gevaar: #ef4444;
    --waarschuwing: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--achtergrond);
    color: var(--tekst);
}

/* Login */
.login-pagina {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: var(--wit);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.login-box p {
    color: var(--subtekst);
    margin-bottom: 1.5rem;
}

.login-box form {
    text-align: left;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--tekst);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--rand);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    background: var(--wit);
    color: var(--tekst);
    transition: border-color 0.2s;
}

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

button, .knop {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

button:hover, .knop:hover {
    background: var(--primary-dark);
}

.knop-gevaar {
    background: var(--gevaar);
}

.knop-gevaar:hover {
    background: #dc2626;
}

.knop-succes {
    background: var(--succes);
}

.foutmelding {
    background: #fee2e2;
    color: var(--gevaar);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.succesbericht {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.zijbalk {
    width: 240px;
    background: var(--wit);
    border-right: 1px solid var(--rand);
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.zijbalk h2 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 2rem;
    padding-left: 0.5rem;
}

.zijbalk nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--tekst);
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: background 0.2s;
}

.zijbalk nav a:hover,
.zijbalk nav a.actief {
    background: var(--achtergrond);
    color: var(--primary);
}

.zijbalk .uitloggen {
    position: absolute;
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
}

.inhoud {
    margin-left: 240px;
    padding: 2rem;
    flex: 1;
}

.pagina-titel {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Kaarten */
.kaarten-rij {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kaart {
    background: var(--wit);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.kaart h3 {
    font-size: 0.875rem;
    color: var(--subtekst);
    margin-bottom: 0.5rem;
}

.kaart .bedrag {
    font-size: 1.75rem;
    font-weight: 700;
}

.kaart .bedrag.groen { color: var(--succes); }
.kaart .bedrag.rood { color: var(--gevaar); }
.kaart .bedrag.blauw { color: var(--primary); }

/* Tabel */
.tabel-container {
    background: var(--wit);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--subtekst);
    border-bottom: 1px solid var(--rand);
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--rand);
    font-size: 0.9rem;
}

tr:last-child td
/* Thema: Minimalistisch */
body.thema-minimalistisch {
    --primary: #737373;
    --primary-dark: #525252;
    --achtergrond: #fafafa;
    --wit: #ffffff;
    --tekst: #171717;
    --subtekst: #737373;
    --rand: #e5e5e5;
}

/* Thema: Modern */
body.thema-modern {
    --primary: #a855f7;
    --primary-dark: #9333ea;
    --achtergrond: #fdf4ff;
    --wit: #ffffff;
    --tekst: #3b0764;
    --subtekst: #a855f7;
    --rand: #e9d5ff;
}

/* Thema: Donker */
body.thema-donker {
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --achtergrond: #1e293b;
    --wit: #0f172a;
    --tekst: #f1f5f9;
    --subtekst: #94a3b8;
    --rand: #334155;
    --succes: #4ade80;
    --gevaar: #f87171;
}
/* Hamburger knop */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* Overlay achter menu op mobiel */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 149;
}

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

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .zijbalk {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 150;
        width: 260px;
    }

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

    .inhoud {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }

    .kaarten-rij {
        grid-template-columns: 1fr 1fr;
    }

    .formulier-rij {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .acties {
        flex-direction: column;
    }

    /* Dashboard grafieken */
    div[style*="grid-template-columns:2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Login pagina */
    .login-box {
        margin: 1rem;
    }

    /* Tabel horizontaal scrollen op klein scherm */
    .tabel-container {
        overflow-x: auto;
    }

    /* Pagina titel kleiner */
    .pagina-titel {
        font-size: 1.2rem;
    }

    /* Modal op mobiel */
    #modal > div {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .kaarten-rij {
        grid-template-columns: 1fr;
    }
}
/* Mobiele kaartweergave voor tabellen */
@media (max-width: 768px) {

    /* Verberg tabelheaders op mobiel */
    .mobiel-kaart thead {
        display: none;
    }

    /* Elke rij wordt een kaart */
    .mobiel-kaart tbody tr {
        display: block;
        background: var(--wit);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        border: 1px solid var(--rand);
    }

    /* Elke cel wordt een rij in de kaart */
    .mobiel-kaart tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border-bottom: 1px solid var(--rand);
        font-size: 0.875rem;
    }

    .mobiel-kaart tbody td:last-child {
        border-bottom: none;
    }

    /* Label voor elke cel */
    .mobiel-kaart tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--subtekst);
        font-size: 0.8rem;
        flex-shrink: 0;
        margin-right: 1rem;
    }

    /* Acties knoppem naast elkaar */
    .mobiel-kaart tbody td .acties {
        flex-direction: row;
    }
}
.formulier-kaart {
    background: var(--wit);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--rand);
    max-width: 600px;
    margin-bottom: 1.5rem;
}