/* ══════════════════════════════════════════════════════════════
   Nordic Climate Group — Partner Connect Design System
   ══════════════════════════════════════════════════════════════ */

:root {
    --navy: #005D89;
    --navy-light: #1DA584;
    --navy-hover: #004a6e;
    --ice: #e8f5f0;
    --ice-dark: #c8ebe0;
    --bg: #f5f5f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --border-light: #eeeeee;
    --green: #1DA584;
    --green-bg: #e8f5f0;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --orange: #f59e0b;
    --orange-bg: #fffbeb;
    --radius: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 6px 16px rgba(0,0,0,0.1);
    --font: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
    background: var(--navy);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(11,37,69,0.2);
    position: relative;
    z-index: 10001;
}

.header-content {
    display: flex;
    align-items: stretch;
    min-height: 64px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    white-space: nowrap;
}

.header-logo {
    height: 38px;
    width: auto;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.header-brand h1 {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.header-sub {
    font-weight: 300;
    opacity: 0.65;
    margin-left: 0.15em;
}

nav {
    display: flex;
    align-items: stretch;
    margin-left: 2rem;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.nav-btn {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0 1.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    width: auto;
    margin: 0;
    border-radius: 0;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-btn:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.nav-btn.active {
    color: white;
    font-weight: 600;
    border-bottom-color: var(--navy-light);
    background: rgba(255,255,255,0.08);
}

/* ── User info & logout ── */
#user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding: 0 1.25rem;
    white-space: nowrap;
}

/* ── Beschikbaarheid toggle (header) ── */
#beschikbaarheid-toggle {
    display: flex;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid rgba(255,255,255,0.15);
}

.besch-btn {
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: none;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    width: auto;
    margin: 0;
    transition: all var(--transition);
}

.besch-btn:hover { color: white; }
.besch-btn.active[data-status="beschikbaar"] { background: var(--green); color: white; }
.besch-btn.active[data-status="beperkt"] { background: var(--orange); color: white; }
.besch-btn.active[data-status="vol"] { background: var(--red); color: white; }

#page-mijn-profiel {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

/* ── Mijn Profiel beslisboom ── */
.mp-progress {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}
.mp-progress-step {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    transition: background 0.3s;
}
.mp-progress-step.done { background: var(--navy); }
.mp-progress-step.current { background: var(--navy-light); }

.mp-stap { display: none; }
.mp-stap.active { display: block; }
.mp-stap h2 { color: var(--navy); font-size: 1.15rem; font-weight: 600; margin-bottom: 0.2rem; }

.mp-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 0.5rem;
}
.mp-nav button { width: auto; padding: 0.55rem 1.5rem; }
.mp-next, .mp-submit {
    background: var(--navy);
    color: white;
    margin-left: auto;
}
.mp-submit { background: var(--green); }
.mp-next:hover, .mp-submit:hover { opacity: 0.9; }
.mp-prev { margin-right: auto; margin-left: 0; }

/* Suggestie items (ja/nee) */
.mp-sug-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    transition: all 0.2s;
}
.mp-sug-item.ja { border-color: var(--green); background: var(--green-bg); }
.mp-sug-item.nee { border-color: var(--red); background: var(--red-bg); opacity: 0.6; }
.mp-sug-item .mp-sug-label { font-size: 0.9rem; font-weight: 500; }
.mp-sug-item .mp-sug-bron { font-size: 0.72rem; color: var(--text-muted); }
.mp-sug-btns { display: flex; gap: 0.3rem; }
.mp-sug-btn {
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--white);
    width: auto;
    margin: 0;
    transition: all var(--transition);
}
.mp-sug-btn.ja.selected { background: var(--green); color: white; border-color: var(--green); }
.mp-sug-btn.nee.selected { background: var(--red); color: white; border-color: var(--red); }

.mp-extra { margin-top: 1rem; }
.mp-extra summary {
    cursor: pointer;
    color: var(--navy-light);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Provincie knoppen */
.mp-prov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.4rem;
}
.mp-prov-btn {
    padding: 0.55rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    text-align: center;
    background: var(--white);
    transition: all 0.2s;
    width: auto;
    margin: 0;
    font-weight: 500;
}
.mp-prov-btn.selected {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

/* Onderaannemer toggle */
.mp-oa-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.mp-oa-btn {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--white);
    transition: all 0.2s;
    width: auto;
    margin: 0;
}
.mp-oa-btn.selected {
    border-color: var(--navy);
    background: var(--ice);
}

/* Samenvatting */
.mp-samenvatting-sectie { margin-bottom: 1rem; }
.mp-samenvatting-sectie h4 { font-size: 0.85rem; color: var(--navy); margin-bottom: 0.3rem; }
.mp-samenvatting-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.mp-samenvatting-tags span {
    background: var(--ice);
    color: var(--navy-light);
    padding: 0.2rem 0.55rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 500;
}

#user-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

#logout-btn {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    width: auto;
    margin: 0;
    transition: all var(--transition);
}

#logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Login pagina */
#page-login {
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 2rem;
}

/* ── Pagina's ── */
.page {
    display: none;
}

.page.active {
    display: flex;
}

#page-kaart {
    height: calc(100vh - 64px);
    position: relative;
}

#page-aanvraag,
#page-aanvragen,
#page-profiel {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

/* ── Regio toggle ── */
.regio-toggle {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.regio-btn {
    flex: 1;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    margin: 0;
    transition: all var(--transition);
}

.regio-btn:hover {
    color: var(--text);
}

.regio-btn.active {
    background: var(--white);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}

/* ── Sidebar (kaart) ── */
aside#filters {
    width: 340px;
    min-width: 340px;
    padding: 1.25rem;
    overflow-y: auto;
    background: var(--white);
    border-right: 1px solid var(--border);
}

aside h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.filter-group {
    margin-bottom: 0.85rem;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.filter-group select,
.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-group select:focus,
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(19,64,116,0.1);
}

/* ── Knoppen ── */
button {
    width: 100%;
    padding: 0.55rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.4rem;
    transition: all var(--transition);
}

#zoek-btn,
#aanvraag-submit,
#profiel-form button[type="submit"] {
    background: var(--navy);
    color: white;
}

#zoek-btn:hover,
#aanvraag-submit:hover,
#profiel-form button[type="submit"]:hover {
    background: var(--navy-hover);
    box-shadow: var(--shadow);
}

button.secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}

button.secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

/* ── Resultaten (kaart sidebar) ── */
#resultaten {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

#resultaten h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
}

#resultaat-count {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
}

#bedrijven-lijst {
    list-style: none;
}

#bedrijven-lijst li {
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
}

#bedrijven-lijst li:hover {
    border-color: var(--navy-light);
    background: var(--ice);
    box-shadow: var(--shadow-sm);
}

#bedrijven-lijst li .bedrijf-naam {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

#bedrijven-lijst li .bedrijf-locatie {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

#bedrijven-lijst li .bedrijf-beschrijving {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

#bedrijven-lijst li .bedrijf-werkgebied {
    font-size: 0.72rem;
    color: var(--navy-light);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ── Beschikbaarheid badge ── */
.beschikbaarheid-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.25rem;
}
.beschikbaarheid-badge.beschikbaar { background: var(--green-bg); color: #0d7a62; }
.beschikbaarheid-badge.beperkt { background: var(--orange-bg); color: #92400e; }
.beschikbaarheid-badge.vol { background: var(--red-bg); color: #991b1b; }

#map {
    flex: 1;
    z-index: 1;
}

/* ── Kaart Popups ── */
.popup-header {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}
.popup-edit-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.1rem 0.35rem;
    color: var(--text-muted);
    width: auto;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.2s;
}
.popup-edit-btn:hover {
    background: var(--ice);
    color: var(--navy);
    border-color: var(--navy-light);
}
.popup-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy);
    margin-bottom: 0.2rem;
    flex: 1;
}

.popup-locatie {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}

.popup-beschrijving {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.popup-tags span {
    background: var(--ice);
    color: var(--navy-light);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Diensten in popup */
.popup-diensten {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}
.popup-diensten-titel {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.popup-dienst-row {
    display: flex;
    flex-direction: column;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border-light);
}
.popup-dienst-row:last-child { border-bottom: none; }
.popup-dienst-naam {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
}
.popup-dienst-contact {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Kaart-editor ── */
.kaart-editor-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.2rem;
}
.kaart-editor-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.kaart-editor-groep {
    margin-bottom: 0.8rem;
}
.kaart-editor-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.kaart-editor-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    padding: 0.3rem 0;
    cursor: pointer;
    color: var(--text);
}
.kaart-editor-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--navy-light);
}
.kaart-editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}
.kaart-editor-cancel {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    border-radius: var(--radius);
    cursor: pointer;
    width: auto;
    margin: 0;
}
.kaart-editor-save {
    background: var(--navy);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    width: auto;
    margin: 0;
}
.kaart-editor-save:hover { opacity: 0.9; }

/* ── Formulieren ── */
.form-container {
    width: 100%;
    max-width: 780px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.form-container h2 {
    color: var(--navy);
    margin-bottom: 0.3rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.form-container h3 {
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.form-container h3:first-of-type {
    border-top: none;
}

.form-intro {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.form-group {
    flex: 1;
    margin-bottom: 0.35rem;
}

.form-group.full {
    flex: 1 1 100%;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-light);
}

/* ── Status indicators (dots) ── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }
.status-dot.orange { background: var(--orange); }

/* ── Status berichten ── */
.status-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-msg.success {
    background: var(--green-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-msg.error {
    background: var(--red-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.hidden {
    display: none !important;
}

/* ── Match cards ── */
.match-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-bottom: 0.6rem;
    transition: all var(--transition);
    background: var(--white);
}

.match-card:hover {
    border-color: var(--navy-light);
    box-shadow: var(--shadow);
}

.match-card .match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.match-card .match-naam {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy);
}

.match-card .match-afstand {
    background: var(--navy);
    color: white;
    padding: 0.2rem 0.65rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.match-card .match-locatie {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.match-card .match-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.match-card .match-tags span {
    background: var(--ice);
    color: var(--navy-light);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
}

/* ── Aanvragen overzicht ── */
.aanvraag-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    background: var(--white);
    transition: all var(--transition);
}

.aanvraag-card:hover {
    box-shadow: var(--shadow);
}

.aanvraag-card h4 {
    color: var(--navy);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.aanvraag-card .aanvraag-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.aanvraag-card .aanvraag-matches-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--green);
}

.no-results {
    color: var(--text-muted);
    font-style: italic;
    padding: 2.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ── Vragenlijst tabel ── */
#vragenlijst-overzicht table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#vragenlijst-overzicht table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

#vragenlijst-overzicht table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

#vragenlijst-overzicht table tr:hover td {
    background: var(--ice);
}

#vragenlijst-overzicht table .btn-copy {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    width: auto;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
    transition: all var(--transition);
}

#vragenlijst-overzicht table .btn-copy:hover {
    background: var(--navy-hover);
    box-shadow: var(--shadow-sm);
}

/* ── Checkbox grid ── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    color: var(--text);
}

.checkbox-grid label:hover {
    background: var(--ice);
    border-color: var(--ice-dark);
}

.checkbox-grid label.checked {
    background: var(--ice);
    border-color: var(--navy-light);
    color: var(--navy);
    font-weight: 500;
}

/* ── Modal ── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11,37,69,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden { display: none !important; }

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    color: var(--navy);
    margin-bottom: 0.3rem;
    border: none;
    padding: 0;
}

/* ── Doorverwijzing tabs ── */
.dv-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.dv-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    margin: 0 0 -2px 0;
    width: auto;
    border-radius: 0;
    transition: all var(--transition);
}

.dv-tab:hover { color: var(--text); }
.dv-tab.active {
    color: var(--navy);
    border-bottom-color: var(--navy);
}

/* ── Doorverwijzing cards ── */
.dv-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    margin-bottom: 0.6rem;
    background: var(--white);
    transition: all var(--transition);
}

.dv-card:hover { box-shadow: var(--shadow); }

.dv-card .dv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.dv-card .dv-title { font-weight: 700; color: var(--navy); font-size: 0.95rem; }

.dv-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
}
.dv-status.verzonden { background: var(--ice); color: var(--navy-light); }
.dv-status.geaccepteerd { background: var(--green-bg); color: #065f46; }
.dv-status.afgewezen { background: var(--red-bg); color: #991b1b; }

.dv-card .dv-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.dv-card .dv-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.dv-card .dv-actions button {
    width: auto;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    margin: 0;
}

.btn-accept { background: var(--green); color: white; border: none; }
.btn-accept:hover { opacity: 0.9; }
.btn-reject { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-reject:hover { background: var(--red-bg); }

/* ── Doorverwijzing tijdlijn ── */
.dv-tijdlijn {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0.6rem 0 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dv-tl-stap {
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    min-width: 70px;
    white-space: nowrap;
}

.dv-tl-stap.done {
    background: var(--ice);
    border-color: var(--navy-light);
    color: var(--navy);
    font-weight: 600;
}

.dv-tl-stap.done.green {
    background: var(--green-bg);
    border-color: var(--green);
    color: #065f46;
}

.dv-tl-stap.done.red {
    background: var(--red-bg);
    border-color: var(--red);
    color: #991b1b;
}

.dv-tl-stap small {
    font-weight: 400;
    font-size: 0.65rem;
}

.dv-tl-lijn {
    flex: 1;
    height: 2px;
    background: var(--border);
    min-width: 20px;
}

.dv-tl-lijn.done {
    background: var(--navy-light);
}

.btn-doorverwijzing {
    background: var(--navy) !important;
    color: white !important;
    border: none !important;
    padding: 0.35rem 0.8rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    width: auto !important;
    margin: 0.4rem 0 0 0 !important;
    transition: all var(--transition) !important;
}
.btn-doorverwijzing:hover { opacity: 0.9; }

#page-doorverwijzingen {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

/* ── Dashboard ── */
#page-dashboard {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dash-stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    text-align: center;
}

.dash-stat .dash-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
}

.dash-stat .dash-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.3rem;
}

.dash-stat.green .dash-number { color: var(--green); }
.dash-stat.orange .dash-number { color: var(--orange); }
.dash-stat.red .dash-number { color: var(--red); }

.dash-row {
    display: flex;
    gap: 1rem;
}

.dash-panel {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    background: var(--white);
}

.dash-panel h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.dash-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.dash-bar-label {
    font-size: 0.82rem;
    font-weight: 500;
    min-width: 140px;
    color: var(--text);
}

.dash-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.dash-bar-fill {
    height: 100%;
    background: var(--navy-light);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.dash-bar-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy);
    min-width: 20px;
    text-align: right;
}

/* ── Toast notificaties ── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    padding-right: 2.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
    position: relative;
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

.toast.success { background: var(--green); color: white; }
.toast.error { background: var(--red); color: white; }
.toast.info { background: var(--navy); color: white; }

.toast-close {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    width: auto;
    margin: 0;
    line-height: 1;
}
.toast-close:hover { color: white; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

/* ── Formulier validatie ── */
.required { color: var(--red); }

.field-error {
    font-size: 0.78rem;
    color: var(--red);
    margin-top: 0.25rem;
}

.field-info {
    font-size: 0.78rem;
    color: var(--navy-light);
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: var(--red);
}

/* ── Loading spinner ── */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 0.6rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--navy-light);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Cluster styling ── */
.marker-cluster-small {
    background-color: rgba(19,64,116,0.15) !important;
}
.marker-cluster-small div {
    background-color: var(--navy-light) !important;
    color: white !important;
    font-weight: 700;
    font-size: 0.8rem;
}
.marker-cluster-medium {
    background-color: rgba(19,64,116,0.2) !important;
}
.marker-cluster-medium div {
    background-color: var(--navy) !important;
    color: white !important;
    font-weight: 700;
}
.marker-cluster-large {
    background-color: rgba(11,37,69,0.25) !important;
}
.marker-cluster-large div {
    background-color: var(--navy) !important;
    color: white !important;
    font-weight: 700;
}

/* ── Aanvragen filters ── */
.aanvragen-filters {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.aanvragen-filters input {
    flex: 2;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
}

.aanvragen-filters select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* ── Kaart zoekbalk ── */
.kaart-zoekbalk {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10000;
    display: flex;
    gap: 0.3rem;
    background: var(--white);
    padding: 0.3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.kaart-zoekbalk input {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    width: 220px;
    font-family: inherit;
}

.kaart-zoekbalk button {
    background: var(--navy);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    margin: 0;
}

/* ── Notificatie badge ── */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    margin-left: 0.4rem;
    padding: 0 4px;
}

/* ── Projecten ── */
#page-projecten {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-bottom: 0.6rem;
    background: var(--white);
    transition: all var(--transition);
}

.project-card:hover { box-shadow: var(--shadow); }

.project-card .project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.project-card .project-titel {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.95rem;
}

.project-card .project-bedrijf {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy-light);
}

.project-card .project-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.project-card .project-beschrijving {
    font-size: 0.85rem;
    color: var(--text-light);
}

.project-sector-tag {
    background: var(--ice);
    color: var(--navy-light);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
}

/* ── Diensten overzicht ── */
#page-diensten-overzicht {
    justify-content: center;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

.dienst-groep {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dienst-groep-header {
    background: var(--bg);
    padding: 0.75rem 1.15rem;
    font-weight: 700;
    color: var(--navy);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dienst-groep-header span {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dienst-bedrijf-row {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
    font-size: 0.85rem;
}

.dienst-bedrijf-row:last-child { border-bottom: none; }

.dienst-bedrijf-naam {
    font-weight: 600;
    min-width: 200px;
    color: var(--text);
}

.dienst-bedrijf-locatie {
    color: var(--text-muted);
    min-width: 140px;
}

.dienst-bedrijf-contact {
    color: var(--navy-light);
    font-weight: 500;
}

/* Diensten stap in profiel */
.mp-dienst-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.mp-dienst-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--transition);
}

.mp-dienst-header:hover { background: var(--ice); }

.mp-dienst-item.active {
    border-color: var(--navy-light);
    background: var(--ice);
}

.mp-dienst-contact {
    display: none;
    padding: 0.6rem 0.8rem;
    padding-top: 0;
    gap: 0.5rem;
}

.mp-dienst-item.active .mp-dienst-contact {
    display: flex;
    flex-wrap: wrap;
}

.mp-dienst-contact input {
    flex: 1;
    min-width: 150px;
}

/* ── Hamburger menu ── */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 0.75rem;
    width: auto;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all 0.2s;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

/* ── Filter toggle (mobiel) ── */
.filter-toggle {
    display: none;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    background: var(--navy);
    color: white;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    width: auto;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    /* Header */
    .header-content {
        flex-wrap: wrap;
        min-height: 48px;
    }

    .header-brand {
        padding: 0 1rem;
        flex: 1;
    }

    .header-brand h1 { font-size: 0.9rem; }

    /* Hamburger zichtbaar */
    .hamburger {
        display: flex;
    }

    /* Nav als fullscreen overlay */
    #main-nav {
        display: none !important;
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--navy);
        flex-direction: column;
        padding: 1rem;
        z-index: 10000;
        gap: 0;
    }

    #main-nav.mobile-open {
        display: flex !important;
    }

    .nav-btn {
        padding: 1rem;
        text-align: left;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-left: none;
    }

    .nav-btn.active {
        border-bottom-color: rgba(255,255,255,0.1);
        background: rgba(255,255,255,0.1);
    }

    /* User info */
    #user-info {
        width: 100%;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    #user-label { font-size: 0.72rem; }

    /* Beschikbaarheid toggle onder header */
    #beschikbaarheid-toggle {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.3rem;
    }

    /* Kaart pagina */
    #page-kaart {
        flex-direction: column;
        height: calc(100vh - 48px);
        position: relative;
    }

    /* Filter sidebar — verborgen op mobiel, toggle via knop */
    aside#filters {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 400;
        width: 100%;
        min-width: unset;
        max-height: 100%;
        overflow-y: auto;
        background: var(--white);
    }

    aside#filters.mobile-open {
        display: block;
    }

    .filter-toggle {
        display: block;
    }

    /* Kaart neemt volledige hoogte */
    #map {
        height: 100%;
        flex: 1;
    }

    /* Formulieren */
    .form-container {
        padding: 1.25rem;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .form-row {
        flex-direction: column;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .mp-prov-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modals fullscreen op mobiel */
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 1.5rem;
    }

    /* Touch targets minimaal 44px */
    button, .nav-btn, .besch-btn, .mp-prov-btn, .mp-oa-btn, .dv-tab,
    .mp-sug-btn, .btn-doorverwijzing, .btn-accept, .btn-reject, .btn-copy {
        min-height: 44px;
    }

    select, input, textarea {
        min-height: 44px;
        font-size: 16px; /* Voorkomt zoom op iOS */
    }

    /* Dashboard stats grid */
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-row {
        flex-direction: column;
    }

    /* Aanvraag-card header stacken */
    .aanvraag-card > div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    /* Toast breder op mobiel */
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}
