/* Metropolis - Stadsplannings simulator */

/* ============================================
   BESTEMMINGEN PANEL
   ============================================ */
.bestemmingen-panel {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-self: flex-start;
}

.bestemmingen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #2d4a22;
}

.bestemmingen-titel {
    font-size: 0.95rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.bestemmingen-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 8px;
    min-width: 22px;
    text-align: center;
}

/* Lege staat */
.bestemmingen-leeg-staat {
    padding: 20px 12px;
    text-align: center;
    color: #888;
}

.bestemmingen-leeg-icoon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

.bestemmingen-leeg-staat p {
    font-size: 0.82rem;
    margin: 0 0 4px;
    color: #555;
    font-weight: 600;
}

.bestemmingen-leeg-hint {
    font-size: 0.75rem !important;
    color: #999 !important;
    font-weight: normal !important;
}

/* Lijst */
.bestemmingen-lijst {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bestemmingen-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    background: #f8faf7;
    border: 1px solid #dce8d8;
    border-radius: 6px;
    transition: background 0.12s ease;
}

.bestemmingen-item:hover {
    background: #eef5eb;
}

.bestemmingen-item-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}

.bestemmingen-img-icon {
    width: 1.3em;
    height: 1.3em;
    object-fit: cover;
    border-radius: 3px;
}

.bestemmingen-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.bestemmingen-item-tekst {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bestemmingen-item-naam {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e3a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bestemmingen-leeg-cel {
    color: #999;
    font-weight: 400;
    font-style: italic;
}

.bestemmingen-item-cel {
    font-size: 0.7rem;
    color: #888;
}

/* Categorie badge */
.bestemmingen-item-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 3px;
    background: #e8f5e9;
    color: #2d4a22;
    display: inline-block;
    width: fit-content;
}

.bestemmingen-cat-veiligheid    { background: #dbeafe; color: #1d4ed8; }
.bestemmingen-cat-recreatie     { background: #d1fae5; color: #065f46; }
.bestemmingen-cat-milieukwaliteit { background: #dcfce7; color: #166534; }
.bestemmingen-cat-voorzieningen { background: #fef3c7; color: #92400e; }
.bestemmingen-cat-mobiliteit    { background: #ede9fe; color: #5b21b6; }

/* Verwijder-knop in lijst */
.bestemmingen-item-verwijder {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color 0.12s ease, background 0.12s ease;
}

.bestemmingen-item-verwijder:hover {
    color: #c0392b;
    background: #fde8e6;
}

/* Cel badge */
.cel-bestemming-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.8rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0.85;
}

.cel.is-bestemming {
    border-color: #d97706;
    background-color: #fffbeb;
}

/* Actieknopje op de cel (verschijnt bij selectie) */
.cel-acties {
    display: none;
    gap: 4px;
    margin-top: 4px;
    justify-content: center;
}

/* Goedgekeurde cellen */
.cel.is-goedgekeurd {
    border-color: #15803d;
    box-shadow: inset 0 0 0 2px rgba(21, 128, 61, 0.25);
}
.cel-goedgekeurd-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.8rem;
    color: #15803d;
    background: #dcfce7;
    border-radius: 999px;
    padding: 1px 6px;
    font-weight: 700;
}
.cel-goedkeur-status {
    font-size: 0.7rem;
    color: #15803d;
    text-align: center;
    line-height: 1.3;
    margin-top: 4px;
    padding: 3px 6px;
    background: #f0fdf4;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
}
.cel-goedkeur-status strong { font-weight: 700; }

.btn-goedkeuren {
    font-size: 0.7rem;
    font-weight: 700;
    background: #15803d;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-goedkeuren:hover { background: #166534; }
.btn-goedkeuring-intrekken {
    font-size: 0.68rem;
    font-weight: 700;
    background: #fde8e6;
    color: #c0392b;
    border: 1px solid #f0bcb5;
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-goedkeuring-intrekken:hover { background: #fecaca; }

.btn-stel-bestemming {
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 700;
    background: #d97706;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-stel-bestemming:hover {
    background: #b45309;
}

.btn-verwijder-bestemming {
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 700;
    background: #fde8e6;
    color: #c0392b;
    border: 1px solid #f0bcb5;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-verwijder-bestemming:hover {
    background: #fecaca;
}

@media (max-width: 900px) {
    .bestemmingen-panel {
        width: 100%;
    }
}

.viewer-banner {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
    padding: .6rem 1rem;
    font-size: .88rem;
    text-align: center;
}

/* Skip-to-content link — zichtbaar bij Tab, anders verborgen */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #2d4a22;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 6px 0;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.1s ease;
}

.skip-link:focus {
    top: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    color: #333;
}

header {
    background-color: #2d4a22;
    color: white;
    padding: 15px 20px;
}

header h1 {
    font-size: 1.5rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-merk {
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
}

.header-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    color: #d8e8d2;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.header-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.header-nav .nav-link:active {
    transform: scale(0.97);
}

.header-nav .nav-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.header-nav .nav-link.is-actief {
    background: #fff;
    color: #2d4a22;
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        gap: 0.6rem;
    }
    .header-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
}

.header-sub {
    font-size: 0.8rem;
    color: #a3c47a;
    display: block;
}

.taal-knop {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.taal-vlag {
    display: inline-flex;
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.15s ease, transform 0.15s ease;
    border-radius: 3px;
    overflow: hidden;
    line-height: 0;
}

.taal-vlag .fi {
    width: 32px;
    height: 22px;
    background-size: cover;
    display: block;
}

.taal-vlag.actief {
    opacity: 1;
    pointer-events: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #a3c47a;
}

.taal-vlag:not(.actief):hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.taal-btn {
    background-color: white;
    color: #2d4a22;
    border: 2px solid #a3c47a;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.taal-btn:hover {
    background-color: #6cff9a;
    color: white;
}

.melding-sluit {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.7;
}
.melding-sluit:hover { opacity: 1; background: rgba(0,0,0,0.08); }

.melding {
    background-color: #d4edda;
    color: #0011ff;
    padding: 10px 50px 10px 20px;
    border-left: 4px solid #28a745;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: melding-in 0.25s ease-out;
}

.melding-fout {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #c0392b;
}

.melding-fout ul {
    margin: 4px 0 0 18px;
    padding: 0;
    font-size: 0.9rem;
}

@keyframes melding-in {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

main {
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 20px;
}

footer {
    text-align: center;
    padding: 15px;
    color: #595959;
    font-size: 0.85rem;
    margin-top: 30px;
}

/* Layout */
.container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Library */
.library {
    width: 250px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 12px;
    flex-shrink: 0;
    margin-right: 40px;
    margin-bottom: 20px;
}

.library h2,
.grid-wrapper h2 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #2d4a22;
    border-bottom: 2px solid #2d4a22;
    padding-bottom: 4px;
}

#zoekterm {
    width: 100%;
    padding: 4px 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.categorie-titel {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #595959;
    margin: 5px 0 2px;
    font-weight: bold;
}

.library-item {
    padding: 4px 8px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: grab;
    font-size: 0.85rem;
}

.library-item:hover {
    background-color: #e8f5e9;
    border-color: #2d4a22;
}

.library-item.geselecteerd {
    background-color: #c8e6c9;
    border-color: #2d4a22;
    outline: 2px solid #2d4a22;
}

.library-item.wordt-gesleept {
    opacity: 0.4;
}

/* Grid */
.grid-wrapper {
    flex: 1;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

.cel {
    border: 2px dashed #ccc;
    border-radius: 6px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #fafafa;
}

.cel.bezet {
    border: 2px solid #2d4a22;
    background-color: #e8f5e9;
}

/* Function linking — gekoppelde cellen */
.cel.linked {
    border-color: #1565c0;
    background-color: #e3f2fd;
    box-shadow: inset 0 0 0 4px rgba(21, 101, 192, 0.15);
}

.cel.dragging {
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.drag-ghost {
    box-shadow: 0 14px 40px rgba(0,0,0,0.2);
    border-radius: 6px;
    opacity: 0.45;
    filter: saturate(0.8);
}

.grid,
.grid * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cel-coords {
    position: absolute;
    right: 6px;
    bottom: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.35);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.cel.group-selected {
    outline: 3px solid #ffb300;
    outline-offset: -3px;
    box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.35);
}

.cel-link-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #2d4a22;
    color: #fff;
    font-size: 0.85rem;
}

.grid-help {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #3f4d3c;
}

/* Grid grootte formulier */
.grid-size-form {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin: 0.5rem 0 0.85rem;
    flex-wrap: wrap;
}

.grid-size-form label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #3f4d3c;
}

.grid-size-form input[type="number"] {
    padding: 0.35rem 0.5rem;
    width: 72px;
    border: 1px solid #c8d8c4;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.grid-size-form input[type="number"]:focus {
    outline: none;
    border-color: #2d4a22;
    box-shadow: 0 0 0 3px rgba(45, 74, 34, 0.14);
}

/* Effectenmatrix als horizontaal dropdown-menu bovenaan */
.effecten-menu {
    background: #2d4a22;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid #1e3a1a;
}

.effecten-menu-lijst {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 1200px;
}

.effecten-menu-item {
    position: relative;
}

.effecten-details {
    position: relative;
}

.effecten-summary {
    list-style: none;
    cursor: pointer;
    color: #fff;
    padding: 0.45rem 0.75rem;
    border-radius: 4px;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.12s ease;
}

.effecten-summary::-webkit-details-marker { display: none; }
.effecten-summary::marker { display: none; content: ''; }

.effecten-summary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.effecten-details[open] > .effecten-summary {
    background: #fff;
    color: #2d4a22;
}

.effecten-chevron {
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.effecten-details[open] .effecten-chevron {
    transform: rotate(180deg);
}

.effecten-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #d0d8cc;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    min-width: 170px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.effecten-rij {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 3px 0;
    font-size: 0.82rem;
}

.effecten-cat {
    text-transform: capitalize;
    color: #444;
}

.effecten-waarde {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    min-width: 1.8em;
    text-align: right;
}

.effecten-waarde.is-positief { color: #155215; }
.effecten-waarde.is-negatief { color: #922b21; }
.effecten-waarde.is-neutraal { color: #888; }

@media (max-width: 768px) {
    .effecten-summary {
        font-size: 0.78rem;
        padding: 0.35rem 0.55rem;
    }
    .effecten-dropdown {
        min-width: 150px;
        font-size: 0.8rem;
    }
}

/* SIM.10 — tooltip met effect-waarden bij hover op geplaatste cel */
.cel-tooltip {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #d0d8cc;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 10;
    min-width: 150px;
    pointer-events: none;
    text-align: left;
}

.tooltip-rij {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 2px 0;
}

.tooltip-cat {
    text-transform: capitalize;
    color: #444;
}

.tooltip-waarde {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    min-width: 1.8em;
    text-align: right;
}

.tooltip-waarde.is-positief { color: #155215; }
.tooltip-waarde.is-negatief { color: #922b21; }
.tooltip-waarde.is-neutraal { color: #888; }

.cel:hover {
    border-color: #2d4a22;
    background-color: #f1f8e9;
}

.cel.drag-over {
    background-color: #c8e6c9;
    border-color: #388e3c;
    border-style: solid;
}

.cel.drag-over::after {
    content: '↓ Loslaten';
    display: block;
    font-size: 0.7rem;
    color: #1b5e20;
    font-weight: bold;
    margin-top: 4px;
}

.cel-icon {
    font-size: 2rem;
}

.cel-naam {
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: bold;
    text-align: center;
}

.leeg-tekst {
    font-size: 0.75rem;
    color: #707070;
}

.verwijder-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
    cursor: pointer;
    display: none;
}

.cel:hover .verwijder-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive – 320px en hoger */
@media (max-width: 768px) {

    /* Library en grid onder elkaar */
    .container {
        flex-direction: column;
    }

    .library {
        width: 100%;
    }

    /* Grid smaller: 4 kolommen blijven maar kleinere cellen */
    .cel {
        min-height: 80px;
    }

    .cel-icon {
        font-size: 1.4rem;
    }

    .cel-naam {
        font-size: 0.65rem;
    }

    .leeg-tekst {
        font-size: 0.65rem;
    }

    /* Verwijder knop altijd zichtbaar op touch */
    .verwijder-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 1rem;
        top: 0;
        right: 0;
        border-radius: 0 6px 0 6px;
    }

    /* Zoekbalk touch-vriendelijk */
    #zoekterm {
        min-height: 44px;
        font-size: 1rem;
    }

    /* Library items touch-vriendelijk */
    .library-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 10px;
        font-size: 1rem;
    }

    main {
        padding: 0 10px;
        margin: 10px auto;
    }
}

/* Extra small – 320px */
@media (max-width: 400px) {
    .grid {
        gap: 5px;
    }

    .cel {
        min-height: 70px;
    }

    header h1 {
        font-size: 1.1rem;
    }
}

/* Effects matrix */
:root {
    --metro-groen: #2d5a27;
    --metro-groen-licht: #4a7c42;
    --kleur-positief: #1a7a1a;
    --kleur-positief-bg: #d4edda;
    --kleur-positief-donker: #155215;
    --kleur-negatief: #c0392b;
    --kleur-negatief-bg: #fde8e6;
    --kleur-negatief-donker: #922b21;
    --kleur-neutraal: #666;
    --kleur-neutraal-bg: #f0f0f0;
    --font-hoofd: 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    --radius: 6px;
    --cel-min: 72px;
}

.effecten-sectie {
    background: #fff;
    border: 1px solid #d0d8cc;
    border-radius: 10px;
    padding: 1.5rem 1.75rem 2rem;
    margin: 1.5rem 0;
    font-family: var(--font-hoofd);
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.08);
}

.effecten-header {
    margin-bottom: 1rem;
}

.effecten-titel {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--metro-groen);
    margin: 0 0 0.25rem;
    letter-spacing: 0;
    border-bottom: 2px solid var(--metro-groen);
    padding-bottom: 0.4rem;
}

.effecten-subtitel {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
}

.effecten-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    color: #444;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legenda-kleur {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legenda-kleur.effect-positief {
    background: var(--kleur-positief-bg);
    border-color: var(--kleur-positief);
}

.legenda-kleur.effect-negatief {
    background: var(--kleur-negatief-bg);
    border-color: var(--kleur-negatief);
}

.legenda-kleur.effect-neutraal {
    background: var(--kleur-neutraal-bg);
    border-color: #bbb;
}

.effecten-tabel-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-radius: var(--radius);
    outline: none;
}

.effecten-tabel-wrapper:focus-visible {
    outline: 2px solid var(--metro-groen);
    outline-offset: 2px;
}

.effecten-tabel {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    table-layout: fixed;
}

.effecten-tabel thead tr {
    background: var(--metro-groen);
}

.effecten-tabel thead th {
    padding: 0.65rem 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.82rem;
    color: #fff;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 3px solid var(--metro-groen-licht);
}

.th-functie {
    text-align: left !important;
    width: 160px;
    border-radius: var(--radius) 0 0 0;
}

.th-veiligheid {
    background: #27643e !important;
}

.th-recreatie {
    background: #2a5d36 !important;
}

.th-milieukwaliteit {
    background: #2d5a27 !important;
}

.th-voorzieningen {
    background: #305730 !important;
}

.th-mobiliteit {
    background: #335435 !important;
}

@keyframes rij-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.effecten-rij {
    animation: rij-in 0.3s ease both;
}

.effecten-rij:nth-child(even) {
    background: #f8faf7;
}

.effecten-rij:hover {
    background: #edf5eb;
    transition: background 0.15s ease;
}

.td-functienaam {
    padding: 0.55rem 0.75rem;
    font-weight: 600;
    color: #1e3a1a;
    text-align: left;
    white-space: nowrap;
    border-right: 2px solid #d0d8cc;
    font-size: 0.88rem;
}

.td-score {
    padding: 0.45rem 0.5rem;
    text-align: center;
    min-width: var(--cel-min);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: filter 0.15s ease, transform 0.15s ease;
    cursor: default;
    position: relative;
}

.td-score:hover {
    filter: brightness(0.92);
    transform: scale(1.04);
    z-index: 1;
    border-radius: 4px;
}

.effecten-tabel tbody tr:not(:last-child) td,
.effecten-tabel tbody tr:not(:last-child) th {
    border-bottom: 1px solid #e2e8e0;
}

.effect-positief {
    background-color: var(--kleur-positief-bg);
    color: var(--kleur-positief-donker);
    border-color: rgba(26, 122, 26, 0.18) !important;
}

.effect-negatief {
    background-color: var(--kleur-negatief-bg);
    color: var(--kleur-negatief-donker);
    border-color: rgba(192, 57, 43, 0.18) !important;
}

.effect-neutraal {
    background-color: var(--kleur-neutraal-bg);
    color: var(--kleur-neutraal);
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.score-waarde {
    display: block;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.effecten-tabel td:focus-visible,
.effecten-tabel th:focus-visible {
    outline: 3px solid var(--metro-groen);
    outline-offset: -2px;
    z-index: 2;
    position: relative;
}

@media (min-width: 1024px) {
    .effecten-tabel {
        font-size: 0.9rem;
    }

    .th-functie {
        width: 180px;
    }

    .td-score {
        min-width: 90px;
        font-size: 0.95rem;
    }
}

@media (forced-colors: active) {
    .effect-positief,
    .effect-negatief,
    .effect-neutraal {
        background: ButtonFace;
        color: ButtonText;
        border: 1px solid ButtonText;
        forced-color-adjust: none; /*safari hebt geen support*/
    }
}

/* Effectenmatrix panel */
:root {
    --metro-groen-hover: #3a7032;
    --panel-breedte: 700px;
}

.library {
    position: relative;
}

#effecten-trigger-wrapper {
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

.effecten-trigger-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: var(--metro-groen);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Eski Edge/IE */
    user-select: none;         /* Modern browsers */
}

.effecten-trigger-btn:hover,
.effecten-trigger-btn:focus-visible {
    background: var(--metro-groen-hover);
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.25);
}

.effecten-trigger-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.trigger-icon {
    font-size: 1rem;
}

.trigger-label {
    flex: 1;
    text-align: left;
}

.trigger-chevron {
    display: inline-block;
    font-size: 0.9rem;
    transition: transform 0.25s ease;
}

.effecten-trigger-btn[aria-expanded="true"] .trigger-chevron {
    transform: rotate(180deg);
}

.effecten-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    width: var(--panel-breedte);
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    overflow: hidden;
    background: #fff;
    border: 1px solid #c8d8c4;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(45, 90, 39, 0.18);
}

.effecten-panel-inner {
    padding: 1.1rem 1.25rem 1.25rem;
    overflow-y: auto;
    max-height: calc(80vh - 2px);
}

.effecten-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.effecten-panel .effecten-titel {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--metro-groen);
    margin: 0;
    border-bottom: 2px solid var(--metro-groen);
    padding-bottom: 0.3rem;
    flex: 1;
    letter-spacing: 0;
}

.effecten-sluit-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #595959;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.1s ease, background 0.1s ease;
    margin-left: 0.75rem;
}

.effecten-sluit-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.effecten-sluit-btn:focus-visible {
    outline: 2px solid var(--metro-groen);
    outline-offset: 1px;
}

.effecten-panel .effecten-subtitel {
    font-size: 0.78rem;
    color: #666;
    margin: 0 0 0.7rem;
}

.effecten-panel .effecten-legenda {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.76rem;
    color: #444;
    flex-wrap: wrap;
}

.effecten-panel .legenda-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.effecten-panel .legenda-kleur {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.effecten-panel .effecten-tabel-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-radius: 4px;
    outline: none;
}

.effecten-panel .effecten-tabel {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    table-layout: fixed;
}

.effecten-panel .effecten-tabel thead th {
    padding: 0.55rem 0.6rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-bottom: 2px solid var(--metro-groen-licht);
}

.effecten-panel .th-functie {
    text-align: left !important;
    width: 140px;
    border-radius: 8px 0 0 0;
}

.effecten-panel .td-functienaam {
    padding: 0.45rem 0.6rem;
    font-weight: 600;
    color: #1e3a1a;
    text-align: left;
    white-space: nowrap;
    border-right: 2px solid #d0d8cc;
    font-size: 0.82rem;
}

.effecten-panel .td-score {
    padding: 0.35rem 0.4rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: default;
    position: relative;
    transition: filter 0.12s ease, transform 0.12s ease;
}

.effecten-panel .td-score:hover {
    filter: brightness(0.9);
    transform: scale(1.06);
    z-index: 1;
    border-radius: 3px;
}

.effecten-panel .td-score:focus-visible {
    outline: 2px solid var(--metro-groen);
    outline-offset: -2px;
}

@media (max-width: 768px) {
    .effecten-panel {
        position: static;
        width: 100%;
        max-width: 100%;
        max-height: none;
    }
}

/* Totalen paneel — live scores per categorie */
.totalen-paneel {
    max-width: 1200px;
    margin: 1rem auto 0.5rem;
    padding: 0.85rem 1.25rem 1rem;
    background: #fff;
    border: 1px solid #d0d8cc;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(45, 90, 39, 0.06);
}

.totalen-titel {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.totalen-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
}

.totaal-kaart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    min-height: 64px;
}

.totaal-label {
    font-size: 0.72rem;
    color: #444;
    text-transform: capitalize;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
}

.totaal-score {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}

.totaal-positief {
    background: #d4edda;
    border-color: #1a7a1a;
}
.totaal-positief .totaal-score { color: #155215; }

.totaal-negatief {
    background: #fde8e6;
    border-color: #c0392b;
}
.totaal-negatief .totaal-score { color: #922b21; }

.totaal-neutraal {
    background: #f0f0f0;
    border-color: #bbb;
}
.totaal-neutraal .totaal-score { color: #666; }

@media (max-width: 768px) {
    .totalen-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .totalen-paneel {
        margin: 0.5rem 10px;
        padding: 0.7rem 0.85rem;
    }
}

/* ============== Effects Manager ============== */

/* KRITIEK: hidden attribute moet altijd verbergen — anders blokkeren onzichtbare
   modals met display:flex/opacity:0 alle clicks op de pagina */
[hidden] {
    display: none !important;
}

#effects-manager-wrapper {
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

/* Link-style trigger op de hoofdpagina */
.effects-manager-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: #6b4c9a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    outline: none;
    user-select: none;
}

.effects-manager-btn:hover,
.effects-manager-btn:focus-visible {
    background: #5a3a8a;
}

.effects-manager-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.effects-manager-btn .trigger-label {
    flex: 1;
}

.effects-manager-btn .trigger-arrow {
    font-size: 1rem;
}

/* === Manager pagina layout === */
.manager-pagina {
    max-width: 1200px;
    margin: 1rem auto 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #d0d8cc;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(45, 90, 39, 0.06);
}

.manager-pagina-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8e0;
    flex-wrap: wrap;
}

.manager-terug-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2d4a22;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.45rem 0.75rem;
    border: 1.5px solid #c8d8c4;
    border-radius: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.manager-terug-link:hover,
.manager-terug-link:focus-visible {
    background: #f0f4ee;
    border-color: #2d4a22;
    outline: none;
}

.manager-terug-link:active {
    transform: scale(0.97);
}

.manager-pagina-titel {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2d4a22;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manager-pagina-tekst {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.effects-manager-hint {
    display: inline-block;
    margin-left: 0.4rem;
    color: #2d4a22;
    font-style: italic;
    font-size: 0.82rem;
}

.effects-manager-toolbar {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
}

.effects-manager-zoek {
    flex: 1;
    min-width: 160px;
}

#effects-manager-zoek-input {
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1px solid #c8d8c4;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#effects-manager-zoek-input:focus {
    outline: none;
    border-color: #2d4a22;
    box-shadow: 0 0 0 3px rgba(45, 74, 34, 0.12);
}

/* knoppen */
.btn {
    padding: 0.5rem 0.95rem;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
    outline: none;
    line-height: 1.2;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-add {
    background: #2d4a22;
    color: #fff;
}

.btn-add:hover:not(:disabled),
.btn-add:focus-visible {
    background: #1e3a1a;
}

.btn-cancel {
    background: #ececec;
    color: #333;
}

.btn-cancel:hover:not(:disabled) {
    background: #ddd;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #a02315;
}

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    background: #2d4a22;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.12s ease;
}

.btn-small:hover {
    background: #1e3a1a;
}

.btn-reset {
    background: #d9a635;
    color: #fff;
}

.btn-reset:hover:not(:disabled),
.btn-reset:focus-visible {
    background: #b88a20;
}

.btn:focus-visible {
    outline: 3px solid rgba(45, 74, 34, 0.35);
    outline-offset: 2px;
}

/* tabel */
.effects-manager-tabel-wrapper {
    overflow: auto;
    max-height: 65vh;
    border-radius: 8px;
    border: 1px solid #e2e8e0;
    outline: none;
    min-height: 120px;
    background: #fff;
}

.effects-manager-tabel-wrapper:focus-visible {
    outline: 2px solid #2d4a22;
    outline-offset: 1px;
}

.effects-manager-tabel {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.effects-manager-tabel thead {
    background: #2d4a22;
    position: sticky;
    top: 0;
    z-index: 10;
}

.effects-manager-tabel th {
    padding: 0.65rem 0.6rem;
    color: #fff;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid #1e3a1a;
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.effects-manager-tabel .th-functie {
    text-align: left !important;
    width: 150px;
    position: sticky;
    left: 0;
    background: #2d4a22;
    z-index: 11;
}

.effects-manager-tabel .th-categorie {
    width: 95px;
    font-size: 0.72rem;
}

.effects-manager-tabel .th-actions {
    width: 90px;
}

.effects-row:nth-child(even) {
    background: #fafbf9;
}

.effects-row:hover {
    background: #eef5eb;
}

.effects-row:hover .td-functienaam {
    background: inherit;
}


.effects-manager-tabel td {
    border-bottom: 1px solid #e8eee5;
}

.td-functienaam {
    padding: 0.55rem 0.75rem;
    font-weight: 600;
    color: #1e3a1a;
    text-align: left;
    border-right: 2px solid #d0d8cc;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    transition: background 0.15s ease;
}

.effects-row:nth-child(even) .td-functienaam {
    background: #fafbf9;
}

.td-points {
    padding: 0.35rem 0.4rem;
    text-align: center;
}

.effect-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.effect-input {
    width: 68px;
    padding: 0.4rem 0.5rem;
    border: 1.5px solid #c8d8c4;
    border-radius: 5px;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: #fff;
    color: #1e3a1a;
}

/* Spinner-pijltjes tonen zodat je ook kunt klikken ipv typen */
.effect-input::-webkit-outer-spin-button,
.effect-input::-webkit-inner-spin-button {
    -webkit-appearance: auto;
    opacity: 1;
}
.effect-input {
    -moz-appearance: auto;
    appearance: auto;
}

.effect-input:focus {
    outline: none;
    border-color: #2d4a22;
    box-shadow: 0 0 0 3px rgba(45, 74, 34, 0.14);
    background: #fafbf9;
}

.effect-input:hover:not(:focus) {
    border-color: #88a87f;
}

.td-actions {
    padding: 0.5rem 0.6rem;
    text-align: center;
}

.btn-delete-function {
    background: none;
    color: #c0392b;
    border: 1px solid #f0bcb5;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    transition: background 0.12s ease, color 0.12s ease;
    line-height: 1.2;
}

.btn-delete-function:hover {
    background: #fde8e6;
}

.btn-delete-function:focus-visible {
    outline: 2px solid #c0392b;
    outline-offset: 1px;
}

.effects-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .manager-pagina {
        margin: 0.5rem 10px 1.5rem;
        padding: 1rem;
        border-radius: 8px;
    }

    .manager-pagina-titel {
        font-size: 1.1rem;
    }

    .effects-manager-toolbar {
        gap: 0.5rem;
    }

    .effects-manager-tabel .th-categorie {
        width: 78px;
        font-size: 0.65rem;
        padding: 0.5rem 0.25rem;
    }

    .effect-input {
        width: 56px;
        font-size: 0.82rem;
        padding: 0.35rem 0.3rem;
    }
}


/* Geuploade icoon-afbeeldingen in library en grid */
.functie-icon-img {
    width: 1.4em;
    height: 1.4em;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
    display: inline-block;
}

.cel-icon.functie-icon-img {
    width: 2.2em;
    height: 2.2em;
}

/* Modal "Functie toevoegen" */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay[hidden] { display: none; }

.modal-venster {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-titel {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.modal-sluit-btn {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0 0.25rem;
}

.modal-sluit-btn:hover { color: #1f2937; }

.modal-form {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-fout {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid #fca5a5;
}

.form-rij {
    display: flex;
    gap: 0.75rem;
}

.form-rij-2 > .form-veld { flex: 1; }

.form-veld {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-veld label,
.form-veld legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.form-veld .verplicht { color: #dc2626; }

.form-help {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0 0 0.4rem;
}

.form-veld input[type="text"],
.form-veld input[type="number"],
.form-veld select,
.form-veld textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}

.form-veld input:focus,
.form-veld select:focus,
.form-veld textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-veld textarea { resize: vertical; }

.form-icon {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.85rem;
    background: #f9fafb;
}

.form-icon legend {
    padding: 0 0.4rem;
    background: #fff;
    border-radius: 4px;
}

.icon-preview-rij {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.4rem 0 0.6rem;
}

.icon-preview {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.icon-preview-label {
    font-size: 0.82rem;
    color: #6b7280;
}

.icon-preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.icon-keuze-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1;
}

.icon-keuze-btn:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
}

.icon-keuze-btn.is-actief {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.form-upload {
    margin-top: 0.4rem;
}

.form-upload-label {
    display: block;
    font-size: 0.82rem;
    color: #4b5563;
    margin-bottom: 0.3rem;
}

.form-upload input[type="file"] {
    font-size: 0.85rem;
}

.form-effects {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.85rem;
    background: #f9fafb;
}

.form-effects legend {
    padding: 0 0.4rem;
    background: #fff;
    border-radius: 4px;
}

.form-effects-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.form-effect-veld {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-effect-veld label {
    font-size: 0.78rem;
    color: #4b5563;
    text-transform: capitalize;
    font-weight: 500;
}

.form-effect-veld input {
    width: 100%;
    padding: 0.4rem 0.45rem;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.modal-acties {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e5e7eb;
}

.btn-annuleer {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-annuleer:hover {
    background: #e5e7eb;
}

@media (max-width: 600px) {
    .modal-venster {
        max-width: 100%;
        border-radius: 8px;
    }
    .form-rij {
        flex-direction: column;
    }
    .form-effects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .icon-keuze-btn {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }
}


/* ============================================
   SCREENREADER KNOP
   ============================================ */
.sr-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    color: #d8e8d2;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sr-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sr-toggle-btn.is-actief {
    background: #fff;
    color: #2d4a22;
    border-color: #fff;
}

.sr-toggle-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ============================================
   AUTH — gebruiker-info in de header
   ============================================ */
.user-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .88rem;
}

.user-naam {
    color: #d8e8d2;
}

.user-badge {
    border-radius: 999px;
    padding: .18rem .65rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.user-badge.admin    { background: #e0e7ff; color: #3730a3; }
.user-badge.gebruiker { background: #fef3c7; color: #92400e; }
.user-badge.viewer   { background: #dcfce7; color: #166534; }

.btn-logout {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: 6px;
    padding: .28rem .75rem;
    font-size: .82rem;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.nav-role-badge {
    font-size: .7rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    padding: .1rem .35rem;
    margin-left: .3rem;
    font-weight: 700;
}

.header-rechts {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-form {
    margin: 0;
}

/* ============================================
   AUTH — login pagina
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-logo {
    text-align: center;
    padding: 2rem 2rem 0;
}

.auth-logo h1 {
    font-size: 1.8rem;
    color: #1e293b;
    margin: 0 0 .25rem;
}

.auth-logo p {
    color: #64748b;
    margin: 0 0 1.5rem;
    font-size: .9rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    padding: .75rem;
    text-align: center;
    font-size: .95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    text-decoration: none;
}

.auth-tab.actief {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.auth-tab:hover:not(.actief) {
    color: #374151;
    background: #f9fafb;
}

.auth-form {
    padding: 1.75rem 2rem 2rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
    color: #374151;
    font-size: .9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: 1rem;
    transition: border-color .15s;
    box-sizing: border-box;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-error {
    color: #dc2626;
    font-size: .82rem;
    margin-top: .3rem;
}

.btn-primary {
    width: 100%;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: .75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: .5rem;
    transition: background .15s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: #374151;
}

.melding-fout-auth {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 7px;
    padding: .65rem .9rem;
    margin: 0 2rem 1rem;
    font-size: .88rem;
}

.rol-uitleg {
    font-size: .8rem;
    color: #6b7280;
    margin-top: .3rem;
}

/* ============================================
   AUTH — register pagina
   ============================================ */
.register-pagina {
    max-width: 480px;
    margin: 2rem auto;
}

.register-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    padding: 2rem;
}

.auth-fout {
    color: #dc2626;
    font-size: .82rem;
    margin-top: .3rem;
}

.auth-knoppen {
    display: flex;
    gap: .75rem;
}

.btn-blauw {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: .65rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-blauw:hover {
    background: #1d4ed8;
}

.btn-grijs {
    background: #e5e7eb;
    color: #374151;
    border-radius: 7px;
    padding: .65rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border: none;
    cursor: pointer;
}

.btn-grijs:hover {
    background: #d1d5db;
}

/* ============================================
   ADMIN — gebruikersbeheer pagina
   ============================================ */
.gebruikers-pagina {
    max-width: 700px;
    margin: 2rem auto;
}

.gebruikers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.gebruikers-header h2 {
    margin: 0;
}

.gebruikers-tabel-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.gebruikers-tabel {
    width: 100%;
    border-collapse: collapse;
}

.gebruikers-tabel thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.gebruikers-tabel th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .85rem;
    color: #6b7280;
    font-weight: 600;
}

.gebruikers-tabel td {
    padding: .75rem 1rem;
}

.gebruikers-tabel tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.gebruikers-tabel tbody tr.is-actief-gebruiker {
    background: #eff6ff;
}

.gebruiker-naam {
    font-weight: 600;
}

.gebruiker-jij {
    font-size: .75rem;
    color: #3b82f6;
    margin-left: .3rem;
}

.gebruiker-email {
    color: #374151;
}

.rol-badge {
    border-radius: 999px;
    padding: .2rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    display: inline-block;
}

.rol-badge.admin     { background: #dbeafe; color: #1d4ed8; }
.rol-badge.gebruiker { background: #fef3c7; color: #92400e; }
.rol-badge.viewer    { background: #f0fdf4; color: #166534; }

.btn-verwijder {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-verwijder:hover {
    background: #fecaca;
}

.gebruikers-geen {
    padding: 1.5rem;
    text-align: center;
    color: #9ca3af;
}

.gebruikers-legenda {
    margin-top: 1rem;
    font-size: .85rem;
    color: #6b7280;
}

.gebruikers-geen-actie {
    color: #9ca3af;
    font-size: .82rem;
}

/* ===== SIM.12 — Route maker ===== */
.route-maker {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    padding: .75rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}
.route-knop, .route-wis-knop {
    padding: .45rem .9rem;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}
.route-knop      { background: #2563eb; color: #fff; }
.route-knop:hover { background: #1d4ed8; }
.route-wis-knop  { background: #e5e7eb; color: #111827; }
.route-wis-knop:hover { background: #d1d5db; }
.route-info {
    width: 100%;
    margin: 0;
    font-size: .85rem;
    color: #374151;
}

.route-svg-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.cel.route-start { outline: 3px solid #16a34a; outline-offset: -3px; }
.cel.route-eind  { outline: 3px solid #dc2626; outline-offset: -3px; }



/* ============================================
   DAG/NACHT MODIFIERS TABEL (admin)
   ============================================ */

.daynight-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.toggle-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.daynight-toggle {
    display: flex;
    gap: 0.3rem;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    background: transparent;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.6);
}

.toggle-icon {
    font-size: 1.15rem;
}

.toggle-sub {
    font-size: 0.72rem;
    opacity: 0.7;
    font-weight: 400;
}

/* Active state */
.toggle-btn.is-actief {
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.toggle-btn-dag.is-actief {
    background: orange;
}

.toggle-btn-nacht.is-actief {
    background: rgb(20, 9, 165);
}

/* ============================================
   TABLE STYLING
   ============================================ */

.daynight-header {
    margin-top: 2.5rem;
}

.daynight-tabel .th-phase-categorie {
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header colors match active phase */
body.showing-dag .daynight-tabel .th-phase-categorie {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

body.showing-nacht .daynight-tabel .th-phase-categorie {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #818cf8;
}

/* Input cells */
.td-modifier-cell {
    padding: 0.35rem 0.4rem;
    vertical-align: middle;
}

.modifier-input-wrap {
    position: relative;
}

.modifier-input-wrap.hidden {
    display: none;
}

/* Day inputs */
.input-dag {
    width: 60px;
    text-align: center;
    border: 2px solid #fcd34d;
    background: #fffbeb;
    border-radius: 6px;
    padding: 0.35rem 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #92400e;
    transition: all 0.2s ease;
}

.input-dag:hover {
    border-color: #f59e0b;
    background: #fff;
}

.input-dag:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    background: #fff;
}

/* Night inputs */
.input-nacht {
    width: 60px;
    text-align: center;
    border: 2px solid #a5b4fc;
    background: #eef2ff;
    border-radius: 6px;
    padding: 0.35rem 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #3730a3;
    transition: all 0.2s ease;
}

.input-nacht:hover {
    border-color: #818cf8;
    background: #fff;
}

.input-nacht:focus {
    outline: none;
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.2);
    background: #fff;
}

/* Row styling */
.daynight-row:nth-child(even) {
    background: #fafaf9;
}

.daynight-row:hover {
    background: #f1f5f9;
}

.daynight-row .td-functienaam {
    font-weight: 600;
    white-space: nowrap;
}

/* Save states */
.effect-input-wrap[data-status="saving"] .effect-input {
    animation: pulse-save 0.8s infinite;
}

@keyframes pulse-save {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.effect-input-wrap[data-status="saved"] .effect-input {
    border-color: #16a34a !important;
    background: #dcfce7 !important;
}

/* Empty state */
.effects-empty {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}


/* ============================================
   SIM.6.1 — Simulatiebediening
   ============================================ */

.sim-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f0f4ee;
    border: 1px solid #c8d8c4;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
}
.sim-clock {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d4a22;
    background: #fff;
    border: 1px solid #c8d8c4;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    min-width: 70px;
    text-align: center;
    letter-spacing: 1px;
}

body.is-night-mode .sim-clock {
    background: #1a2030;
    color: #9ab0d0;
    border-color: #3a4a6b;
}

.sim-phase {
    font-weight: 700;
    font-size: 0.95rem;
}


.hidden { display: none !important; }

body.is-night-mode .clock-dag { display: none; }
body.is-night-mode .clock-nacht { display: inline; }

.sim-phase {
    font-weight: 700;
    font-size: 1rem;
    min-width: 80px;
}

.sim-clock {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d4a22;
    background: #fff;
    border: 1px solid #c8d8c4;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    min-width: 70px;
    text-align: center;
}

.sim-speed-groep {
    display: flex;
    gap: 0.3rem;
}

.btn-speed {
    padding: 0.3rem 0.65rem;
    background: #fff;
    border: 1.5px solid #c8d8c4;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #2d4a22;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-speed:hover {
    background: #eef5eb;
    border-color: #2d4a22;
}

.btn-speed.is-actief {
    background: #2d4a22;
    color: #fff;
    border-color: #2d4a22;
}

.btn-speed:focus-visible {
    outline: 2px solid #2d4a22;
    outline-offset: 2px;
}

.sim-speed-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2d4a22;
    background: #eef5eb;
    border: 1px solid #c8d8c4;
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}

.btn-sim-pause {
    padding: 0.35rem 0.8rem;
    background: #2d4a22;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
    margin-left: auto;
}

.btn-sim-pause:hover {
    background: #1e3a1a;
}

.btn-sim-pause[aria-pressed="true"] {
    background: #d97706;
}

.btn-sim-pause[aria-pressed="true"]:hover {
    background: #b45309;
}

.btn-sim-pause:focus-visible {
    outline: 2px solid #2d4a22;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .sim-controls {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .sim-phase {
        min-width: 64px;
        font-size: 0.9rem;
    }

    .btn-speed {
        font-size: 0.75rem;
        padding: 0.28rem 0.5rem;
    }

    .btn-sim-pause {
        margin-left: 0;
        width: 100%;
        order: 10;
    }
}


/* ============================================
   DAY/NIGHT GRID THEMAs
   ============================================ */

.grid-wrapper.is-day {
    background: #fffdf5;
    border-color: #f5d060;
    transition: background 1.5s ease, border-color 1.5s ease;
}

.grid-wrapper.is-night {
    background: #1a1f2e;
    border-color: #3a4a6b;
    transition: background 1.5s ease, border-color 1.5s ease;
}

.grid-wrapper.is-night h2,
.grid-wrapper.is-night .grid-help {
    color: #9ab0d0;
}

.is-night .cel {
    background-color: #1e2740;
    border-color: #3a4a6b;
    color: #c8d8f0;
}

.is-night .cel.bezet {
    background-color: #1e3050;
    border-color: #4a6a9b;
}

.is-night .cel.linked {
    background-color: #1a2a50;
    border-color: #3060a0;
}

.is-night .cel-naam {
    color: #c8d8f0;
}

.is-night .leeg-tekst {
    color: #4a5a7a;
}

.is-night .cel:hover {
    border-color: #6a8acb;
    background-color: #243a60;
}
