/* =============================================
   AMS Monitoring – De Slimme Brug stijl
   ============================================= */


/* Auth-loading overlay: toont een spinner terwijl de initiele token-refresh
   wordt uitgevoerd na een pagina-refresh (voorkomt login-flash). */
.auth-loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg, #0B1628);
    z-index: 9999;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--dsb-orange-500, #F59E0B);
    border-radius: 50%;
    animation: auth-spin 0.75s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}
/* CSS custom properties – light thema (standaard) */
:root,
[data-theme="light"] {
    /* -- DSB Brand palette -- */
    --dsb-navy-900: var(--color-bg, #0B1628);
    --dsb-navy-800: var(--color-surface, #162035);
    --dsb-navy-700: #143A5B;
    --dsb-navy-600: #1E5380;
    --dsb-navy-500: #2E72A8;
    --dsb-orange-500: #F59E0B;
    --dsb-orange-400: #FBBF24;
    --dsb-orange-600: #D97706;
    --dsb-orange-100: #FEF3C7;
    --dsb-cyan-500:  #00B8D9;
    --dsb-cyan-400:  #36CFEA;
    --dsb-cyan-300:  #7FE0F2;
    --dsb-cyan-100:  #E1F7FB;
    --dsb-paper:    #F7F8FA;
    --dsb-bone:     #EEF1F5;
    --dsb-mist:     #DCE2EA;
    --dsb-slate-300: #B5BFCC;
    --dsb-slate-500: #7B8898;
    --dsb-slate-700: #3F4A5A;
    --dsb-ink:       #0E1620;
    --dsb-success-500: #16A34A;
    --dsb-warning-500: #D97706;
    --dsb-danger-500:  #DC2626;

    /* -- Kleuren -- */
    --color-primary: var(--dsb-orange-500);
    --color-primary-hover: var(--dsb-orange-400);
    --color-accent: var(--dsb-cyan-500);
    --color-accent-hover: var(--dsb-cyan-400);
    --color-bg: var(--dsb-paper);
    --color-bg-secondary: var(--dsb-bone);
    --color-surface: #ffffff;
    --color-surface-alt: var(--dsb-bone);
    --color-text: var(--dsb-ink);
    --color-text-muted: var(--dsb-slate-500);
    --color-border: var(--dsb-mist);
    --color-sidebar-bg: var(--dsb-navy-800);
    --color-sidebar-text: rgba(255,255,255,0.85);
    --color-sidebar-hover: var(--dsb-orange-500);
    --color-sidebar-nav-header: rgba(255,255,255,0.45);
    --color-sidebar-border: rgba(255,255,255,0.10);
    --color-topbar-bg: var(--dsb-navy-900);
    --color-topbar-text: #ffffff;

    /* -- Status (gesynchroniseerd met GetMarkerColor in Kaart.razor) -- */
    --status-closed:  #27a353;
    --status-open:    #1a73e8;
    --status-fault:   #ec0000;
    --status-unknown: #767676;
    --status-warning: #f59300;

    /* -- Semantic aliases -- */
    --bg-surface: #ffffff;
    --bg-surface-inset: var(--dsb-bone);
    --border-subtle: var(--dsb-mist);
    --text-primary: var(--dsb-ink);
    --text-muted: var(--dsb-slate-500);
    --ams-black: var(--dsb-ink);
    --ams-red: var(--dsb-orange-500);
    --color-card: #ffffff;
    --btn-close-filter: none;

    /* -- Typografie -- */
    --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
    --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* -- Schaduwen -- */
    --shadow-xs: 0 1px 2px rgba(10,37,64,0.06);
    --shadow-sm: 0 2px 6px rgba(10,37,64,0.06), 0 1px 2px rgba(10,37,64,0.04);
    --shadow-md: 0 6px 16px rgba(10,37,64,0.08), 0 2px 4px rgba(10,37,64,0.04);
    --shadow-lg: 0 16px 36px rgba(10,37,64,0.10), 0 4px 8px rgba(10,37,64,0.04);
    --shadow-glow: 0 0 0 4px rgba(245,158,11,0.22);

    /* -- Radius -- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* -- Motion -- */
    --ease-out: cubic-bezier(0.2, 0.7, 0.25, 1);
    --dur-fast: 160ms;
    --dur-normal: 240ms;

    /* -- Layout maten -- */
    --topbar-height: 68px;
    --topbar-total-height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
}

/* iOS/Android PWA standalone: safe-area-inset-top is al verwerkt door het OS;
   topbar-total-height is dan gelijk aan de vaste hoogte. */
@media (display-mode: standalone) {
    :root {
        --topbar-total-height: var(--topbar-height);
    }
}

/* Dark thema – DSB homepage stijl: diep zwart/bruin met oranje accenten */
[data-theme="dark"] {
    --color-bg: var(--color-bg, #0B1628);
    --color-bg-secondary: #140e05;
    --color-surface: var(--color-surface, #162035);
    --color-surface-alt: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --color-text: rgba(255,255,255,0.92);
    --color-text-muted: rgba(255,255,255,0.50);
    --color-border: rgba(245,158,11,0.12);
    --color-sidebar-bg: var(--color-bg, #0B1628);
    --color-sidebar-text: rgba(255,255,255,0.85);
    --color-sidebar-hover: var(--dsb-orange-500);
    --color-sidebar-nav-header: rgba(255,255,255,0.35);
    --color-sidebar-border: rgba(245,158,11,0.10);
    --color-topbar-bg: var(--color-bg, #0B1628);
    --color-topbar-text: #ffffff;
    --color-primary: var(--dsb-orange-500);
    --color-primary-hover: var(--dsb-orange-400);
    --color-accent: var(--dsb-orange-500);
    --status-warning: #F59E0B;
    --bg-surface: var(--color-surface, #162035);
    --bg-surface-inset: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --border-subtle: rgba(245,158,11,0.10);
    --text-primary: rgba(255,255,255,0.92);
    --text-muted: rgba(255,255,255,0.50);
    --ams-black: #ffffff;
    --ams-red: var(--dsb-orange-500);
    --color-card: var(--color-surface, #162035);
    /* Bootstrap 5 CSS-variabelen overschrijven – DSB dark */
    --bs-body-bg: var(--color-bg, #0B1628);
    --bs-body-color: rgba(255,255,255,0.90);
    --bs-secondary-bg: var(--color-surface, #162035);
    --bs-tertiary-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-border-color: rgba(245,158,11,0.12);
    --bs-border-color-translucent: rgba(245,158,11,0.08);
    --bs-list-group-bg: var(--color-surface, #162035);
    --bs-list-group-color: rgba(255,255,255,0.90);
    --bs-list-group-border-color: rgba(245,158,11,0.12);
    --bs-list-group-active-bg: #F59E0B;
    --bs-list-group-active-color: var(--color-bg, #0B1628);
    --bs-list-group-active-border-color: #F59E0B;
    --bs-list-group-hover-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-list-group-action-color: rgba(255,255,255,0.90);
    --bs-list-group-action-hover-color: #fff;
    --bs-card-bg: var(--color-surface, #162035);
    --bs-card-border-color: rgba(245,158,11,0.12);
    --bs-modal-bg: var(--color-surface, #162035);
    --bs-modal-border-color: rgba(245,158,11,0.15);
    --btn-close-filter: invert(1) grayscale(1);
    --bs-dropdown-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-dropdown-border-color: rgba(245,158,11,0.12);
    --bs-dropdown-link-color: rgba(255,255,255,0.90);
    --bs-dropdown-link-hover-bg: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface, #162035));
    --bs-table-bg: transparent;
    --bs-table-color: rgba(255,255,255,0.90);
    --bs-table-border-color: rgba(245,158,11,0.10);
    --bs-table-striped-bg: rgba(245,158,11,0.02);
    --bs-table-hover-bg: rgba(245,158,11,0.06);
    --bs-pagination-bg: var(--color-surface, #162035);
    --bs-pagination-border-color: rgba(245,158,11,0.12);
    --bs-pagination-color: rgba(255,255,255,0.80);
    --bs-pagination-hover-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-pagination-active-bg: #F59E0B;
    --bs-pagination-active-border-color: #F59E0B;
    --bs-pagination-disabled-bg: var(--color-bg, #0B1628);
    --bs-pagination-disabled-color: rgba(255,255,255,0.30);
    --bs-input-group-addon-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-input-group-addon-border-color: rgba(245,158,11,0.15);
    --bs-nav-tabs-border-color: rgba(245,158,11,0.10);
    --bs-nav-tabs-link-active-bg: var(--color-surface, #162035);
    --bs-nav-tabs-link-active-border-color: rgba(245,158,11,0.10) rgba(245,158,11,0.10) var(--color-surface, #162035);
    --bs-nav-tabs-link-active-color: #ffffff;
    --bs-nav-tabs-link-hover-border-color: rgba(245,158,11,0.10);
    --bs-nav-pills-link-active-bg: #F59E0B;
    --bs-toast-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-toast-border-color: rgba(245,158,11,0.12);
    --bs-popover-bg: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    --bs-popover-border-color: rgba(245,158,11,0.12);
    --bs-tooltip-bg: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface, #162035));
}

/* Dark mode – Bootstrap component overrides – DSB stijl */
[data-theme="dark"] body {
    background-color: var(--color-bg, #0B1628);
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628)) !important;
    color: rgba(255,255,255,0.90) !important;
    border-color: rgba(245,158,11,0.20) !important;
    color-scheme: dark;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input[type="date"]::placeholder { color: rgba(255,255,255,0.40); }

[data-theme="dark"] .form-label,
[data-theme="dark"] label { color: rgba(255,255,255,0.85); }

[data-theme="dark"] .form-check-label { color: rgba(255,255,255,0.85); }

[data-theme="dark"] .form-text { color: rgba(255,255,255,0.55); }

/* Bootstrap bg-warning/bg-info hebben standaard text-dark (zwart) — slecht leesbaar in dark-mode */
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-warning.text-dark,
[data-theme="dark"] span.bg-warning {
    background-color: #92400E !important;
    color: #FEF3C7 !important;
}
[data-theme="dark"] .badge.bg-info,
[data-theme="dark"] .badge.bg-info.text-dark,
[data-theme="dark"] span.bg-info {
    background-color: var(--color-surface, #162035) !important;
    color: #F59E0B !important;
}
/* Zorg dat .text-dark nooit donker is in dark-mode */
[data-theme="dark"] .text-dark {
    color: rgba(255,255,255,0.85) !important;
}
/* list-group dark-mode fix */
[data-theme="dark"] .list-group-item {
    background-color: var(--color-surface, #162035);
    border-color: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.90);
}
[data-theme="dark"] .list-group-item:hover,
[data-theme="dark"] .list-group-item-action:hover {
    background-color: #143A5B;
    color: rgba(255,255,255,0.95);
}
[data-theme="dark"] .list-group-item.active {
    background-color: #F59E0B;
    border-color: #F59E0B;
    color: var(--color-bg, #0B1628);
}
[data-theme="dark"] .list-group-item.active .opacity-75,
[data-theme="dark"] .list-group-item.active .opacity-50 {
    color: rgba(255,255,255,.8) !important;
}
/* pagination dark-mode */
[data-theme="dark"] .page-link {
    background-color: #1e1e1e;
    border-color: #444444;
    color: #f0f0f0;
}
[data-theme="dark"] .page-link:hover {
    background-color: #2c2c2c;
    color: #fff;
}
[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #181818;
    border-color: #444444;
    color: #666;
}
[data-theme="dark"] .page-item.active .page-link {
    background-color: #F59E0B;
    border-color: #F59E0B;
    color: var(--color-bg, #0B1628);
}
/* input-group dark */
[data-theme="dark"] .input-group-text {
    background-color: #143A5B;
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.90);
}
/* nav-tabs dark */
[data-theme="dark"] .nav-tabs {
    border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .nav-tabs .nav-link {
    color: rgba(255,255,255,0.55);
    border-color: transparent;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: rgba(255,255,255,0.90);
    border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--color-surface, #162035);
    border-color: rgba(255,255,255,0.10) rgba(255,255,255,0.10) var(--color-surface, #162035);
    color: #ffffff;
}
/* progress bar dark */
[data-theme="dark"] .progress {
    background-color: rgba(255,255,255,0.08);
}
/* small/muted tekst in tabel-rijen */
[data-theme="dark"] small,
[data-theme="dark"] .small {
    color: inherit;
}
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary {
    color: rgba(255,255,255,0.55) !important;
}
/* hr dark */
[data-theme="dark"] hr {
    border-color: rgba(255,255,255,0.10);
    opacity: 1;
}

[data-theme="dark"] .card,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-footer {
    background-color: var(--color-surface, #162035) !important;
    border-color: rgba(245,158,11,0.12) !important;
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .card-header {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628)) !important;
}

[data-theme="dark"] .table {
    color: rgba(255,255,255,0.90);
    --bs-table-bg: var(--color-surface, #162035);
    --bs-table-border-color: rgba(245,158,11,0.10);
    --bs-table-striped-bg: rgba(245,158,11,0.02);
    --bs-table-hover-bg: rgba(245,158,11,0.06);
    --bs-table-color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .table thead th {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628)) !important;
    color: rgba(255,255,255,0.90) !important;
    border-color: rgba(245,158,11,0.12) !important;
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: rgba(245,158,11,0.08) !important;
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(245,158,11,0.07);
    color: rgba(255,255,255,0.95);
}

[data-theme="dark"] .modal-content {
    background-color: var(--color-surface, #162035);
    border-color: rgba(245,158,11,0.15);
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    border-color: rgba(245,158,11,0.12);
}

[data-theme="dark"] .modal-body {
    background-color: var(--color-surface, #162035);
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .modal-title { color: #ffffff; }

/* Light-mode modals: expliciete kleuren zodat ze niet afhangen van Bootstrap defaults */
.modal-header,
.modal-footer {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.modal-body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

[data-theme="dark"] .offcanvas {
    background-color: var(--color-surface, #162035) !important;
    color: rgba(255,255,255,0.90);
    border-color: rgba(245,158,11,0.12) !important;
}

[data-theme="dark"] .offcanvas-header {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    border-bottom-color: rgba(245,158,11,0.12);
}

[data-theme="dark"] .offcanvas-title { color: #ffffff; }

[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

[data-theme="dark"] .btn-outline-primary {
    color: #F59E0B !important;
    border-color: #F59E0B !important;
}
[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #F59E0B !important;
    color: var(--color-bg, #0B1628) !important;
}

[data-theme="dark"] .btn-outline-secondary {
    color: rgba(255,255,255,0.65) !important;
    border-color: rgba(255,255,255,0.25) !important;
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(220,38,38,0.15);
    border-color: #DC2626;
    color: #FCA5A5;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(22,163,74,0.12);
    border-color: #16A34A;
    color: #86EFAC;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(0,184,217,0.10);
    border-color: #00B8D9;
    color: #7FE0F2;
}

[data-theme="dark"] .alert-info a {
    color: #36CFEA;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(217,119,6,0.12);
    border-color: #D97706;
    color: #FCD34D;
}

[data-theme="dark"] .alert-warning a {
    color: #FDE68A;
}

/* table-* rij-kleuren in dark-mode */
[data-theme="dark"] .table-danger,
[data-theme="dark"] .table-danger > td,
[data-theme="dark"] .table-danger > th {
    --bs-table-accent-bg: rgba(220,38,38,0.14);
    background-color: rgba(220,38,38,0.14) !important;
    color: #FCA5A5 !important;
}

[data-theme="dark"] .table-warning,
[data-theme="dark"] .table-warning > td,
[data-theme="dark"] .table-warning > th {
    --bs-table-accent-bg: rgba(217,119,6,0.14);
    background-color: rgba(217,119,6,0.14) !important;
    color: #FCD34D !important;
}

[data-theme="dark"] .table-success,
[data-theme="dark"] .table-success > td,
[data-theme="dark"] .table-success > th {
    --bs-table-accent-bg: rgba(22,163,74,0.12);
    background-color: rgba(22,163,74,0.12) !important;
    color: #86EFAC !important;
}

[data-theme="dark"] .table-info,
[data-theme="dark"] .table-info > td,
[data-theme="dark"] .table-info > th {
    --bs-table-accent-bg: rgba(0,184,217,0.10);
    background-color: rgba(0,184,217,0.10) !important;
    color: #7FE0F2 !important;
}

[data-theme="dark"] .badge.bg-secondary { background-color: #1E5380 !important; }

[data-theme="dark"] .dropdown-menu {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    border-color: rgba(245,158,11,0.12);
}

[data-theme="dark"] .dropdown-item {
    color: rgba(255,255,255,0.90);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface, #162035));
    color: #ffffff;
}

[data-theme="dark"] code {
    background-color: color-mix(in srgb, var(--color-surface, #162035) 85%, var(--color-bg, #0B1628));
    color: #F59E0B;
}

/* Reset & basis */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans, 'Inter', 'Segoe UI', system-ui, sans-serif);
    font-size: 16px;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-feature-settings: "ss01" 1, "cv05" 1, "cv11" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display, 'Space Grotesk', 'Inter', system-ui, sans-serif);
    font-weight: 800;
    letter-spacing: -0.045em;
}

/* =============================================
   ANIMATIES & OVERGANGEN – AMS Monitoring
   Subtiel, professioneel, consistent
   ============================================= */

/* -- Globale micro-interacties -- */
a,
button,
.btn,
.nav-link,
.list-group-item,
.dropdown-item {
    transition: color 0.15s ease, background-color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease,
                opacity 0.15s ease;
}

/* Cards en panelen verschijnen met een lichte fade-slide */
.card,
.offcanvas,
.modal-content {
    transition: background-color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease;
}

/* Tabelrijen hover – vloeiende achtergrond */
.table-hover tbody tr {
    transition: background-color 0.12s ease;
}

/* Badges – kleur schakelend */
.badge {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* -- Inkomende pagina-inhoud -- */
.main-content {
    animation: ams-page-in 0.22s ease-out both;
}

@keyframes ams-page-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Card entrance -- */
.card {
    animation: ams-card-in 0.25s ease-out both;
}

@keyframes ams-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Staggered delay voor rasters van cards */
.card:nth-child(1)  { animation-delay: 0.02s; }
.card:nth-child(2)  { animation-delay: 0.04s; }
.card:nth-child(3)  { animation-delay: 0.06s; }
.card:nth-child(4)  { animation-delay: 0.08s; }
.card:nth-child(5)  { animation-delay: 0.10s; }
.card:nth-child(6)  { animation-delay: 0.12s; }

/* -- Knoppen – subtiele lift bij hover -- */
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}
.btn {
    transition: color 0.15s ease, background-color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease,
                transform 0.12s ease;
}

/* -- Formuliervelden – focus-ring animatie -- */
.form-control,
.form-select {
    transition: border-color 0.18s ease, box-shadow 0.18s ease,
                background-color 0.18s ease;
}
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(0,184,217,0.25);
}

/* -- Statusbadge – fade bij statuswijziging -- */
.status-badge,
[class*="badge"] {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* -- Klikbare tabelrijen -- */
.tr-clickable {
    cursor: pointer;
}
.tr-clickable:hover td {
    background-color: var(--color-surface-hover, rgba(255,255,255,.05));
}

/* -- Tabelrij-fault -- */
.table-row-fault {
    animation: ams-row-fault-in 0.35s ease-out both;
}
@keyframes ams-row-fault-in {
    from { background-color: rgba(220,38,38,0.15); }
    to   { background-color: transparent; }
}

/* -- Offcanvas slide-in (formulierpanelen) -- */
.offcanvas.show {
    animation: ams-offcanvas-in 0.28s cubic-bezier(.25,.8,.25,1) both;
}
@keyframes ams-offcanvas-in {
    from { transform: translateX(100%); opacity: 0.6; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* -- Alert / foutmelding fade-in -- */
.alert {
    animation: ams-alert-in 0.2s ease-out both;
}
@keyframes ams-alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Spinner aanwezig animatie -- */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

/* -- Topbar en sidebar – vloeiende themawissel -- */
.topbar,
.sidebar,
.app-shell {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* -- Sidebar nav-links -- */
.sidebar .nav-link,
.sidebar-nav .nav-link {
    transition: background-color 0.15s ease, color 0.15s ease,
                border-left-color 0.15s ease, padding-left 0.15s ease;
}

/* -- Beheer-toolbar zoekbalk focus -- */
.beheer-toolbar .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0,184,217,0.25);
}

/* -- Map/filter chips -- */
.map-chip {
    transition: background-color 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, transform 0.1s ease;
}
.map-chip:hover:not(.active) {
    transform: translateY(-1px);
}
.map-chip.active {
    transform: scale(1.03);
}

/* -- KPI-kaarten op detail-pagina -- */
.kpi-card-detail {
    transition: box-shadow 0.2s ease, border-color 0.2s ease,
                background-color 0.2s ease;
    animation: ams-card-in 0.3s ease-out both;
}
.kpi-card-detail:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

/* -- Realtime badge pulse -- */
.badge-realtime {
    animation: ams-live-pulse 2s ease-in-out infinite;
}
@keyframes ams-live-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* -- Kaart update toast -- */
.map-update-toast {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(30,30,30,0.88);
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 50%, transparent);
    pointer-events: none;
    animation: ams-toast-in-out 3s ease forwards;
    white-space: nowrap;
}
.map-update-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #F59E0B;
    margin-right: 5px;
    vertical-align: middle;
}
@keyframes ams-toast-in-out {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

/* -- KPI grid highlight bij live update -- */
@keyframes ams-kpi-updated {
    0%   { outline: 2px solid rgba(0,184,217,0.7); outline-offset: 4px; }
    100% { outline: 2px solid transparent; outline-offset: 4px; }
}
.kpi-grid-updated {
    animation: ams-kpi-updated 1.8s ease-out forwards;
    border-radius: 6px;
}

/* -- MetroKaart node highlight bij live update (SVG g-element) -- */
@keyframes ams-node-updated {
    0%   { filter: drop-shadow(0 0 5px rgba(236, 0, 0, 0.9)); }
    100% { filter: none; }
}
.metro-node-updated {
    animation: ams-node-updated 1.8s ease-out forwards;
}

/* -- Tegel highlight bij live update -- */
@keyframes ams-tile-updated {
    0%   { box-shadow: 0 0 0 3px rgba(0,184,217,0.7); }
    100% { box-shadow: none; }
}
.tile-updated {
    animation: ams-tile-updated 1.8s ease-out forwards;
}

/* -- Row/card highlight bij live update -- */
@keyframes ams-row-updated {
    0%   { background-color: rgba(236, 0, 0, 0.18); }
    100% { background-color: transparent; }
}
.row-updated {
    animation: ams-row-updated 1.8s ease-out forwards;
}

/* -- Nieuwe rij highlight (bijv. nieuwe melding) -- */
@keyframes ams-row-new {
    0%   { background-color: rgba(76, 175, 116, 0.25); }
    100% { background-color: transparent; }
}
.row-new {
    animation: ams-row-new 2.5s ease-out forwards;
}

/* -- Reduce motion – respecteer gebruikersvoorkeur -- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
   MOBILE SHELL FIXES — menu, overscroll, ticker
   ============================================= */

html,
body {
    min-height: 100%;
    overscroll-behavior: none;
}

@media (max-width: 768px) {
    body.mobile-nav-open {
        overflow: hidden;
    }

    /* Sidebar zelf pan-y voor scrollen; links en knoppen expliciet auto zodat taps werken */
    body.mobile-nav-open .sidebar {
        touch-action: pan-y;
    }

    body.mobile-nav-open .sidebar a,
    body.mobile-nav-open .sidebar button {
        touch-action: manipulation;
    }
}

@media (min-width: 769px) {
    body.mobile-nav-open {
        overflow: auto;
    }
}



.content-area,
.sidebar {
    overscroll-behavior: contain;
}

@media (max-width: 768px) {
    .topbar {
        height: var(--topbar-total-height);
        min-height: var(--topbar-total-height);
        padding-top: env(safe-area-inset-top, 0px);
    }

    .app-shell {
        padding-top: var(--topbar-total-height);
    }

    .content-area {
        padding-top: 0;
        width: 100%;
        min-width: 0;
        min-height: calc(100dvh - var(--topbar-total-height));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: none;
        /* Kleine zijdelingse padding zodat tekst niet tegen de rand plakt */
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }

    /* Mobiel: reset de negatieve margin van .page-header — er is geen padding te compenseren */
    #app-shell .page-header,
    .page-header {
        margin-left: -0.75rem !important;
        margin-right: -0.75rem !important;
        width: calc(100% + 1.5rem) !important;
        top: var(--topbar-total-height) !important;
    }

    .sidebar-backdrop {
        top: var(--topbar-total-height);
        bottom: 0;
        z-index: 1490;
        overscroll-behavior: none;
        pointer-events: auto;
    }

    .sidebar {
        /* Width en padding-top worden gezet in de authoritatieve mobile-blok
           bij regel ~1150 (min(65vw, 240px) / padding-top: 0.45rem).
           Hier alleen de positionering en bottom-safe-area. */
        max-height: calc(100dvh - var(--topbar-total-height));
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        overscroll-behavior: none;
        pointer-events: auto;
    }

    .topbar .nav-toggle-menu {
        min-width: 48px;
        min-height: 48px;
        width: 48px;
        height: 48px;
        margin-left: 0.35rem;
        z-index: 1600;
        position: relative;
    }

    .topbar .brand {
        flex: 1 1 0;
        min-width: 0;
    }

    .topbar .spacer {
        display: none;
    }

    .dsb-ticker {
        height: calc(42px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        align-items: center;
        z-index: 1080;
    }

    .dsb-ticker-track {
        height: 36px;
        align-items: center;
    }
}

@media (max-width: 420px) {
    .content-area {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }

    .dsb-ticker {
        height: calc(38px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        align-items: center;
    }

    .dsb-ticker-track {
        height: 34px;
    }
}


/* Layout */
.page {
    display: flex;
    flex-direction: column;
    height: 100dvh;   /* vaste hoogte: maakt .app-shell/.content-area tot echte scroll-containers */
    width: 100%;
    overflow: hidden; /* page zelf scrollt niet; .content-area doet dat */
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    background-color: var(--color-bg);
}

/* Topbar */
.topbar {
    background: color-mix(in srgb, var(--color-topbar-bg) 92%, transparent);
    backdrop-filter: blur(18px);
    color: var(--color-topbar-text);
    min-height: 68px;
    display: flex;
    align-items: center;
    /* Safe area: links/rechts voor notch landscape, boven voor status bar */
    padding: env(safe-area-inset-top, 0px) max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
    gap: 1.25rem;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(245,158,11,0.08), 0 16px 42px rgba(0,0,0,0.28);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Desktop: sticky in de flow */
@media (min-width: 769px) {
    .topbar {
        position: sticky;
    }
}

/* Mobiel: fixed zodat topbar altijd boven de content zweeft */
@media (max-width: 768px) {
    .topbar {
        position: fixed;
        left: 0;
        right: 0;
        z-index: 1200;
    }
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-topbar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.topbar .brand-logo {
    flex-shrink: 0;
    display: inline-block;
    color: rgba(255,255,255,0.92);
    filter: drop-shadow(0 0 10px rgba(245,158,11,0.10));
}

.topbar .brand-text {
    font-size: 1.02rem;
    font-weight: 800;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    color: #fff;
    letter-spacing: -0.025em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar,
.sidebar,
.dsb-ticker,
.dsb-live-pill,
.dsb-panel-topline,
.dsb-panel-grid small,
.dsb-panel-grid span,
.dsb-sensor-card,
.dsb-hero-metrics span {
    -webkit-font-smoothing: antialiased;
}

.sidebar .nav-group-header,
.sidebar .nav-link,
.topbar-username,
.btn-topbar-icon {
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.topbar .spacer { flex: 1; }

.topbar .nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Menu-knop override: altijd zichtbaar, wit icoon op rode balk */
.nav-toggle-menu {
    display: inline-flex !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1.5px solid rgba(255,255,255,0.4) !important;
    color: #ffffff !important;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}
.nav-toggle-menu:hover {
    background: rgba(255,255,255,0.28) !important;
    border-color: rgba(255,255,255,0.7) !important;
}
/* Op desktop sidebar altijd zichtbaar: knop meer subtiel */
@media (min-width: 769px) {
    .nav-toggle-menu {
        background: rgba(255,255,255,0.12) !important;
        border-color: rgba(255,255,255,0.25) !important;
    }
    .nav-toggle-menu:hover {
        background: rgba(255,255,255,0.22) !important;
    }
}

/* Sidebar + offcanvas */
.app-shell {
    display: flex;
    flex: 1;
    min-height: 0; /* kritiek: zonder dit groeit flex-child buiten .page */
}

/* Backdrop: verborgen op desktop, zichtbaar als overlay op mobiel */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1490;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Backdrop alleen tonen op mobiel: op desktop staat de sidebar permanent open
   en mag niets de pagina-interactie blokkeren. */
body.mobile-nav-open .sidebar-backdrop.open {
    display: block;
}

.sidebar {
    width: 240px;
    height: calc(100dvh - var(--topbar-total-height));
    background: color-mix(in srgb, var(--color-sidebar-bg) 94%, transparent);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.25s ease, width 0.25s ease;
    border-right: 1px solid var(--color-sidebar-border, #e0e0e0);
    overflow-x: hidden;
    overflow-y: auto;
    /* Altijd fixed — staat buiten .page zodat overflow:hidden de overlay niet afkapt */
    position: fixed;
    top: var(--topbar-total-height);
    left: 0;
    z-index: 1500;
}

/* Mobiel: sidebar als fixed overlay (verborgen links, schuift in bij open) */
@media (max-width: 768px) {
    .sidebar {
        top: var(--topbar-total-height);
        height: calc(100dvh - var(--topbar-total-height));
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: min(65vw, 240px) !important;
        border-right-width: 1px;
        padding-top: 0.45rem;
        padding-left: env(safe-area-inset-left, 0px);
        pointer-events: auto;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar nav > .nav-group:first-child {
        margin-top: 0.35rem;
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

/* Desktop: sidebar zichtbaar als fixed panel links; content-area krijgt margin-left */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease, width 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        width: 240px;
    }

    .sidebar:not(.open) {
        width: 0;
        border-right-width: 0;
    }

    /* Content-area verschuift mee met de sidebar breedte op desktop */
    .content-area {
        transition: margin-left 0.25s ease;
        margin-left: 0;
    }

    body.sidebar-open .content-area {
        margin-left: 240px;
    }
}

.sidebar .nav-header {
    padding: 1rem 1rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-sidebar-nav-header, #767676);
}

.sidebar .nav-link {
    color: var(--color-sidebar-text);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s;
    font-size: 0.86rem;
    text-transform: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(245,158,11,0.10);
    color: #F59E0B;
    border-left: 2px solid #F59E0B;
    padding-left: calc(1rem - 2px);
}

.sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.86;
}

.nav-icon::before {
    content: '';
    width: 16px;
    height: 16px;
    display: block;
    border: 1.8px solid currentColor;
    border-radius: 4px;
    box-sizing: border-box;
}

.nav-icon[data-icon="overview"]::before,
.nav-icon[data-icon="dashboard"]::before { border-radius: 3px; box-shadow: inset 6px 0 0 rgba(245,158,11,0.28), inset 0 -6px 0 rgba(255,255,255,0.10); }
.nav-icon[data-icon="map"]::before { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.nav-icon[data-icon="table"]::before { border-radius: 2px; background: linear-gradient(currentColor 0 0) 50% 33%/100% 1.5px no-repeat, linear-gradient(currentColor 0 0) 50% 66%/100% 1.5px no-repeat; }
.nav-icon[data-icon="tiles"]::before { border-radius: 2px; background: linear-gradient(currentColor 0 0) 50% 50%/100% 1.5px no-repeat, linear-gradient(90deg, currentColor 0 1.5px, transparent 0) 50% 50%/50% 100% no-repeat; }
.nav-icon[data-icon="play"]::before { width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; border-right: 0; border-radius: 0; }
.nav-icon[data-icon="alert"]::before { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 15px solid currentColor; border-top: 0; border-radius: 0; opacity: 0.88; }
.nav-icon[data-icon="bell"]::before { border-radius: 8px 8px 5px 5px; border-bottom-width: 3px; }
.nav-icon[data-icon="chart"]::before { border-radius: 2px; background: linear-gradient(90deg, transparent 2px, currentColor 2px 4px, transparent 4px 6px, currentColor 6px 8px, transparent 8px 10px, currentColor 10px 12px, transparent 12px); }
.nav-icon[data-icon="manage"]::before,
.nav-icon[data-icon="system"]::before,
.nav-icon[data-icon="settings"]::before { border-radius: 50%; box-shadow: inset 0 0 0 4px var(--color-sidebar-bg, var(--color-bg, #0B1628)); }
.nav-icon[data-icon="bridge"]::before { border-radius: 0; border-left: 0; border-right: 0; transform: translateY(2px); box-shadow: 0 -7px 0 -4px currentColor; }
.nav-icon[data-icon="users"]::before { border-radius: 50%; box-shadow: 9px 5px 0 -5px currentColor, -9px 5px 0 -5px currentColor; }
.nav-icon[data-icon="device"]::before { border-radius: 3px; box-shadow: inset 0 -4px 0 rgba(245,158,11,0.24); }
.nav-icon[data-icon="tag"]::before { border-radius: 4px 4px 4px 0; transform: rotate(-45deg); }
.nav-icon[data-icon="map-pin"]::before { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: inset 0 0 0 4px var(--color-sidebar-bg, var(--color-bg, #0B1628)); }
.nav-icon[data-icon="briefcase"]::before { border-radius: 3px; box-shadow: 0 -5px 0 -3px currentColor; }
.nav-icon[data-icon="palette"]::before { border-radius: 50%; box-shadow: inset 5px -2px 0 rgba(245,158,11,0.38); }
.nav-icon[data-icon="audit"]::before,
.nav-icon[data-icon="log"]::before { border-radius: 2px; background: linear-gradient(currentColor 0 0) 50% 35%/70% 1.5px no-repeat, linear-gradient(currentColor 0 0) 50% 65%/70% 1.5px no-repeat; }
.nav-icon[data-icon="key"]::before { border-radius: 50%; box-shadow: 10px 0 0 -6px currentColor; }
.nav-icon[data-icon="signal"]::before { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px currentColor, 0 0 0 4px transparent, 0 0 0 6px currentColor; transform: scale(0.65); }
.nav-icon[data-icon="code"]::before { border: 0; border-radius: 0; background: linear-gradient(135deg, transparent 35%, currentColor 35% 45%, transparent 45%), linear-gradient(225deg, transparent 35%, currentColor 35% 45%, transparent 45%); }
.nav-icon[data-icon="widgets"]::before { border-radius: 2px; box-shadow: 8px 0 0 -2px currentColor, 0 8px 0 -2px currentColor, 8px 8px 0 -2px currentColor; transform: scale(0.68); }
.nav-icon[data-icon="shield"]::before { border-radius: 8px 8px 5px 5px; clip-path: polygon(50% 0, 100% 18%, 88% 80%, 50% 100%, 12% 80%, 0 18%); }
.nav-icon[data-icon="mail"]::before { border-radius: 2px; background: linear-gradient(135deg, transparent 45%, currentColor 45% 55%, transparent 55%), linear-gradient(225deg, transparent 45%, currentColor 45% 55%, transparent 55%); }

/* -- Nav-groepen (2-niveau uitklapbaar) -- */
.sidebar .nav-group {
    border-bottom: 1px solid var(--color-sidebar-border, #e0e0e0);
}

.sidebar .nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-sidebar-text);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    opacity: 0.70;
    transition: background-color 0.15s;
}

.sidebar .nav-group-header:hover {
    background-color: rgba(236, 0, 0, 0.08);
}

.sidebar .nav-group-header .nav-chevron {
    margin-left: auto;
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
    display: inline-block;
}

.sidebar .nav-group-open .nav-group-header .nav-chevron {
    transform: rotate(180deg);
}

.sidebar .nav-group-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.sidebar .nav-group-open .nav-group-body {
    max-height: 800px;
}

.sidebar .nav-sublink {
    padding-left: 2rem !important;
    font-size: 0.84rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Rol-badge bolletje rechts van het label */
.nav-role-badge {
    margin-left: auto;
    font-size: 0.5rem;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    cursor: default;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.sidebar .nav-sublink:hover .nav-role-badge {
    opacity: 1;
}

/* Kleuren per toegangsniveau */
.nav-role-all   { color: #bebebe; } /* grijs  — alle rollen */
.nav-role-beheer { color: #4a9eff; } /* blauw  — Beheerder+ */
.nav-role-admin  { color: #ec0000; } /* rood   — Admin only */

/* CSS-only tooltip via data-tooltip attribuut */
.nav-role-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background-color: #202020;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.nav-role-badge:hover::after {
    opacity: 1;
}

/* Snelle acties in mobiel zijmenu */
.nav-mobile-actions {
    display: none;
}

@media (max-width: 768px) {
    .nav-mobile-actions {
        display: block;
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(255,255,255,0.08);
        margin-top: 0.5rem;
    }

    .nav-mobile-actions-title {
        font-size: 0.68rem;
        opacity: 0.55;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.4rem;
    }

    .nav-mobile-actions-list {
        display: grid;
        gap: 0.25rem;
    }

    .nav-mobile-action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.35rem;
        min-height: 26px;
        width: 100%;
        border-radius: 5px;
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
        color: rgba(255,255,255,0.60);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 400;
        padding: 0.2rem 0.5rem;
        cursor: pointer;
    }

    .nav-mobile-action-icon-shell {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.04);
        color: rgba(255,255,255,0.55);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .nav-mobile-action-icon-shell.danger {
        border-color: rgba(236, 0, 0, 0.30);
        background: rgba(80, 10, 20, 0.5);
        color: rgba(255,180,180,0.85);
    }

    .nav-mobile-action-icon-shell svg {
        flex-shrink: 0;
        opacity: 0.92;
    }

    .nav-mobile-action-btn span {
        min-width: 0;
    }

    .nav-mobile-action-btn:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

    .nav-mobile-action-btn.danger {
        border-color: rgba(236, 0, 0, 0.25);
        background: rgba(236, 0, 0, 0.07);
        color: rgba(255,180,180,0.80);
    }
}

/* Legenda onderaan de sidebar */
.nav-role-legend {
    padding: 0.6rem 1rem 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 0.5rem;
}

.nav-role-legend-title {
    font-size: 0.68rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.nav-role-legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.nav-role-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    opacity: 0.7;
}

.nav-role-legend-dot {
    font-size: 0.5rem;
    line-height: 1;
}


.content-area {
    flex: 1;
    min-height: 0;        /* Noodzakelijk in flex-context: voorkomt dat flex-child groeit buiten de container */
    overflow-y: auto;
    overflow-x: hidden;
    /* Desktop padding: rondom zodat inhoud niet tegen de randen plakt.
       .page-header compenseert dit met negatieve margin zodat hij edge-to-edge blijft. */
    padding: 0 1.5rem;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(circle at 68% 24%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 24rem),
        linear-gradient(90deg, color-mix(in srgb, var(--color-border) 35%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, color-mix(in srgb, var(--color-border) 24%, transparent) 1px, transparent 1px),
        linear-gradient(115deg, var(--color-bg) 0%, color-mix(in srgb, var(--color-bg) 78%, var(--color-surface)) 42%, color-mix(in srgb, var(--color-bg) 88%, var(--color-accent)) 100%);
    background-size: auto, 64px 64px, 64px 64px, auto;
}

[data-theme="light"] .content-area {
    background:
        radial-gradient(circle at 68% 24%, rgba(245,158,11,0.08), transparent 24rem),
        linear-gradient(90deg, rgba(14,22,32,0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(14,22,32,0.04) 1px, transparent 1px),
        linear-gradient(115deg, #f7f8fa 0%, #ffffff 55%, #fffbf5 100%);
    background-size: auto, 64px 64px, 64px 64px, auto;
}

/* Knoppen */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    min-height: 44px;
    font-size: 1rem;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #ffffff;
}

/* Formulieren */
.form-control, .form-select {
    font-size: 1rem;
    min-height: 44px;
    border-color: var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(245,158,11,0.18);
}

.form-label { font-weight: 600; color: var(--color-text); }

/* Kaarten/cards */
.card {
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    border-radius: 4px;
}

.card-header {
    background-color: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-closed  { background: var(--status-closed);  color: #fff; }
.status-open    { background: var(--status-open);    color: #fff; }
.status-fault   { background: var(--status-fault);   color: #fff; }
.status-unknown { background: var(--status-unknown); color: #fff; }
.status-warning { background: var(--status-warning); color: #fff; } /* var is donkerder in light, lichter in dark — zie :root */
.status-open    { background: var(--status-open);    color: #fff; }

/* Tegels */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.tile {
    background-color: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.tile.tile-fault   { border-color: var(--status-fault);   }
.tile.tile-open    { border-color: var(--status-open);    }
.tile.tile-closed  { border-color: var(--status-closed);  }
.tile.tile-unknown { border-color: var(--status-unknown); }

.tile-name  { font-weight: 700; font-size: 0.95rem; }
.tile-code  { font-size: 0.75rem; color: var(--color-text-muted); }

/* Tabel */
.table { color: var(--color-text); }
.table thead th {
    background-color: var(--color-surface-alt);
    border-color: var(--color-border);
    font-weight: 700;
    white-space: nowrap;
}
.table td { border-color: var(--color-border); vertical-align: middle; }
.table-responsive { overflow-x: auto; }

/* Kaartpagina layout */
.map-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Kaart toolbar */
.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.map-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.map-toolbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-realtime {
    font-size: .72rem;
    color: #1a7a3c; /* 4.6:1 op wit; dark-theme override hieronder */
    font-weight: 600;
    letter-spacing: .03em;
}
[data-theme="dark"] .badge-realtime { color: #4caf74; /* 4.5:1 op #121212 */ }

/* Filter chips */
.map-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Toggle-knop: alleen zichtbaar op mobiel */
.map-filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.map-filter-toggle-btn:hover { color: var(--color-text); border-color: var(--color-text); }
.map-filter-toggle-btn .chevron-up { transform: rotate(180deg); transition: transform 0.2s; }
.map-filter-toggle-btn svg { transition: transform 0.2s; }

@media (max-width: 768px) {
    /* Toggle-knop tonen op mobiel */
    .map-filter-toggle-btn { display: inline-flex; }

    /* Toolbar: titel en toggle naast elkaar, acties eronder */
    .map-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .map-toolbar-title {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Filters standaard verborgen op mobiel */
    .map-toolbar-actions {
        display: none;
        flex-direction: column;
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid var(--color-border);
        margin-top: 8px;
    }
    /* Zichtbaar wanneer open */
    .map-toolbar-actions.filters-open {
        display: flex;
    }
}

.map-chip {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.map-chip:hover { background: var(--color-hover); }

.map-chip.active {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.map-chip.chip-closed.active  { background: #27a353; border-color: #27a353; }
.map-chip.chip-open.active    { background: #1a73e8; border-color: #1a73e8; }
.map-chip.chip-fault.active   { background: #ec0000; border-color: #ec0000; }
.map-chip.chip-unknown.active { background: #767676; border-color: #767676; }

/* Legenda */
.map-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: .8rem;
    color: var(--color-text-muted);
}

.map-legend-overlay {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.93);
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    min-width: 190px;
}

[data-theme="dark"] .map-legend-overlay {
    background: rgba(30, 30, 30, 0.93);
    color: #ddd;
    border-color: #444;
}

.map-legend-title {
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
    color: var(--color-text, #202020);
}

[data-theme="dark"] .map-legend-title {
    color: #eee;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.7);
    box-shadow: 0 2px 5px rgba(0,0,0,.4);
    flex-shrink: 0;
}

/* Kaart marker pin */
.marker-pin {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.55);
}

/* Permanente Leaflet-tooltip als label onder marker */
.marker-tooltip {
    background: rgba(255,255,255,0.92) !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.28) !important;
    padding: 2px 6px !important;
    font-family: sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: #202020;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
}

/* Verberg het standaard pijltje van Leaflet-tooltips */
.marker-tooltip::before {
    display: none !important;
}

/* Hover-only tooltip (bij laag zoomniveau): subtiel andere achtergrond ter onderscheid */
.marker-tooltip.marker-tooltip-hover {
    background: rgba(255,255,255,0.97) !important;
}

.marker-tooltip .tt-name {
    display: block;
    font-weight: 600;
}

.marker-tooltip .tt-code {
    display: block;
    font-size: 10px;
    color: #555;
    font-weight: 400;
}

.marker-tooltip .tt-extra {
    display: block;
    font-size: 10px;
    color: #444;
    font-weight: 400;
}

/* Label-toggle knoppen in toolbar */
.map-label-toggles {
    display: flex;
    gap: 6px;
    align-items: center;
}

.map-label-toggles .toggle-icon {
    font-weight: 700;
    margin-right: 2px;
}

.map-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.map-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.map-container {
    /* Vul de beschikbare ruimte binnen .map-wrapper (zelf flex:1 in .map-page).
       Geen vaste dvh-hoogte: die negeert PageHeader + ticker en zorgt voor
       overlap met de topbar/onderkant. min-height alleen als fallback. */
    flex: 1 1 auto;
    min-height: 320px;
    height: 100%;
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.map-attribution {
    position: absolute;
    bottom: 6px;
    right: 8px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.82);
    color: #333;
    font-size: .72rem;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: auto;
}

.map-attribution a {
    color: #0078a8;
    text-decoration: none;
}

.map-attribution a:hover {
    text-decoration: underline;
}

/* Dashboard KPI cards – stijl conform klantoverzicht */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-primary);
    border-radius: 6px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    position: relative;
}

.kpi-card-info {
    position: absolute;
    top: 8px;
    right: 8px;
    line-height: 1;
}

.kpi-card.kpi-ok   { border-left-color: var(--status-closed); }
.kpi-card.kpi-fault { border-left-color: var(--status-fault); }
.kpi-card.kpi-warn  { border-left-color: var(--status-warning); }
.kpi-card.kpi-info  { border-left-color: var(--status-open); }

.kpi-card-label {
    font-size: .76rem;
    color: var(--color-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.kpi-card-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.1;
}

.kpi-card-trend {
    font-size: .78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.kpi-card-trend.up   { color: var(--status-closed); }
.kpi-card-trend.down { color: var(--status-fault); }

/* Tegels-panel (aan/uit checkboxes) */
.tile-toggle-wrap {
    position: relative;
}

.tile-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 200;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    min-width: 220px;
    max-width: 280px;
}

.tile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-alt, var(--color-surface));
    border-radius: 8px 8px 0 0;
}

.tile-panel-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.tile-panel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
}

.tile-panel-item input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

.tile-panel-footer {
    padding: 8px 14px 10px;
    border-top: 1px solid var(--color-border);
    text-align: right;
}

.tile-panel-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted, #bebebe);
    padding: 4px 0 2px;
}

/* Dashboard filter balk */
.dashboard-filters {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-filters strong {
    font-size: .82rem;
    color: var(--color-text-muted);
    margin-right: 4px;
    white-space: nowrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 5px 11px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    border-radius: 999px;
    white-space: nowrap;
    transition: background .12s, color .12s;
}

.filter-chip:hover { background: var(--color-surface-alt); }

.filter-chip.active {
    background: var(--color-text);
    color: var(--color-surface);
    border-color: var(--color-text);
}

/* Dashboard rijen */
.dashboard-row {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-row.cols-2   { grid-template-columns: 1fr 1fr; }
.dashboard-row.cols-3   { grid-template-columns: repeat(3, 1fr); }
.dashboard-row.cols-2-1 { grid-template-columns: 2fr 1fr; }

/* Chart card */
.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    min-width: 0;
}

.chart-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Staafdiagram */
.bar-chart-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}
.bar-chart-wrap::-webkit-scrollbar { height: 5px; }
.bar-chart-wrap::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.bar-chart {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 150px;
    padding: 0 0 54px;
    position: relative;
}

.bar-chart::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 54px;
    height: 1px;
    background: var(--color-border);
}

.bc-bar {
    flex: 1 1 0;
    min-width: 8px;
    max-width: 40px;
    background: var(--color-primary);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 4px;
    transition: opacity .15s;
}

.bc-bar:hover { opacity: .8; }
.bc-bar:nth-child(3n+2) { background: var(--color-text); opacity: .65; }
.bc-bar:nth-child(3n+3) { background: var(--status-open); opacity: 1; }

.bc-bar span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    transform-origin: top center;
    font-size: .6rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Donut (CSS-only) */
.donut {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    position: relative;
    flex: 0 0 auto;
}

.donut::after {
    content: '';
    position: absolute;
    inset: 20px;
    background: var(--color-surface);
    border-radius: 50%;
}

.donut-status {
    background: conic-gradient(
        var(--status-closed) 0 70%,
        var(--status-open)   70% 82%,
        var(--status-fault)  82% 92%,
        var(--color-text-muted) 92% 100%
    );
}

.donut-priority {
    background: conic-gradient(
        var(--status-fault)   0 18%,
        var(--status-warning) 18% 55%,
        var(--status-open)    55% 100%
    );
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.donut-legend {
    font-size: .85rem;
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--color-text);
}

.donut-legend li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend li strong { flex-shrink: 0; color: var(--color-text); }

.donut-legend li::before {
    content: '';
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--color-text-muted);
    flex: 0 0 auto;
}

.donut-legend li.l-closed::before  { background: var(--status-closed); }
.donut-legend li.l-open::before    { background: var(--status-open); }
.donut-legend li.l-fault::before   { background: var(--status-fault); }
.donut-legend li.l-warn::before    { background: var(--status-warning); }
.donut-legend li.l-unknown::before { background: var(--color-text-muted); }
.donut-legend li.l-p1::before      { background: var(--status-fault); }
.donut-legend li.l-p2::before      { background: var(--status-warning); }
.donut-legend li.l-p3::before      { background: var(--status-open); }

/* Heatmap */
.heatmap {
    display: grid;
    grid-template-columns: 38px repeat(24, 1fr);
    gap: 2px;
    font-size: .62rem;
}

.heatmap-label {
    color: var(--color-text-muted);
    font-weight: 700;
    text-align: right;
    padding-right: 4px;
    align-self: center;
}

.heatmap-cell {
    aspect-ratio: 1;
    background: var(--color-border);
    border-radius: 2px;
}

.h-1 { background: rgba(236,0,0,.15); }
.h-2 { background: rgba(236,0,0,.30); }
.h-3 { background: rgba(236,0,0,.50); }
.h-4 { background: rgba(236,0,0,.70); }
.h-5 { background: rgba(236,0,0,.90); }

/* Top-N lijst */
.top-list { display: flex; flex-direction: column; gap: 6px; }

.top-row {
    display: grid;
    grid-template-columns: 1fr 56px;
    gap: 8px;
    align-items: center;
    font-size: .88rem;
}

.top-row-name  { color: var(--color-text); font-weight: 700; }
.top-row-value { text-align: right; font-weight: 800; color: var(--color-text); }

.top-row-bar {
    grid-column: 1 / -1;
    height: 5px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.top-row-bar > span {
    display: block;
    height: 100%;
    background: var(--color-primary);
}

/* Beschikbaarheidsbalken */
.availability-list { display: flex; flex-direction: column; gap: 8px; }

.availability-row {
    display: grid;
    grid-template-columns: 130px 1fr 54px;
    gap: 8px;
    align-items: center;
    font-size: .85rem;
}

.availability-bar {
    height: 10px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.availability-bar > span { display: block; height: 100%; }
.av-good > span { background: var(--status-closed); }
.av-mid  > span { background: var(--status-warning); }
.av-bad  > span { background: var(--status-fault); }
.av-none > span { background: transparent; }

.availability-value { text-align: right; font-weight: 800; color: var(--color-text); font-size: .85rem; }

/* Lijn-SVG chart */
.line-chart { display: block; width: 100%; max-width: 100%; height: 150px; }
.line-chart .axis  { stroke: var(--color-border); stroke-width: 1; }
.line-chart .grid  { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 3,3; }
.line-chart .series-1 { fill: none; stroke: var(--color-primary); stroke-width: 2; }
.line-chart .series-2 { fill: none; stroke: var(--status-open); stroke-width: 2; stroke-dasharray: 5,4; }
.line-chart .lbl   { fill: var(--color-text-muted); font-size: 10px; font-weight: 700; }

/* Responsive dashboard */
@media (max-width: 960px) {
    .dashboard-row.cols-2,
    .dashboard-row.cols-2-1 { grid-template-columns: 1fr; }
    .dashboard-row.cols-3   { grid-template-columns: 1fr 1fr; }
    .heatmap { grid-template-columns: 28px repeat(24, 1fr); font-size: .52rem; }
    .availability-row { grid-template-columns: 100px 1fr 48px; }
}

@media (max-width: 640px) {
    .dashboard-row.cols-3 { grid-template-columns: 1fr; }
}

/* Dashboard metrics (legacy – behoud voor compatibiliteit) */
.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Foutmelding */
#blazor-error-ui {
    background: var(--color-bg-secondary, #ffebee);
    border-top: 2px solid var(--color-primary);
    color: var(--color-text, #202020);
    display: none;
    left: 0;
    bottom: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}
#blazor-error-ui .reload { text-decoration: underline; cursor: pointer; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* Topbar icon knoppen (thema, uitloggen) */
.btn-topbar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #444;
    background: #2a2a2a;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-topbar-icon:hover {
    background: #3a3a3a;
    border-color: #666;
}

[data-theme="light"] .btn-topbar-icon {
    border-color: #c0c0c0;
    color: #333;
    background: #f0f0f0;
}

[data-theme="light"] .btn-topbar-icon:hover {
    background: #e0e0e0;
    border-color: #999;
}

.topbar-username {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

/* Topbar live-dot */
.topbar-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: dsb-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* Alerts / meldingen */
.alert-p1 { background: #ffebee; border-left: 4px solid var(--status-fault); color: #7b0000; }
.alert-p2 { background: #fff3e0; border-left: 4px solid var(--status-warning); color: #5a2e00; }
.alert-p3 { background: #e8f5e9; border-left: 4px solid var(--status-closed); color: #1b4020; }

[data-theme="dark"] .alert-p1 { background: #2d0000; color: #ffb3b3; border-left-color: #ec0000; }
[data-theme="dark"] .alert-p2 { background: #2d1a00; color: #ffd699; border-left-color: #ff8c00; }
[data-theme="dark"] .alert-p3 { background: #001a08; color: #9ee8b0; border-left-color: #2e7d32; }

/* Toegankelijkheid – focus ring */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

h1:focus-visible, h2:focus-visible, h3:focus-visible,
h4:focus-visible, h5:focus-visible, h6:focus-visible,
p:focus-visible, div:focus-visible, section:focus-visible {
    outline: none;
}

/* Responsive */
@media (max-width: 768px) {
    .topbar .nav-toggle { display: flex; }

    /* sidebar-positie en z-index worden beheerd door het Sidebar + offcanvas blok hieronder */

    .tile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 480px) {
    .metric-value { font-size: 1.5rem; }
    .tile { min-height: 100px; }
}

/* =============================================
   Login pagina
   ============================================= */
.login-outer {
    min-height: 100vh;
    background-color: var(--color-bg-secondary, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #bebebe);
    border-radius: 6px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-dot-lg {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary, #F59E0B);
    margin-bottom: 0.75rem;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text, #202020);
}

.login-subtitle {
    color: var(--color-text-muted, #767676);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

/* =============================================
   Kiosk modus - altijd dark, 1920x1080
   ============================================= */
.kiosk-page {
    background: #111111;
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.kiosk-header {
    background: #1a1a1a;
    border-bottom: 2px solid #F59E0B;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.kiosk-brand {
    color: #F59E0B;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    flex: 0 0 auto;
}
.kiosk-subtitle {
    font-size: 0.9rem;
    color: #aaaaaa;
    flex: 0 0 auto;
}
.kiosk-metrics {
    display: flex;
    gap: 10px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}
.kiosk-metric {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    background: #333;
    white-space: nowrap;
}
.kiosk-metric-value { font-weight: 800; }
.kiosk-metric-label { margin-left: 4px; opacity: .85; text-transform: uppercase; letter-spacing: .03em; }
.kiosk-metric.metric-fault   { background: #c0392b; }
.kiosk-metric.metric-unknown { background: #555; }
.kiosk-metric.metric-total   { background: #333; }
.kiosk-metric.metric-closed  { background: #1a5c38; }
.kiosk-metric.metric-open    { background: #7a4000; }
.kiosk-clock {
    color: #bebebe;
    font-size: .95rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    flex: 0 0 auto;
    margin-left: auto;
}
.kiosk-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 3px;
    padding: 3px;
    background: #0d0d0d;
    align-content: start;
    align-items: stretch;
    flex: 1;
}
.kiosk-tile {
    background: #1c1c1c;
    border: none;
    border-left: 5px solid #444;
    padding: 12px 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    overflow: hidden;
    min-height: 110px;
    height: 110px;
    box-sizing: border-box;
}
.kiosk-tile-header-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow: hidden;
}
.kiosk-tile-icon {
    font-size: 1.1rem;
    line-height: 1.2;
    flex: 0 0 auto;
    opacity: .85;
}
.kiosk-tile-closed  { border-left-color: #27ae60; background: #0d2118; }
.kiosk-tile-open    { border-left-color: #e67e22; background: #1e1200; }
.kiosk-tile-fault   { border-left-color: #e74c3c; background: #1f0808; }
.kiosk-tile-unknown { border-left-color: #555;    background: #1a1a1a; }
.kiosk-tile-closed  .kiosk-tile-status { color: #2ecc71; }
.kiosk-tile-open    .kiosk-tile-status { color: #f39c12; }
.kiosk-tile-fault   .kiosk-tile-status { color: #e74c3c; }
.kiosk-tile-unknown .kiosk-tile-status { color: #888; }
.kiosk-tile.status-offline { opacity: .45; border-left-color: #333; background: #111 !important; }
.kiosk-tile.status-offline .kiosk-tile-status { color: #444; }
.kiosk-offline-cross { display: none; }
.kiosk-tile-name   { font-weight: 700; font-size: 0.88rem; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.kiosk-tile-code   { font-size: 0.72rem; color: #666; }
.kiosk-tile-status { font-size: 0.85rem; font-weight: 700; letter-spacing: .03em; }
.kiosk-tile-meta   { font-size: 0.7rem; color: #777; margin-top: 1px; }
.kiosk-tile-flags  { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.kiosk-flag { font-size: 0.65rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; align-self: flex-start; }
.kiosk-flag-p1     { background: #ec0000; color: white; }
.kiosk-flag-p2     { background: #b84400; color: white; }
.kiosk-flag-water  { background: #0277bd; color: white; }
.kiosk-flag-toolong { background: #7d4e00; color: white; }
.kiosk-flag-safety  { background: #6a006a; color: white; }
.kiosk-tile.src-lorawan::after,
.kiosk-tile.src-wired::after,
.kiosk-tile.src-none::after {
    position: absolute;
    top: 6px; right: 8px;
    font-size: .75rem;
    pointer-events: none;
    z-index: 3;
    line-height: 1;
}
.kiosk-tile.src-lorawan::after { content: "\1F4E1"; }
.kiosk-tile.src-wired::after   { content: "\1F50C"; }
.kiosk-tile.src-none::after    { content: "\1F4CB"; }
.kiosk-tile.src-lorawan.status-offline::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom right, transparent calc(50% - 1.5px), rgba(200,30,30,.65) calc(50% - 1.5px), rgba(200,30,30,.65) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
        linear-gradient(to bottom left,  transparent calc(50% - 1.5px), rgba(200,30,30,.65) calc(50% - 1.5px), rgba(200,30,30,.65) calc(50% + 1.5px), transparent calc(50% + 1.5px));
    pointer-events: none;
    z-index: 2;
}
.kiosk-tile.src-wired.status-offline {
    border-left: 4px dashed rgba(200,30,30,.6) !important;
    opacity: .6;
}
.kiosk-footer {
    background: #141414;
    border-top: 1px solid #2a2a2a;
    padding: 8px 20px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
    color: #555;
    font-size: .72rem;
    flex-shrink: 0;
}

.kiosk-exit-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: max(10px, env(safe-area-inset-right, 0px));
    z-index: 10020;
    min-height: 44px;
    min-width: 72px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(10, 16, 24, 0.86);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0 0.85rem;
}

.kiosk-exit-btn:hover {
    background: rgba(22, 33, 50, 0.95);
    border-color: rgba(255,255,255,0.55);
}


/* Live badge in footer */
.kiosk-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 700;
    color: #2ecc71;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.kiosk-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    animation: kiosk-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes kiosk-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

/* Geen verbinding overlay */
.kiosk-no-connection {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.kiosk-no-connection-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-align: center;
}
.kiosk-no-connection-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .04em;
    margin: 0;
    color: #F59E0B;
}
.kiosk-no-connection-sub {
    font-size: .95rem;
    color: #aaa;
    margin: 0;
}
.kiosk-reconnect-spinner {
    width: 32px; height: 32px;
    border: 3px solid #333;
    border-top-color: #F59E0B;
    border-radius: 50%;
    animation: kiosk-spin 0.9s linear infinite;
}
@keyframes kiosk-spin {
    to { transform: rotate(360deg); }
}

/* P1-metric extra opmaak */
.kiosk-metric.metric-p1 { background: #8b0000; animation: kiosk-pulse-metric 1s ease-in-out infinite; }
@keyframes kiosk-pulse-metric {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

/* =============================================
   LOGIN PAGINA
   ============================================= */

.login-page {
    display: flex;
    min-height: 100vh;
    background: var(--dsb-navy-900, var(--color-bg, #0B1628));
    position: relative;
}

[data-theme="light"] .login-page {
    background: #f7f8fa;
}

/* Ronde thema-toggle knop rechtsboven */
/* Drie iconen rechtsboven op login-pagina */
.login-top-actions {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 100;
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-top-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border, #333);
    background: var(--color-surface, #1e1e1e);
    color: var(--color-text, #f0f0f0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    padding: 0;
}

.login-top-btn:hover {
    background: #F59E0B;
    border-color: #F59E0B;
    color: var(--color-bg, #0B1628);
}

/* Op mobiel is er geen menu-knop op de loginpagina */
.login-menu-btn {
    display: none !important;
}

/* Linkerpaneel – branding */
.login-brand-panel {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    background: linear-gradient(160deg, var(--dsb-navy-800, var(--color-surface, #162035)) 0%, var(--dsb-navy-900, var(--color-bg, #0B1628)) 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}

/* Subtiele achtergrond decoratie */
.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,184,217,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.login-ams-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.login-ams-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.login-ams-logo-text span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
}

[data-theme="light"] .login-ams-logo-text span {
    color: #0e1620;
}

.login-slogans {
    margin-bottom: 3rem;
}

.login-slogan-line {
    display: block;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    letter-spacing: -0.02em;
    color: rgba(255,255,255,0.92);
    line-height: 1.15;
}

/* =====================================================================
   InfoTooltip component
   ===================================================================== */
.info-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: .35rem;
    vertical-align: middle;
}

.info-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1.5px solid var(--color-border, #888);
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted, #aaa);
    font-size: .75rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}

.info-tooltip-btn:hover,
.info-tooltip-btn:focus-visible {
    background: var(--color-accent, #00B8D9);
    color: #fff;
    border-color: var(--color-accent, #00B8D9);
    outline: none;
}

/* Overlay die klikken buiten de tooltip sluit */
.info-tooltip-overlay {
    position: fixed;
    inset: 0;
    z-index: 1199;
    background: transparent;
}

.info-tooltip-box {
    position: fixed;
    z-index: 1200;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: var(--color-card, #1e1e1e);
    border: 1px solid var(--color-border, #555);
    border-radius: 8px;
    padding: .8rem 1rem .85rem;
    box-shadow: 0 6px 24px rgba(0,0,0,.55);
    font-size: .83rem;
    color: var(--color-text, #e8e8e8);
    word-break: break-word;
    line-height: 1.5;
}

[data-theme="light"] .info-tooltip-box {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #202020;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
}

.info-tooltip-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .45rem;
}

.info-tooltip-title {
    font-weight: 700;
    font-size: .87rem;
    color: var(--color-text, #f0f0f0);
    line-height: 1.3;
    flex: 1;
}

[data-theme="light"] .info-tooltip-title { color: #202020; }

.info-tooltip-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: .85rem;
    color: var(--color-text-muted, #aaa);
    cursor: pointer;
    padding: 0 0 0 .25rem;
    line-height: 1;
}

.info-tooltip-close:hover { color: var(--color-accent, #00B8D9); }

.info-tooltip-body {
    color: var(--color-text-muted, #bbb);
    line-height: 1.55;
}

[data-theme="light"] .info-tooltip-body { color: #444; }

.info-tooltip-fakedata {
    margin-top: .55rem;
    padding-top: .5rem;
    border-top: 1px dashed var(--color-border, #555);
    font-size: .79rem;
    color: var(--color-text-muted, #999);
    line-height: 1.45;
}

[data-theme="light"] .info-tooltip-fakedata { color: #666; }

.info-tooltip-fakedata-badge {
    display: inline-block;
    background: rgba(224,168,0,.18);
    color: #d4a000;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .76rem;
    font-weight: 700;
    margin-right: .3rem;
    white-space: nowrap;
}

[data-theme="light"] .info-tooltip-fakedata-badge {
    background: rgba(224,168,0,.12);
    color: #a07800;
}

/* -- Tegelweergave – bediencentrale (dark tile grid) ---------------- */
.tiles-dark {
    background: var(--color-surface, #1a1a1a);
    border-radius: 18px;
    padding: 22px;
    border: 1px solid var(--color-border, rgba(255,255,255,.08));
}

.tiles-dark-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.tiles-dark-header strong {
    color: var(--color-text, #fff);
    font-size: 1.15rem;
}

.tile-dark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.tile-dark {
    background: var(--color-surface-alt, #2a2a2a);
    border: 2px solid var(--color-border, #444);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tile-dark::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
}

.tile-dark.td-closed::before { background: var(--status-closed, #00893c); }
.tile-dark.td-open::before   { background: var(--status-open, #004699); }
.tile-dark.td-fault::before  { background: var(--status-fault, #ec0000); }
.tile-dark.td-warning::before { background: var(--status-warning, #ff9100); }
.tile-dark.td-unknown::before { background: var(--color-border, #555); }

/* sensor-type icon top-right via ::after */
.tile-dark.src-lorawan::after,
.tile-dark.src-wired::after {
    position: absolute;
    top: 6px; right: 8px;
    font-size: .75rem;
    opacity: .55;
    pointer-events: none;
    z-index: 3;
    font-family: sans-serif;
}
.tile-dark.src-lorawan::after { content: '\25BA\FE0E LoRa'; } /* ? LoRa */
.tile-dark.src-wired::after   { content: '\26A1\FE0E 6x';   } /* ? 6x  */
/* src-none: geen icoon */

/* LoRaWAN offline: diagonal red cross */
.tile-dark.src-lorawan.td-offline::before {
    background:
        linear-gradient(to bottom right,
            transparent calc(50% - 1.5px),
            rgba(200,30,30,.65) calc(50% - 1.5px),
            rgba(200,30,30,.65) calc(50% + 1.5px),
            transparent calc(50% + 1.5px)),
        linear-gradient(to bottom left,
            transparent calc(50% - 1.5px),
            rgba(200,30,30,.65) calc(50% - 1.5px),
            rgba(200,30,30,.65) calc(50% + 1.5px),
            transparent calc(50% + 1.5px));
    width: 100%; height: 100%;
}
/* Wired offline: dashed border */
.tile-dark.src-wired.td-offline {
    border: 2px dashed rgba(200,30,30,.6) !important;
    opacity: .65;
}

.tile-dark h4 {
    color: var(--color-text, #fff);
    margin: 0;
    font-size: 1.05rem;
    padding-right: 24px; /* room for sensor icon */
}

.tile-dark .tile-time {
    color: var(--color-text-muted, #9a9a9a);
    font-size: .82rem;
}

.tile-dark-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.btn-mini {
    flex: 1;
    background: transparent;
    border: 1px solid var(--color-border, #555);
    color: var(--color-text, #fff);
    font-size: .82rem;
    font-weight: 700;
    padding: 8px;
    border-radius: 0;
    cursor: pointer;
    min-height: 36px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-mini:hover {
    background: var(--color-surface-alt, rgba(255,255,255,.08));
    color: var(--color-text, #fff);
    text-decoration: none;
}

.btn-mini.btn-fault {
    border-color: var(--status-fault, #ec0000);
    color: var(--status-fault, #ec0000);
}

.btn-mini.btn-fault:hover {
    background: rgba(236,0,0,.12);
}

.pill-dark {
    background: var(--color-surface-alt, #2a2a2a);
    color: var(--color-text, #fff);
    border: 2px solid var(--color-border, #555);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
}

.pill-dark-fault {
    background: var(--color-surface-alt, #2a2a2a);
    color: var(--status-fault, #ec0000);
    border: 2px solid var(--status-fault, #ec0000);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
}

/* -- KPI cards voor ObjectDetail ------------------------------------ */
.kpi-grid-detail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.kpi-card-detail {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 5px solid var(--ams-red);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(32,32,32,.08);
}

.kpi-card-detail.ok   { border-left-color: var(--status-closed, #00893c); }
.kpi-card-detail.warn { border-left-color: var(--status-warning, #ff9100); }
.kpi-card-detail.info { border-left-color: var(--status-open, #004699); }

.kpi-card-label-detail {
    font-size: .75rem;
    color: var(--text-muted, #767676);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kpi-card-value-detail {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary, #202020);
    line-height: 1.1;
    margin: 4px 0 2px;
}

.kpi-card-sub-detail {
    font-size: .78rem;
    color: var(--text-muted, #767676);
    font-weight: 600;
}

/* chart-card header met I knop */
.chart-card h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .2rem;
    margin-bottom: .6rem;
}

/* Voorbeelddata banner op chart-card */
.chart-card-fakedata-banner {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(224,168,0,.18);
    color: #7a5800; /* 4.6:1 op wit */ 
    border: 1px solid rgba(224,168,0,.35);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: .74rem;
    font-weight: 600;
    margin-bottom: .6rem;
}
[data-theme="dark"] .chart-card-fakedata-banner { color: #ffd566; /* 7.1:1 op #1e1e1e */ }

[data-theme="light"] .chart-card-fakedata-banner {
    background: rgba(224,168,0,.09);
    color: #8a6b00;
    border-color: rgba(224,168,0,.3);
}

.login-slogan-line.accent {
    color: #F59E0B;
}

.login-tagline {
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

[data-theme="light"] .login-tagline {
    color: #3f4a5a;
}

/* Live status indicator op login pagina */
.login-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(0,184,217,0.25);
    border-radius: 999px;
    background: rgba(0,184,217,0.06);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.60);
    margin-bottom: 2rem;
}

[data-theme="light"] .login-live-indicator {
    border-color: rgba(22,163,74,0.25);
    background: rgba(22,163,74,0.06);
    color: #3f4a5a;
}

.login-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16A34A;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.20);
    animation: login-pulse-dot 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

.login-live-text {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@keyframes login-pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(22,163,74,0.20); }
    50%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(22,163,74,0.08); }
}

.login-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border, #333);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--color-text-muted, #bbb);
    background: transparent;
    transition: border-color 0.2s;
}
.login-badge:hover { border-color: #F59E0B; }

/* Rechterpaneel – formulier */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    background: var(--color-bg, #181818);
}

.login-form-inner {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.login-form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text, #f0f0f0);
    margin-bottom: 0.25rem;
}

.login-form-subtitle {
    color: var(--color-text-muted, #aaa);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.login-input-group {
    position: relative;
    margin-bottom: 1.1rem;
}

.login-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text, #f0f0f0);
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.login-input-group .form-control {
    padding-right: 3rem;
    background: var(--color-surface, #1e1e1e);
    border: 1.5px solid var(--color-border, #3a3a3a);
    border-radius: 10px;
    color: var(--color-text, #f0f0f0);
    font-size: 0.97rem;
    height: 48px;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.login-input-group .form-control:focus {
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245,158,11,.18);
    outline: none;
}

.login-pw-toggle {
    position: absolute;
    right: 0.6rem;
    bottom: 0.55rem;
    background: none;
    border: none;
    color: var(--color-text-muted, #888);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    line-height: 1;
}
.login-pw-toggle:hover { color: #F59E0B; }

.login-forgot {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--color-text-muted, #aaa);
    text-decoration: underline;
    margin-top: -0.25rem;
    margin-bottom: 1.1rem;
}
.login-forgot:hover { color: #F59E0B; }

/* Login tabs (Inloggen / Kiosk-toegang) */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid rgba(255,255,255,0.10);
}
.login-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--color-text-muted, #aaa);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
    letter-spacing: 0.02em;
}
.login-tab:hover {
    color: #fff;
}
.login-tab.active {
    color: #fff;
    border-bottom-color: #F59E0B;
}

[data-theme="light"] .login-tabs {
    border-bottom-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .login-tab {
    color: #767676;
}
[data-theme="light"] .login-tab:hover {
    color: #202020;
}
[data-theme="light"] .login-tab.active {
    color: #202020;
    border-bottom-color: #F59E0B;
}
/* Login submit button */

.login-submit-btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    background: #F59E0B;
    border: none;
    border-radius: 10px;
    color: var(--color-bg, #0B1628);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}
.login-submit-btn:hover { background: #D97706; }
.login-submit-btn:active { background: #B45309; transform: scale(0.99); }
.login-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.login-footer {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-muted, #666);
}
.login-footer p { margin-bottom: 0.1rem; }
.login-footer a { color: var(--color-text-muted, #888); text-decoration: underline; }
.login-footer a:hover { color: #F59E0B; }

/* -- Mobiele loginpagina: compacte branding + card-formulier -- */
@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
        height: 100dvh;
        min-height: unset;
        overflow: hidden;
        background: var(--color-surface, #111);
    }

    /* Brandingpaneel: slanke strook met gradient naar beneden */
    .login-brand-panel {
        flex: 0 0 auto;
        padding: 2.5rem 1.5rem 3rem;
        border-right: none;
        border-bottom: none;
        background: var(--color-surface, #111);
        position: relative;
    }

    /* Logo kleiner en horizontaal */
    .login-ams-logo {
        margin-bottom: 0.9rem;
        gap: 0.55rem;
    }
    .login-ams-logo svg { width: 20px; height: 60px; }
    .login-ams-logo-text span { font-size: 1rem; }

    /* Slogans compact */
    .login-slogans { margin-bottom: 0; }
    .login-slogan-line { font-size: 1.35rem; line-height: 1.2; letter-spacing: 0.03em; }

    /* Tagline en badges verbergen */
    .login-tagline { display: none; }
    .login-badges  { display: none; }

    /* Formulierpaneel: kaart met ronde bovenhoeken, schuift over branding */
    .login-form-panel {
        flex: 1 1 0;
        min-height: 0;
        padding: 1.75rem 1.5rem 1.25rem;
        overflow-y: auto;
        justify-content: flex-start;
        background: var(--color-bg, #181818);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
        margin-top: -2rem;
        position: relative;
        z-index: 2;
    }

    .login-form-title    { font-size: 1.45rem; margin-bottom: 0.2rem; }
    .login-form-subtitle { margin-bottom: 1.1rem; font-size: 0.88rem; }
    .login-footer        { margin-top: 0.75rem; }
}

@media (max-width: 480px) {
    .login-brand-panel  { padding: 2rem 1.25rem 2.75rem; }
    .login-slogan-line  { font-size: 1.2rem; }
    .login-form-panel   { padding: 1.5rem 1.25rem 1rem; border-radius: 16px 16px 0 0; }
}

/* Light mode aanpassingen voor login */
[data-theme="light"] .login-slogan-line {
    color: #202020;
}
[data-theme="light"] .login-form-title {
    color: #202020;
}
[data-theme="light"] .login-input-group label {
    color: #202020;
}
[data-theme="light"] .login-input-group .form-control {
    background: #fff;
    border-color: #ccc;
    color: #202020;
}
[data-theme="light"] .login-badge {
    border-color: #ccc;
    color: #555;
}
[data-theme="light"] .login-top-btn {
    background: #fff;
    border-color: #ccc;
    color: #202020;
}

/* Login brand panel light mode – logo icon kleur */
[data-theme="light"] .login-brand-panel .brand-logo,
[data-theme="light"] .login-brand-panel svg {
    color: #0e1620;
    filter: none;
}

/* Login form panel light mode – alles donker op wit */
[data-theme="light"] .login-form-panel {
    background: #ffffff;
}

[data-theme="light"] .login-brand-panel {
    background: linear-gradient(160deg, #eef1f5 0%, #f7f8fa 100%);
    border-right-color: #dce2ea;
}

/* Responsive: stacked op mobiel */
@media (max-width: 768px) {
    .login-page { flex-direction: column; }
    .login-brand-panel {
        flex: none;
        padding: 2.5rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--color-border, #2a2a2a);
    }
    .login-form-panel {
        padding: 2.5rem 1.5rem;
    }
    .login-slogans { margin-bottom: 1.5rem; }
}

/* -- Melding formulier (klantoverzicht 4.5) -- */
.report-mock {
    background: var(--bg-surface, #fff);
    border-radius: 18px;
    box-shadow: 0 18px 55px rgba(32,32,32,.14);
    border: 1px solid rgba(32,32,32,.12);
    overflow: hidden;
    max-width: 860px;
    margin: 0 auto;
}

.report-header {
    background: #F59E0B;
    color: var(--color-bg, #0B1628);
    padding: 18px 26px;
}

.report-header h3 { margin: 0; font-size: 1.3rem; }
.report-header p  { margin: 4px 0 0; font-size: .9rem; opacity: .88; }

.report-body {
    padding: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 599px) {
    .report-body { grid-template-columns: 1fr; }
}

.report-body .form-group-ams       { display: flex; flex-direction: column; gap: 6px; }
.report-body .form-group-ams.full  { grid-column: 1 / -1; }
.report-body .form-group-ams label { font-weight: 700; font-size: .92rem; color: var(--text-primary, #202020); }

.form-input-ams {
    border: 2px solid var(--ams-black, #202020);
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 0;
    width: 100%;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #202020);
    min-height: 44px;
}

[data-theme="dark"] .form-input-ams {
    background: var(--input-bg, #2a2a2a);
    border-color: rgba(255,255,255,.25);
}

.form-input-ams:focus {
    outline: 3px solid #F59E0B;
    outline-offset: 1px;
}

.form-select-ams {
    border: 2px solid var(--ams-black, #202020);
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 0;
    width: 100%;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #202020);
    min-height: 44px;
    appearance: auto;
}

[data-theme="dark"] .form-select-ams {
    background: var(--input-bg, #2a2a2a);
    border-color: rgba(255,255,255,.25);
}

.form-textarea-ams {
    border: 2px solid var(--ams-black, #202020);
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 0;
    width: 100%;
    min-height: 140px;
    resize: vertical;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #202020);
}

[data-theme="dark"] .form-textarea-ams {
    background: var(--input-bg, #2a2a2a);
    border-color: rgba(255,255,255,.25);
}

.category-pills    { display: flex; gap: 8px; flex-wrap: wrap; }

.category-pill {
    padding: 8px 14px;
    border: 2px solid var(--ams-black, #202020);
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #202020);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    border-radius: 0;
    min-height: 44px;
}

.category-pill.active {
    background: #202020;
    color: #fff;
    border-color: #202020;
}

[data-theme="dark"] .category-pill {
    border-color: rgba(255,255,255,.25);
    background: transparent;
}

[data-theme="dark"] .category-pill.active {
    background: #444;
    border-color: #888;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface-inset, #f8f8f8);
    border: 2px solid rgba(32,32,32,.12);
    border-radius: 6px;
}

[data-theme="dark"] .switch-row {
    background: var(--bg-surface-inset, #2a2a2a);
    border-color: rgba(255,255,255,.12);
}

.switch-row label { font-weight: 700; color: var(--text-primary); font-size: .95rem; }

.ams-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex: 0 0 auto;
}

.ams-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.ams-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #bebebe;
    border-radius: 28px;
    transition: .2s;
}

.ams-switch-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}

.ams-switch input:checked + .ams-switch-slider { background: #F59E0B; }
.ams-switch input:checked + .ams-switch-slider::before { transform: translateX(24px); }

.priority-hint {
    grid-column: 1 / -1;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: .92rem;
    font-weight: 700;
}

.priority-hint.p1 {
    background: rgba(245,158,11,.12);
    color: #D97706;
    border: 2px solid #F59E0B;
}

.priority-radio-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

.priority-radio {
    flex: 1;
    min-width: 110px;
    border: 2px solid var(--ams-black, #202020);
    padding: 12px;
    cursor: pointer;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #202020);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    min-height: 44px;
    border-radius: 0;
    transition: background .15s, color .15s;
}

.priority-radio small { display: block; font-weight: 600; font-size: .75rem; margin-top: 3px; opacity: .85; }
.priority-radio.active.p1 { background: #ec0000; color: #fff; border-color: #ec0000; }
.priority-radio.active.p2 { background: #ff9100; color: #202020; border-color: #ff9100; } /* #202020 op #ff9100 = 7.8:1 OK */
.priority-radio.active.p3 { background: #004699; color: #fff; border-color: #004699; }
.priority-radio.disabled  { opacity: .4; cursor: not-allowed; pointer-events: none; }

[data-theme="dark"] .priority-radio {
    border-color: rgba(255,255,255,.25);
    background: transparent;
    color: #f0f0f0;
}

.responsible-party-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-surface-inset, #f8f8f8);
    border: 2px solid rgba(32,32,32,.12);
    border-radius: 6px;
    flex-wrap: wrap;
    min-height: 44px;
}

[data-theme="dark"] .responsible-party-box {
    background: var(--bg-surface-inset, #2a2a2a);
    border-color: rgba(255,255,255,.12);
}

.report-footer {
    padding: 0 26px 26px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-report-primary {
    flex: 1;
    min-width: 140px;
    background: #F59E0B;
    color: var(--color-bg, #0B1628);
    border: 0;
    padding: 14px 24px;
    font-weight: 800;
    font-size: 1rem;
    min-height: 48px;
    border-radius: 0;
    cursor: pointer;
}

.btn-report-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-report-secondary {
    flex: 1;
    min-width: 140px;
    background: transparent;
    color: var(--text-primary, #202020);
    border: 2px solid var(--ams-black, #202020);
    padding: 14px 24px;
    font-weight: 700;
    font-size: 1rem;
    min-height: 48px;
    border-radius: 0;
    cursor: pointer;
}

[data-theme="dark"] .btn-report-secondary { border-color: rgba(255,255,255,.4); color: #f0f0f0; }





/* ============================================================
   Beheer toolbar - gedeeld door Tabel, Objectbeheer, Gebruikers,
   Devices, AuditLog, Instellingen, LoRaWAN Mock
   ============================================================ */
.beheer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 16px;
}

.beheer-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

/* -----------------------------------------------------------
   METRO KAART
   ----------------------------------------------------------- */

.metro-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: var(--color-surface);
}

/* -- Toolbar -- */
.metro-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.metro-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.metro-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* -- Body: canvas + sidebar -- */
.metro-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* -- SVG canvas -- */
.metro-canvas-wrapper {
    flex: 1;
    overflow: auto;
    position: relative;
    background: #f0f4f8;
}

[data-theme="dark"] .metro-canvas-wrapper {
    background: #1a1f2e;
}

.metro-svg {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 1200px;
    min-height: 900px;
    cursor: default;
}

.metro-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2rem;
}

.metro-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.1rem;
    color: #e3000b;
    padding: 2rem;
    text-align: center;
}

/* -- Metro lines -- */
.metro-line {
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

/* -- Node labels -- */
.metro-label-bg {
    fill: rgba(255,255,255,0.88);
    stroke: none;
}

[data-theme="dark"] .metro-label-bg {
    fill: rgba(20, 26, 40, 0.88);
}

.metro-label {
    font-family: sans-serif;
    font-size: 12px;
    font-weight: 600;
    fill: #202020;
    pointer-events: none;
}

[data-theme="dark"] .metro-label {
    fill: #e8e8e8;
}

.metro-code {
    font-family: sans-serif;
    font-size: 10px;
    font-weight: 400;
    fill: #555;
    pointer-events: none;
}

[data-theme="dark"] .metro-code {
    fill: #aaa;
}

/* Node hover / selected */
.metro-node circle {
    transition: r 0.15s ease;
}

.metro-node:hover circle:first-of-type {
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.4));
}

/* Area row label (left of each line) */
.metro-area-label {
    font-family: sans-serif;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

/* -- Sidebar -- */
.metro-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--color-border);
    background: var(--color-surface);
    overflow: hidden;
}

.metro-search-box {
    position: relative;
    padding: 10px 12px 0;
    flex-shrink: 0;
}

.metro-search-input {
    width: 100%;
    padding: 7px 32px 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
}

.metro-search-input:focus {
    outline: 2px solid #0092d0;
    outline-offset: -1px;
}

.metro-search-icon {
    position: absolute;
    right: 20px;
    top: 18px;
    font-size: 15px;
    opacity: 0.5;
    pointer-events: none;
}

/* Area colour legend */
.metro-area-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.metro-area-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-text-muted, #767676);
}

.metro-area-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Bridge list */
.metro-bridge-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.metro-bridge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: var(--color-text);
    font-size: 13px;
    transition: background 0.12s;
}

.metro-bridge-item:hover {
    background: var(--color-hover, rgba(0,0,0,0.06));
}

.metro-bridge-item.active {
    background: rgba(0, 146, 208, 0.12);
    font-weight: 600;
}

.metro-bridge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metro-bridge-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metro-bridge-code {
    font-size: 10px;
    color: var(--color-text-muted, #767676);
    flex-shrink: 0;
}

/* -- Detail panel (bottom) -- */
.metro-detail-panel {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 14px 18px;
    min-width: 220px;
    max-width: 320px;
    z-index: 10;
}

.metro-detail-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--color-text-muted, #767676);
}

.metro-detail-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.metro-detail-code {
    font-size: 11px;
    color: var(--color-text-muted, #767676);
    margin-bottom: 6px;
}

.metro-detail-status {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.metro-detail-flag {
    font-size: 12px;
    margin-bottom: 3px;
}

.flag-p1 { color: #ec0000; }
.flag-p2 { color: #f59300; }
.flag-grey { color: #767676; }

.metro-detail-ts {
    font-size: 11px;
    color: var(--color-text-muted, #767676);
    margin-top: 4px;
}

.metro-detail-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: #0092d0;
    text-decoration: none;
}

.metro-detail-link:hover { text-decoration: underline; }

/* -- Responsive: stack on small screens -- */
@media (max-width: 640px) {
    .metro-body {
        flex-direction: column;
    }

    .metro-sidebar {
        width: 100%;
        height: 220px;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    .metro-detail-panel {
        bottom: 230px;
    }
}


.beheer-toolbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.beheer-toolbar-actions > * {
    min-width: 0;
}

.beheer-toolbar-actions .btn {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beheer-toolbar-actions .form-control,
.beheer-toolbar-actions .form-select {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 100%;
}

/* Rode linkerborder op P1-rijen in tabel */
.table-row-fault td:first-child {
    border-left: 3px solid #ec0000;
}

/* Beheer sectie-card - instellingen, categorieen */
.beheer-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.beheer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: .9rem;
}

.beheer-section-body {
    padding: 16px;
}

/* LoRaWAN mock logvenster */
.mock-log {
    background: #111;
    color: #d4f5a0;
    font-family: 'Consolas', monospace;
    font-size: .78rem;
    border-radius: 4px;
    padding: 10px 12px;
    height: 320px;
    overflow-y: auto;
    line-height: 1.5;
}

[data-theme="light"] .mock-log {
    background: #1e2a1a;
    color: #b8f0a0;
}

.mock-log .log-error  { color: #ff6b6b; }
.mock-log .log-ok     { color: #69f0ae; }
.mock-log .log-info   { color: #82cfff; }
.mock-log .log-ts     { color: #888; font-size: .72rem; margin-right: 6px; }

/* AuditLog diff weergave */
.cursor-pointer {
    cursor: pointer;
}

.audit-diff {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .78rem;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 240px;
    overflow-y: auto;
}


/* ============================================================
   Bevestigingsdialoog - permanent verwijderen
   ============================================================ */
.confirm-delete-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1200;
}

.confirm-delete-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1201;
    width: min(480px, 95vw);
    background: var(--color-surface);
    border: 2px solid #F59E0B;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    overflow: hidden;
}

.confirm-delete-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #F59E0B;
    color: var(--color-bg, #0B1628);
}

.confirm-delete-icon { font-size: 1.3rem; line-height: 1; }

.confirm-delete-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
}

.confirm-delete-body { padding: 16px 18px; }

.confirm-delete-desc {
    font-size: .88rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.confirm-delete-impact {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-left: 3px solid #F59E0B;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: .83rem;
}

.confirm-delete-impact strong {
    display: block;
    margin-bottom: 6px;
    font-size: .82rem;
}

.confirm-delete-impact-list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.confirm-delete-type-instruction {
    font-size: .85rem;
    margin-bottom: 6px;
    color: var(--color-text);
}

.confirm-delete-input { font-size: .9rem; }

.confirm-delete-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* AVG Verantwoording - compliance-grid */
.admin-only-notice {
    background: #fff8e1;
    border: 2px solid #ff9100;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: .88rem;
    font-weight: 700;
    color: #7a4800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .admin-only-notice {
    background: rgba(255,145,0,.12);
    border-color: #ff9100;
    color: #ffcc80;
}

.compliance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 768px) {
    .compliance-grid { grid-template-columns: 1fr; }
}

.compliance-card {
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.compliance-header {
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.compliance-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.compliance-header .badge-label {
    margin-left: auto;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compliance-body {
    padding: 18px 22px;
}

.compliance-body p {
    margin: 0 0 12px;
    font-size: .92rem;
    color: var(--color-text-muted);
}

.compliance-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.compliance-list li {
    padding: 8px 0 8px 22px;
    border-top: 1px solid var(--color-border);
    position: relative;
    font-size: .92rem;
    color: var(--color-text);
}

.compliance-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--status-closed);
    font-weight: 800;
}

.compliance-list li a {
    color: var(--color-primary);
    font-weight: 700;
}

/* ===================================================
   E-mail template editor — preview & placeholder grid
   =================================================== */

.et-body-editor {
    font-size: .82rem;
    line-height: 1.5;
    resize: vertical;
}

/* Placeholder invoervelden */
.et-placeholder-grid {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.et-placeholder-row {
    display: grid;
    grid-template-columns: 10rem 1fr;
    align-items: center;
    gap: .5rem;
}

.et-placeholder-label {
    margin-bottom: 0;
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.et-placeholder-label code {
    font-size: .76rem;
    color: var(--text-muted, #6c757d);
    background: var(--bg-surface-inset, rgba(0,0,0,.06));
    padding: 1px 4px;
    border-radius: 3px;
}

[data-theme="dark"] .et-placeholder-label code {
    background: rgba(255,255,255,.08);
    color: #b0b8c1;
}

/* Onderwerp preview balk */
.et-preview-subject {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    padding: .4rem .6rem;
    border-radius: 4px;
    background: var(--bg-surface-inset, rgba(0,0,0,.05));
    font-size: .82rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.et-preview-subject-label {
    font-weight: 700;
    flex-shrink: 0;
    color: var(--text-muted, #6c757d);
    font-size: .76rem;
}

.et-preview-subject-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .et-preview-subject {
    background: rgba(255,255,255,.06);
}

/* HTML preview frame */
.et-preview-frame {
    border: 1px solid var(--border-color, rgba(0,0,0,.12));
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    color: #202020;
    font-family: Arial, Helvetica, sans-serif;
    font-size: .875rem;
    line-height: 1.6;
    min-height: 200px;
    overflow-y: auto;
    max-height: 480px;
}

.et-preview-frame p   { margin: 0 0 .75rem; }
.et-preview-frame a   { color: #F59E0B; }
.et-preview-frame strong { font-weight: 700; }

/* Dark-mode: preview frame blijft altijd wit (echte e-mailklant) */
[data-theme="dark"] .et-preview-frame {
    border-color: rgba(255,255,255,.18);
}

/* ---------------------------------------------------------------
   KIOSK 2-KOLOMS LAYOUT
   --------------------------------------------------------------- */

/* Hoofdbody onder header en boven footer */
.kiosk-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    overflow: hidden;
    gap: 0;
    height: calc(100vh - 64px - 36px); /* 100vh min header min footer */
}

/* Boven: objecttegels scrollbaar */
.kiosk-top {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.kiosk-top::-webkit-scrollbar { width: 6px; }
.kiosk-top::-webkit-scrollbar-track { background: #1a1a1a; }
.kiosk-top::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Onder: statistieken widgets horizontale balk */
.kiosk-bottom {
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.08);
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.kiosk-bottom::-webkit-scrollbar { height: 6px; }
.kiosk-bottom::-webkit-scrollbar-track { background: #1a1a1a; }
.kiosk-bottom::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Widgets in de balk krijgen een vaste minimumbreedte zodat ze niet te smal worden */
.kiosk-bottom .kiosk-stat-widget {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 240px;
}

/* -- Widget container -- */
.kiosk-stat-widget {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.kiosk-widget-header {
    background: rgba(236,0,0,0.12);
    border-bottom: 1px solid rgba(236,0,0,0.2);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 7px 12px;
}

.kiosk-widget-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kiosk-widget-body-center {
    align-items: center;
    text-align: center;
    padding: 16px 12px;
}

/* -- Statistiekenrij -- */
.kiosk-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.kiosk-stat-row:last-child { border-bottom: none; }

.kiosk-stat-row-alert { background: rgba(236,0,0,0.07); border-radius: 4px; padding: 4px 6px; }
.kiosk-stat-row-highlight { background: rgba(255,255,255,0.04); border-radius: 4px; padding: 4px 6px; }

.kiosk-stat-name { flex: 1; color: rgba(255,255,255,0.75); }
.kiosk-stat-name-sm { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kiosk-stat-val { font-weight: 700; font-size: 1rem; color: #fff; min-width: 28px; text-align: right; }
.kiosk-stat-rank { color: rgba(255,255,255,0.4); font-size: 0.75rem; min-width: 16px; }
.kiosk-stat-loading { color: rgba(255,255,255,0.3); font-size: 0.85rem; align-self: center; }
.kiosk-stat-none    { color: rgba(255,255,255,0.35); font-size: 0.82rem; font-style: italic; padding: 6px 0; align-self: center; }

/* Status dots */
.kiosk-stat-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-total   { background: rgba(255,255,255,0.4); }
.dot-closed  { background: #4caf50; }
.dot-open    { background: #2196f3; }
.dot-fault   { background: #ec0000; }
.dot-unknown { background: #9e9e9e; }

/* Prioriteit badges */
.kiosk-stat-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    min-width: 22px;
    text-align: center;
}
.badge-p1 { background: #ec0000; color: #fff; }
.badge-p2 { background: #ff9800; color: #000; }
.badge-p3 { background: #2196f3; color: #fff; }
.badge-fault { background: rgba(236,0,0,0.3); color: #ec0000; }

/* Kleurklassen voor waarden */
.kiosk-val-success { color: #4caf50 !important; }
.kiosk-val-warning { color: #ff9800 !important; }
.kiosk-val-danger  { color: #ec0000 !important; }
.kiosk-val-accent  { color: #2196f3 !important; }

/* -- Grote cijfers (beschikbaarheid, openingsduur) -- */
.kiosk-big-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.kiosk-big-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Beschikbaarheidsbar */
.kiosk-avail-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}
.kiosk-avail-fill {
    height: 100%;
    border-radius: 3px;
    background: #4caf50;
    transition: width 0.8s ease;
}
.kiosk-avail-fill.kiosk-val-warning { background: #ff9800; }
.kiosk-avail-fill.kiosk-val-danger  { background: #ec0000; }

/* -- Widget preview in KioskInstellingen -- */
.kiosk-stats-preview { background: transparent; }
.kiosk-stat-widget-preview {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.kiosk-stat-widget-title { color: #fff; font-size: 0.8rem; font-weight: 600; }
.kiosk-stat-widget-body  { color: rgba(255,255,255,0.45); font-size: 0.72rem; }

/* -- KioskInstellingen widget picker -- */
.kiosk-widget-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
}
.kiosk-widget-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #e8e8e8);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}
.kiosk-widget-item:hover { background: rgba(245,158,11,0.05); border-color: #F59E0B; }
.kiosk-widget-item.active { background: rgba(245,158,11,0.08); border-color: #F59E0B; }
.kiosk-widget-icon { font-size: 1.1rem; min-width: 24px; }
.kiosk-widget-label { font-weight: 600; font-size: 0.88rem; min-width: 140px; }
.kiosk-widget-desc  { flex: 1; font-size: 0.78rem; color: var(--color-text-muted, #767676); }
.kiosk-widget-check { font-weight: 700; color: #F59E0B; min-width: 20px; text-align: right; }

.kiosk-active-list { display: flex; flex-direction: column; gap: 6px; }
.kiosk-active-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--color-border, #e8e8e8);
    border-radius: 6px;
    background: var(--color-surface, #fff);
}
.kiosk-active-order { font-weight: 700; color: #F59E0B; min-width: 20px; text-align: center; }
.kiosk-active-label { flex: 1; font-size: 0.87rem; font-weight: 600; }
.kiosk-active-actions { display: flex; gap: 4px; }

/* Kiosk demo-badge */
.kiosk-demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    background: rgba(255, 165, 0, 0.18);
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 12px;
    color: #ffaa00;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-left: 10px;
    animation: live-pulse 2s ease-in-out infinite;
}


/* =============================================
   MOBILE / PWA – aanvullende responsive regels
   Aanpak: mobile-first verbeteringen die de
   desktop-layout ongewijzigd laten.
   ============================================= */

/* -- Sidebar overlay backdrop (mobiel) -------- */
/* backdrop-stijl wordt beheerd in het Sidebar + offcanvas blok */

/* -- Tabel horizontal scroll wrapper ---------- */
.table-responsive-ams {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior: contain;
    /* Zachte schaduw als visuele hint dat er meer is */
    background:
        linear-gradient(to right, var(--color-bg) 0%, transparent 2rem) left / 2rem 100% no-repeat,
        linear-gradient(to left,  var(--color-bg) 0%, transparent 2rem) right / 2rem 100% no-repeat;
    background-attachment: local, local;
}
.table-responsive-ams table { min-width: 640px; }

/* -- Content-area padding kleiner op mobiel ---
   padding-bottom blijft afkomstig uit de centrale shell-blok (regel ~828),
   die safe-area + ticker-hoogte gecombineerd al goed zet. Hier alleen de
   horizontale padding aanpassen. padding-top MOET 0 blijven omdat de sticky
   .page-header edge-to-edge direct onder de fixed topbar moet zitten. */
@media (max-width: 768px) {
    .content-area {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 0;
    }
}
@media (max-width: 480px) {
    .content-area {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        padding-top: 0;
    }
}

/* -- Beheer-toolbar stapelt op small screens -- */
@media (max-width: 640px) {
    .beheer-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .beheer-toolbar-actions {
        width: 100%;
        align-items: stretch;
    }
    .beheer-toolbar-actions .btn,
    .beheer-toolbar-actions .form-control,
    .beheer-toolbar-actions .form-select {
        width: 100%;
    }
    .map-filter-chips {
        width: 100%;
    }
}

/* -- Dashboard KPI grid ------------------------ */
@media (max-width: 480px) {
    .dashboard-row.cols-2,
    .dashboard-row.cols-2-1,
    .dashboard-row.cols-3 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* -- Touch targets – minimaal 44×44 px ------- */
/* Chip-knoppen en kleine badges */
.map-chip {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
}
/* Topbar icon-knoppen al 36px, toch iets groter op touch */
@media (hover: none) and (pointer: coarse) {
    .btn-topbar-icon {
        width: 44px;
        height: 44px;
    }
    .map-chip {
        min-height: 44px;
    }
    /* Sidebar nav-links al goed, extra zekerheid */
    .sidebar .nav-link {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* -- Nav-toggle zichtbaar op mobiel ------------ */
@media (max-width: 768px) {
    .topbar .nav-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
    }
}

/* -- Tegels grid smaller op klein scherm ------- */
@media (max-width: 480px) {
    .tile-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .tile-dark-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* -- Formuliervelden – minimaal 16px op iOS ---- */
/* Voorkomt automatisch inzoomen van iOS Safari */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    textarea,
    select,
    .form-control,
    .form-select,
    .form-input-ams,
    .form-select-ams,
    .form-textarea-ams {
        font-size: 16px !important;
    }
}

/* -- Heatmap tabel – veilig scrollen op mobiel - */
@media (max-width: 768px) {
    .bo-hm-grid {
        overflow-x: auto;
        overscroll-behavior: contain;
    }
    .heatmap {
        overflow-x: auto;
        overscroll-behavior: contain;
    }
}

/* -- Rapportages / compliance grid ------------- */
@media (max-width: 480px) {
    .report-body        { grid-template-columns: 1fr; }
    .compliance-grid    { grid-template-columns: 1fr; }
    .et-placeholder-row { grid-template-columns: 1fr; }
    .et-placeholder-label { font-weight: 700; }
}

/* -- Brand-text compacter op mobiele schermen -- */
@media (max-width: 768px) {
    .topbar {
        gap: 0.55rem;
        padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    }

    .topbar .brand {
        gap: 0.42rem;
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
    }

    .topbar .brand-logo {
        width: 22px;
        height: 22px;
    }

    .topbar .brand-text {
        font-size: 0.84rem;
    }

    .topbar .btn-topbar-icon,
    .topbar .nav-toggle {
        position: relative;
        z-index: 1600;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .topbar .btn-topbar-icon:not(.nav-toggle-menu) {
        display: none !important;
    }

    .topbar .nav-toggle-menu {
        display: inline-flex !important;
    }
}

@media (max-width: 420px) {
    .topbar .brand {
        max-width: none;
    }

    .topbar .brand-text {
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .topbar .spacer {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar .nav-toggle-menu {
        margin-left: auto;
    }
}


@media (max-width: 360px) {
    .topbar .brand-text { display: none; }
}

/* -- PWA safe-area insets (notch/thuisbalk) ---- */
@supports (padding: env(safe-area-inset-bottom)) {
    .dsb-ticker {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@media (max-width: 768px) {
    .dsb-ticker {
        /* hoogte definitie blijft in eerdere 768px-blok (regel ~891) met safe-area */
    }

    .dsb-ticker-item {
        padding: 0 14px;
        font-size: 0.66rem;
        letter-spacing: 0.03em;
    }

    .dsb-ticker::before,
    .dsb-ticker::after {
        width: 20px;
    }
    /* .content-area padding-bottom wordt centraal beheerd in eerste 768px-blok */
}

@media (max-width: 420px) {
    .dsb-ticker-item {
        padding: 0 10px;
        font-size: 0.62rem;
    }
    /* .content-area padding-bottom wordt centraal beheerd in eerste 420px-blok */
}

/* -- Tabellen mobiel: alle pagina-tabellen zijn al gewrapped in
   .table-responsive (Bootstrap). Een globale display:block reset
   op .table breekt de tabel-rendering, dus die wordt hier NIET
   meer toegepast. Voor tabellen zonder wrapper: voeg ad-hoc
   .table-responsive of .table-responsive-ams toe rond de tabel. */

/* =============================================
   DSB LIVE TICKER – scrollende status balk
   ============================================= */
.dsb-ticker {
    background: rgba(7, 16, 32, 0.98);
    border-top: 1px solid rgba(56,189,248,0.18);
    overflow: hidden;
    height: 42px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    box-shadow: 0 -18px 42px rgba(0,0,0,0.34);
}

[data-theme="light"] .dsb-ticker {
    background: #eef1f5;
    border-top-color: #dce2ea;
    box-shadow: 0 -4px 16px rgba(14,22,32,0.06);
}

.dsb-ticker::before,
.dsb-ticker::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}
.dsb-ticker::before {
    left: 0;
    background: linear-gradient(to right, rgba(10,16,22,1) 0%, transparent 100%);
}
.dsb-ticker::after {
    right: 0;
    background: linear-gradient(to left, rgba(10,16,22,1) 0%, transparent 100%);
}

[data-theme="light"] .dsb-ticker::before { background: linear-gradient(to right, #eef1f5 0%, transparent 100%); }
[data-theme="light"] .dsb-ticker::after  { background: linear-gradient(to left, #eef1f5 0%, transparent 100%); }

.dsb-ticker-track {
    display: flex;
    gap: 0;
    white-space: nowrap;
    will-change: transform;
}

.dsb-ticker-track:hover { /* boTicker pauzeert via mouseenter/mouseleave */ }

.dsb-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 24px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}

[data-theme="light"] .dsb-ticker-item { color: rgba(0,0,0,0.50); }

.dsb-ticker-item::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(56,189,248,0.50);
    flex-shrink: 0;
    align-self: center;
}

.dsb-ticker-item-name {
    color: rgba(255,255,255,0.80);
    font-weight: 700;
}
[data-theme="light"] .dsb-ticker-item-name { color: rgba(0,0,0,0.70); }

.dsb-ticker-item-value {
    color: #38BDF8;
    font-weight: 600;
}

.dsb-ticker-item-label {
    color: rgba(255,255,255,0.40);
    font-weight: 600;
}
[data-theme="light"] .dsb-ticker-item-label { color: rgba(0,0,0,0.40); }

.dsb-ticker-item.tick-fault .dsb-ticker-item-name  { color: #FC8181; }
.dsb-ticker-item.tick-open  .dsb-ticker-item-name  { color: #38BDF8; }
.dsb-ticker-item.tick-closed .dsb-ticker-item-name { color: rgba(255,255,255,0.80); }
.dsb-ticker-item.tick-fault::before  { background: #FC8181; }
.dsb-ticker-item.tick-open::before   { background: #38BDF8; }
.dsb-ticker-item.tick-closed::before { background: #4ADE80; }

/* =============================================
   DSB SENSOR CARDS – compacte sensorwidgets
   ============================================= */
.dsb-sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.dsb-sensor-card {
    background: var(--color-surface, var(--color-surface, #162035));
    border: 1px solid var(--color-border, rgba(245,158,11,0.12));
    border-radius: 8px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.dsb-sensor-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.dsb-sensor-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245,158,11,0.10);
    border: 1px solid rgba(245,158,11,0.20);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #F59E0B;
    margin-bottom: 10px;
}

.dsb-sensor-tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: dsb-sensor-dot-pulse 2s ease-in-out infinite;
}

@keyframes dsb-sensor-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.dsb-sensor-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text, rgba(255,255,255,0.92));
    line-height: 1;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    letter-spacing: -0.03em;
}

.dsb-sensor-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #F59E0B;
    margin-left: 2px;
}

.dsb-sensor-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, rgba(255,255,255,0.45));
    margin-top: 4px;
}

.dsb-sensor-label-sep {
    margin: 0 4px;
    opacity: 0.4;
}

/* =============================================
   DSB HEARTBEAT – kleine sparkline-achtige lijn
   ============================================= */
.dsb-heartbeat {
    width: 100%;
    height: 32px;
    overflow: hidden;
    position: relative;
}

.dsb-heartbeat svg {
    width: 200%;
    height: 100%;
    animation: dsb-heartbeat-scroll 4s linear infinite;
}

@keyframes dsb-heartbeat-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.dsb-heartbeat-line {
    fill: none;
    stroke: #F59E0B;
    stroke-width: 1.5;
    opacity: 0.7;
}

/* =============================================
   DSB HERO GLOW – radiale oranje gloed
   ============================================= */
.dsb-hero-glow {
    pointer-events: none;
    position: absolute;
    width: 800px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(245,158,11,0.12) 0%,
        rgba(245,158,11,0.04) 40%,
        transparent 70%);
    transform: translate(-50%, -50%);
    left: 70%;
    top: 50%;
    filter: blur(40px);
    z-index: 0;
}

/* Dashboard hero strip */
.dsb-hero-strip {
    background: linear-gradient(135deg, var(--color-bg, #0B1628) 0%, var(--color-surface, #162035) 60%, var(--color-bg, #0B1628) 100%);
    border-bottom: 1px solid rgba(245,158,11,0.12);
    padding: 24px 28px 20px;
    position: relative;
    overflow: hidden;
    margin: -1.5rem -1.5rem 1.5rem;
}

[data-theme="light"] .dsb-hero-strip {
    background: linear-gradient(135deg, #fefefe 0%, #fffbf2 60%, #fefefe 100%);
    border-bottom-color: rgba(245,158,11,0.20);
}

.dsb-hero-strip-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    color: rgba(255,255,255,0.95);
    letter-spacing: -0.02em;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

[data-theme="light"] .dsb-hero-strip-title { color: var(--color-bg, #0B1628); }

.dsb-hero-strip-sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.50);
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

[data-theme="light"] .dsb-hero-strip-sub { color: rgba(0,0,0,0.50); }

.dsb-hero-strip-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 999px;
    padding: 3px 10px 3px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #F59E0B;
    position: relative;
    z-index: 1;
}

.dsb-hero-strip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.20);
    animation: login-pulse-dot 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

/* Dashboard hero volgens De Slimme Brug homepage */
.dsb-dashboard-hero {
    width: min(1180px, calc(100vw - 2rem));
    min-height: clamp(600px, calc(100vh - 104px), 760px);
    margin: 0 auto;
    padding: clamp(4rem, 9vh, 7rem) 0 clamp(2.5rem, 6vh, 5rem);
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(480px, 1.05fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    position: relative;
    isolation: isolate;
}

.dsb-dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 8% -8% 2% 42%;
    background: radial-gradient(circle at 48% 44%, rgba(245, 158, 11, 0.24), transparent 17rem);
    filter: blur(18px);
    z-index: -1;
}

.dsb-hero-copy { max-width: 560px; }

.dsb-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.48rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    background: rgba(255,255,255,0.035);
    box-shadow: inset 0 0 0 1px rgba(245,158,11,0.05), 0 12px 28px rgba(0,0,0,0.22);
    color: rgba(255,255,255,0.78);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

[data-theme="light"] .dsb-live-pill {
    background: rgba(245,158,11,0.10);
    border-color: rgba(245,158,11,0.30);
    color: #92400e;
    box-shadow: 0 4px 12px rgba(245,158,11,0.10);
}

.dsb-hero-copy h1 {
    margin: 1.2rem 0;
    color: #ffffff;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: clamp(3.4rem, 6vw, 5.35rem);
    line-height: 0.96;
    font-weight: 800;
    letter-spacing: -0.07em;
}

[data-theme="light"] .dsb-hero-copy h1 {
    color: #0e1620;
}

.dsb-hero-copy h1 span {
    color: #c9f8ff;
    text-shadow: 0 0 24px rgba(0,184,217,0.12);
}

[data-theme="light"] .dsb-hero-copy h1 span {
    color: #d97706;
    text-shadow: 0 0 24px rgba(245,158,11,0.20);
}

.dsb-hero-copy p {
    margin: 0;
    color: rgba(255,255,255,0.72);
    font-size: clamp(1.05rem, 1.55vw, 1.32rem);
    line-height: 1.5;
    font-weight: 600;
}

[data-theme="light"] .dsb-hero-copy p {
    color: #3f4a5a;
}

.dsb-hero-greeting {
    margin-top: 0.8rem;
    color: rgba(255,255,255,0.48);
    font-size: 0.9rem;
}

[data-theme="light"] .dsb-hero-greeting {
    color: #7b8898;
}

.dsb-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.dsb-hero-actions .btn {
    min-height: 50px;
    padding-inline: 1.2rem;
    border-radius: 0.35rem;
    font-size: 0.92rem;
    font-weight: 800;
}

.dsb-hero-actions .btn-primary {
    background: linear-gradient(180deg, #f59e0b, #dc7f25);
    border: 0;
    color: #1d1207;
    box-shadow: 0 14px 30px rgba(220,127,37,0.20);
}

.dsb-hero-actions .btn-outline-light {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.16);
    color: #ffffff;
}

[data-theme="light"] .dsb-hero-actions .btn-outline-light {
    background: transparent;
    border-color: rgba(14,22,32,0.25);
    color: #0e1620;
}

[data-theme="light"] .dsb-hero-actions .btn-outline-light:hover {
    background: rgba(14,22,32,0.06);
    border-color: rgba(14,22,32,0.40);
}

.dsb-hero-metrics {
    margin-top: 2.25rem;
    padding-top: 1.55rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}

[data-theme="light"] .dsb-hero-metrics {
    border-top-color: rgba(14,22,32,0.10);
}

.dsb-hero-metrics strong {
    display: block;
    color: #ffffff;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

[data-theme="light"] .dsb-hero-metrics strong {
    color: #0e1620;
}

.dsb-hero-metrics strong em {
    color: #f59e0b;
    font-size: 0.72em;
    font-style: normal;
}

.dsb-hero-metrics span {
    display: block;
    margin-top: 0.55rem;
    color: rgba(255,255,255,0.48);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

[data-theme="light"] .dsb-hero-metrics span {
    color: #7b8898;
}

.dsb-bridge-visual {
    min-height: 520px;
    position: relative;
}

.dsb-bridge-panel {
    width: min(430px, 82%);
    margin: 0 auto;
    padding: 0.85rem 1rem 0.65rem;
    border: 1px solid rgba(59,130,246,0.26);
    border-radius: 0.65rem;
    background: linear-gradient(180deg, rgba(20,25,34,0.96), rgba(18,22,30,0.94));
    box-shadow: 0 22px 60px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.82);
    position: relative;
    z-index: 3;
}

.dsb-panel-topline,
.dsb-panel-grid small,
.dsb-panel-grid span {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.dsb-panel-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255,255,255,0.42);
    font-size: 0.62rem;
    font-weight: 800;
}

.dsb-panel-status { color: #ffffff; }

.dsb-panel-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.dsb-panel-grid > div + div { border-left: 1px solid rgba(255,255,255,0.08); padding-left: 0.9rem; }
.dsb-panel-grid small { display: block; color: rgba(255,255,255,0.36); font-size: 0.58rem; font-weight: 800; }
.dsb-panel-grid strong { display: block; margin-top: 0.25rem; color: #ffffff; font-size: 1.45rem; line-height: 1; font-family: var(--font-mono, 'JetBrains Mono', monospace); }
.dsb-panel-grid span { display: block; margin-top: 0.35rem; color: rgba(255,255,255,0.34); font-size: 0.55rem; font-weight: 800; }

.dsb-heartline { width: 100%; height: 52px; margin-top: 0.4rem; }
.dsb-heartline path { fill: none; stroke: var(--color-primary); stroke-width: 2.2; stroke-linejoin: round; stroke-lin

.dsb-bridge-stage {
    position: absolute;
    inset: 140px 0 0;
    border-bottom: 1px solid rgba(245,158,11,0.10);
    background: radial-gradient(circle at 50% 8%, rgba(245,158,11,0.22), transparent 12rem), linear-gradient(90deg, transparent 49.8%, rgba(245,158,11,0.12) 50%, transparent 50.2%);
}

.dsb-bridge-road {
    position: absolute;
    left: 8%; right: 8%; top: 58%;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.65), #ffffff, rgba(255,255,255,0.65));
    box-shadow: 0 0 14px rgba(255,255,255,0.15);
}

.dsb-bridge-pier {
    position: absolute;
    top: 47%;
    width: 28px;
    height: 62px;
    border-top: 8px solid #ffffff;
    border-bottom: 10px solid rgba(255,255,255,0.72);
    background: linear-gradient(90deg, rgba(255,255,255,0.78), #ffffff, rgba(255,255,255,0.78));
}

.dsb-bridge-pier.left { left: 26%; }
.dsb-bridge-pier.right { right: 26%; }

.dsb-bridge-leaf {
    position: absolute;
    top: 45%;
    width: 8px;
    height: 138px;
    background: linear-gradient(180deg, #ffffff, #d5d7da);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.26), 0 0 16px rgba(255,255,255,0.16);
    transform-origin: 50% 0;
}

.dsb-bridge-leaf.left { left: 40%; transform: rotate(32deg); }
.dsb-bridge-leaf.right { right: 40%; transform: rotate(-32deg); }

.dsb-bridge-stage .dsb-sensor-card {
    position: absolute;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.7rem;
    border-radius: 0.42rem;
    border: 1px solid rgba(245,158,11,0.48);
    background: rgba(86, 52, 8, 0.70);
    color: rgba(255,255,255,0.86);
    box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 0 18px rgba(245,158,11,0.11);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.dsb-bridge-stage .dsb-sensor-card::before {
    width: 7px;
    height: 7px;
    inset: auto;
    position: static;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 8px #f59e0b;
}

.dsb-sensor-a { left: 7%; top: 30%; }
.dsb-sensor-b { right: 3%; top: 30%; }
.dsb-sensor-c { left: 12%; bottom: 19%; }
.dsb-sensor-d { right: 10%; bottom: 19%; }

@media (max-width: 1100px) {
    .dsb-dashboard-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 3rem; }
    .dsb-bridge-visual { min-height: 500px; }
}

@media (max-width: 700px) {
    .dsb-dashboard-hero { width: min(100% - 1rem, 1180px); padding-top: 2rem; }
    .dsb-hero-copy h1 { font-size: clamp(2.8rem, 14vw, 4rem); }
    .dsb-hero-metrics { grid-template-columns: 1fr; }
    .dsb-bridge-panel { width: 100%; }
    .dsb-panel-grid { grid-template-columns: 1fr; }
    .dsb-panel-grid > div + div { border-left: 0; border-top: 1px solid rgba(255,255,255,0.08); padding-left: 0; padding-top: 0.7rem; }
    .dsb-bridge-stage { display: none; }
    .dsb-bridge-visual { min-height: auto; }
}

/* ============================================================
   LIGHT MODE – GLOBALE OVERRIDES
   Alle hardcoded donkere kleuren correcties voor light thema.
   ============================================================ */

/* -- Body -- */
[data-theme="light"] body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* -- Bootstrap component resets voor light mode -- */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="datetime-local"] {
    background-color: #ffffff;
    color: #0e1620;
    border-color: #dce2ea;
    color-scheme: light;
}

[data-theme="light"] .form-control::placeholder { color: #b5bfcc; }
[data-theme="light"] .form-label,
[data-theme="light"] label { color: #0e1620; }
[data-theme="light"] .form-check-label { color: #0e1620; }
[data-theme="light"] .form-text { color: #7b8898; }

[data-theme="light"] .input-group-text {
    background-color: #eef1f5;
    border-color: #dce2ea;
    color: #0e1620;
}

/* -- Bootstrap nav-tabs -- */
[data-theme="light"] .nav-tabs {
    border-color: #dce2ea;
}
[data-theme="light"] .nav-tabs .nav-link {
    color: #7b8898;
    border-color: transparent;
}
[data-theme="light"] .nav-tabs .nav-link:hover {
    color: #0e1620;
    border-color: #dce2ea;
}
[data-theme="light"] .nav-tabs .nav-link.active {
    background-color: #ffffff;
    border-color: #dce2ea #dce2ea #ffffff;
    color: #0e1620;
}

/* -- Dropdowns -- */
[data-theme="light"] .dropdown-menu {
    background-color: #ffffff;
    border-color: #dce2ea;
    box-shadow: 0 4px 16px rgba(14,22,32,0.10);
}
[data-theme="light"] .dropdown-item {
    color: #0e1620;
}
[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item:focus {
    background-color: #eef1f5;
    color: #0e1620;
}
[data-theme="light"] .dropdown-divider {
    border-color: #dce2ea;
}

/* -- Modals -- */
[data-theme="light"] .modal-content {
    background-color: #ffffff;
    border-color: #dce2ea;
    color: #0e1620;
}
[data-theme="light"] .modal-header {
    border-color: #dce2ea;
    background-color: #f7f8fa;
}
[data-theme="light"] .modal-footer {
    border-color: #dce2ea;
    background-color: #f7f8fa;
}

/* -- Offcanvas -- */
[data-theme="light"] .offcanvas {
    background-color: #ffffff;
    color: #0e1620;
}
[data-theme="light"] .offcanvas-header {
    border-bottom-color: #dce2ea;
}

/* -- Cards -- */
[data-theme="light"] .card {
    background-color: #ffffff !important;
    border-color: #dce2ea !important;
    color: #0e1620;
}
[data-theme="light"] .card-header {
    background-color: #f7f8fa !important;
    border-color: #dce2ea !important;
    color: #0e1620;
}
[data-theme="light"] .card-footer {
    background-color: #f7f8fa !important;
    border-color: #dce2ea !important;
}

/* -- Tabellen -- */
[data-theme="light"] .table {
    color: #0e1620;
    --bs-table-bg: #ffffff;
    --bs-table-border-color: #dce2ea;
    --bs-table-striped-bg: #f7f8fa;
    --bs-table-hover-bg: #eef1f5;
    --bs-table-color: #0e1620;
}
[data-theme="light"] .table thead th {
    background-color: #eef1f5 !important;
    color: #0e1620 !important;
    border-color: #dce2ea !important;
}
[data-theme="light"] .table td,
[data-theme="light"] .table th {
    border-color: #dce2ea;
}

/* -- List groups -- */
[data-theme="light"] .list-group-item {
    background-color: #ffffff;
    border-color: #dce2ea;
    color: #0e1620;
}
[data-theme="light"] .list-group-item:hover,
[data-theme="light"] .list-group-item-action:hover {
    background-color: #eef1f5;
    color: #0e1620;
}
[data-theme="light"] .list-group-item.active {
    background-color: #F59E0B;
    border-color: #F59E0B;
    color: #1d1207;
}

/* -- Pagination -- */
[data-theme="light"] .page-link {
    background-color: #ffffff;
    border-color: #dce2ea;
    color: #0e1620;
}
[data-theme="light"] .page-link:hover {
    background-color: #eef1f5;
    color: #0e1620;
}
[data-theme="light"] .page-item.disabled .page-link {
    background-color: #f7f8fa;
    border-color: #dce2ea;
    color: #b5bfcc;
}
[data-theme="light"] .page-item.active .page-link {
    background-color: #F59E0B;
    border-color: #F59E0B;
    color: #1d1207;
}

/* -- Alerts -- */
[data-theme="light"] .alert-dark {
    background-color: #eef1f5;
    border-color: #dce2ea;
    color: #0e1620;
}

/* -- Badges -- */
[data-theme="light"] .badge.bg-dark,
[data-theme="light"] .badge.text-bg-dark {
    background-color: #3f4a5a !important;
    color: #ffffff !important;
}
[data-theme="light"] .badge.bg-secondary,
[data-theme="light"] .badge.text-bg-secondary {
    background-color: #7b8898 !important;
    color: #ffffff !important;
}

/* -- Toasts -- */
[data-theme="light"] .toast {
    background-color: #ffffff;
    border-color: #dce2ea;
    color: #0e1620;
}
[data-theme="light"] .toast-header {
    background-color: #f7f8fa;
    border-color: #dce2ea;
    color: #0e1620;
}

/* -- Accordion -- */
[data-theme="light"] .accordion-item {
    background-color: #ffffff;
    border-color: #dce2ea;
}
[data-theme="light"] .accordion-button {
    background-color: #f7f8fa;
    color: #0e1620;
}
[data-theme="light"] .accordion-button:not(.collapsed) {
    background-color: #eef1f5;
    color: #0e1620;
}
[data-theme="light"] .accordion-body {
    background-color: #ffffff;
    color: #0e1620;
}

/* -- Page headers -- */
[data-theme="light"] .page-header,
[data-theme="light"] .beheer-header {
    color: #0e1620;
}
[data-theme="light"] .beheer-header h1,
[data-theme="light"] .beheer-header p {
    color: #0e1620;
}

/* -- Text utilities -- */
[data-theme="light"] .text-muted,
[data-theme="light"] .text-secondary {
    color: #7b8898 !important;
}
[data-theme="light"] .text-dark { color: #0e1620 !important; }
[data-theme="light"] small, [data-theme="light"] .small { color: inherit; }
[data-theme="light"] hr { border-color: #dce2ea; opacity: 1; }

/* -- Sidebar nav-legend -- */
[data-theme="light"] .nav-role-legend {
    border-top-color: rgba(14,22,32,0.10);
}

/* -- Sidebar in light mode (al donker, hoeft niet) -- */
/* Sidebar blijft altijd donker (navy), topbar ook — dat is opzettelijk */

/* -- Hoofdinhoud headings -- */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #0e1620;
}

/* -- Hover voor clickable tr -- */
[data-theme="light"] .tr-clickable:hover td {
    background-color: #eef1f5;
}

/* -- Category pills in light mode -- */
[data-theme="light"] .category-pill.active {
    background: #0e1620;
    color: #ffffff;
    border-color: #0e1620;
}

/* -- Compliance cards – de header heeft gekleurde achtergrond, wit is ok -- */
/* (geen aanpassing nodig voor compliance-header) */

/* -- Dashboard ticker in light mode -- */
[data-theme="light"] .dsb-ticker {
    background: #eef1f5;
    border-top-color: #dce2ea;
}

/* -- Dashboard live-pill fix (al gedaan in hero sectie) -- */

/* -- Topbar action buttons -- */
[data-theme="light"] .topbar-btn {
    background: rgba(14,22,32,0.06);
    border-color: rgba(14,22,32,0.15);
    color: #ffffff; /* topbar is altijd donker navy */
}

/* -- Scrollbar in light mode -- */
[data-theme="light"] ::-webkit-scrollbar-track { background: #eef1f5; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b5bfcc; border-color: #eef1f5; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #7b8898; }

/* -- Dashboard actiebalk -- */
.dashboard-action-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.dashboard-greeting {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

[data-theme="light"] .dashboard-action-bar {
    background: #ffffff;
    border-bottom-color: #dce2ea;
}

/* ============================================================
   PageHeader - herbruikbare paginatitelbalk
   Responsieve layout voorkomt overlap tussen titel, acties en filters.
   ============================================================ */
.page-header {
    background: transparent;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
    position: sticky;
    top: 0;
    z-index: 200;
    /* Compenseer de horizontale padding van .content-area zodat de header
       altijd edge-to-edge loopt, ongeacht de outer container-padding. */
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
}

.page-header-main {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr) auto auto;
    align-items: center;
    column-gap: 0.85rem;
    min-height: 62px;
    padding: 0.65rem 1.5rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 96%, var(--color-bg)), var(--color-surface));
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 68%, transparent);
}

.page-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary);
}

.page-header-icon svg {
    display: block;
    width: 15px;
    height: 15px;
}

.page-header-title-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.page-header-subtitle {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.page-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-self: end;
}

.page-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
    justify-self: end;
}

.page-header-actions .btn,
.page-header-actions .filter-chip {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header-actions .form-control,
.page-header-actions .form-select {
    flex: 1 1 10rem;
    min-width: 8rem;
    max-width: 16rem;
}

.page-header-filterbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    row-gap: 0.45rem;
    padding: 0.55rem 1.5rem 0.7rem;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
    background: color-mix(in srgb, var(--color-bg) 74%, var(--color-surface));
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-height: 0;
    overflow: visible;
}

.page-header-filterbar strong {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    margin-right: 0.1rem;
}

/* Live badge */
.page-header-live {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.8;
}

.page-header-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: page-header-pulse 1.8s ease-in-out infinite;
}

@keyframes page-header-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* Teller pill */
.page-header-count {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-border);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    line-height: 1.8;
}

/* Light mode */
[data-theme="light"] .page-header {
    background: transparent;
    border-bottom-color: #dce2ea;
}

[data-theme="light"] .page-header-main {
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    border-bottom-color: #dce2ea;
}

[data-theme="light"] .page-header-filterbar {
    background: #f4f6f9;
    border-top-color: #dce2ea;
}

[data-theme="light"] .page-header-icon {
    background: color-mix(in srgb, var(--color-primary) 10%, #fff);
}

[data-theme="light"] .page-header-title  { color: #0e1620; }
[data-theme="light"] .page-header-subtitle { color: #4a5568; }

/* Responsive */
@media (max-width: 1100px) {
    .page-header-main {
        grid-template-columns: auto minmax(0, 1fr) auto;
        row-gap: 0.55rem;
    }

    .page-header-title-group {
        min-width: 0;
    }

    .page-header-badge {
        justify-self: end;
    }

    .page-header-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
        justify-self: stretch;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-header-main {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 0.55rem 0.85rem;
        gap: 0.5rem;
    }

    .page-header-badge {
        grid-column: 2;
        justify-self: start;
    }

    .page-header-actions {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.4rem 0.45rem;
    }

    .page-header-actions > .btn,
    .page-header-actions > .filter-chip {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        max-width: 100%;
    }

    .page-header-filterbar {
        align-items: flex-start;
        padding: 0.6rem 0.85rem 0.75rem;
        gap: 0.45rem;
    }

    .page-header-filterbar strong {
        flex-basis: 100%;
        margin-top: 0.25rem;
    }

    .page-header-title { font-size: 0.88rem; }
    .page-header-icon  { width: 26px; height: 26px; }

    .page-header-actions .btn,
    .filter-chip {
        min-height: 38px;
    }
}

@media (max-width: 420px) {
    /* Knoppen krijgen natuurlijke breedte, wrappen netjes, niet meer volledig breed. */
    .page-header-actions {
        gap: 0.35rem 0.4rem;
    }

    .page-header-actions > .btn,
    .page-header-actions > .filter-chip {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
    }
}

.filter-collapse-toggle {
    display: none !important;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
    background: color-mix(in srgb, var(--color-surface) 88%, transparent);
    color: var(--color-text);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
}

.dashboard-filter-content {
    display: contents;
}

.dashboard-filter-shell {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) auto;
    align-items: center;
    gap: 0.75rem 1rem;
    width: 100%;
}

.dashboard-filter-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    min-width: 0;
}

.dashboard-filter-kicker {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-filter-current {
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-filter-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(9rem, 1fr)) auto;
    align-items: end;
    gap: 0.85rem;
    width: 100%;
}

.dashboard-filter-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.dashboard-filter-field span {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-left: 0.1rem;
}

.dashboard-filter-field .form-select {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
    background-color: color-mix(in srgb, var(--color-surface) 88%, var(--color-bg));
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.dashboard-filter-field .form-select:hover {
    border-color: color-mix(in srgb, var(--color-border) 100%, transparent);
    background-color: color-mix(in srgb, var(--color-surface) 96%, var(--color-bg));
}

.dashboard-filter-field .form-select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--color-primary) 70%, var(--color-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.dashboard-filter-reset {
    min-height: 38px;
    align-self: end;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.95rem;
    border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
    background-color: color-mix(in srgb, var(--color-surface) 88%, var(--color-bg));
    color: var(--color-text-muted);
    transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.dashboard-filter-reset:hover,
.dashboard-filter-reset:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
    color: var(--color-text);
    background-color: color-mix(in srgb, var(--color-surface) 96%, var(--color-bg));
    outline: none;
}

[data-theme="light"] .dashboard-filter-field .form-select,
[data-theme="light"] .dashboard-filter-reset {
    background-color: #ffffff;
    border-color: #d4dbe6;
    color: #1f2937;
}

[data-theme="light"] .dashboard-filter-reset {
    color: #4a5568;
}

[data-theme="light"] .dashboard-filter-reset:hover,
[data-theme="light"] .dashboard-filter-reset:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 55%, #d4dbe6);
    color: #0e1620;
}

@media (max-width: 768px) {
    .filter-collapse-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 0.75rem;
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
        background: color-mix(in srgb, var(--color-surface) 88%, transparent);
        color: var(--color-text);
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        margin-bottom: 0.2rem;
        cursor: pointer;
    }

    .dashboard-filter-content {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        gap: 0.6rem 0.65rem;
        width: 100%;
    }

    .dashboard-filter-shell {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .dashboard-filter-summary {
        align-self: center;
    }

    .dashboard-filter-current {
        white-space: normal;
    }

    .dashboard-filter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem 0.65rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .dashboard-filter-field {
        min-width: 0;
    }

    .dashboard-filter-field .form-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Reset altijd op eigen rij, volledige breedte — niet meer ingedrukt naast laatste select. */
    .dashboard-filter-reset {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin-top: 0.15rem !important;
    }

    .dashboard-filter-content .filter-group {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.45rem;
        width: 100%;
    }

    .dashboard-filter-content .filter-group strong {
        margin: 0;
        padding-right: 0.2rem;
        flex: 0 0 auto;
    }

    .dashboard-filter-content .filter-chip {
        flex: 0 1 auto;
        width: auto;
    }

    .dashboard-filter-content.is-collapsed {
        display: none;
    }

    .dashboard-filter-reset {
        width: 100%;
    }

    .page-header-actions > * {
        min-width: 0;
    }

    /* Tap-target hoogte; geen full-width meer afdwingen */
    .page-header-actions .btn,
    .page-header-actions .filter-chip {
        min-height: 40px;
    }

    .page-header-actions .form-control,
    .page-header-actions .form-select {
        flex: 1 1 10rem;
        min-width: 8rem;
        max-width: 100%;
    }

    .table-responsive {
        overflow-x: auto;
        overscroll-behavior: contain;
    }

    .table-responsive table {
        min-width: 640px;
    }

    .map-container {
        /* Mobiel: volledige beschikbare hoogte binnen .map-wrapper (flex chain).
           Geen dvh-rekensom hier — die conflicteerde met de globale .map-container
           regel en negeerde PageHeader + ticker. */
        min-height: 240px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .leaflet-top,
    .leaflet-bottom,
    .leaflet-control {
        z-index: 100 !important;
    }

    .map-legend-overlay {
        left: 10px;
        right: 10px;
        bottom: 12px;
        min-width: 0;
        max-width: none;
    }

    .tile-panel {
        right: 0;
        max-width: min(92vw, 320px);
    }
}

@media (max-width: 768px) {
    .page-header-actions {
        gap: 0.35rem;
    }

    .page-header-actions .dashboard-top-action {
        min-height: 34px !important;
        height: 34px !important;
        padding: 0 0.5rem !important;
        font-size: 0.74rem !important;
    }

    .page-header-live {
        min-width: 62px !important;
        height: 34px !important;
        padding: 0 0.6rem !important;
        font-size: 0.72rem !important;
    }
}

@media (max-width: 420px) {
    .dashboard-filter-content .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .dashboard-filter-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-toggle {
        width: 100%;
    }

    .dashboard-filter-fields {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-content .filter-group strong {
        width: 100%;
        margin-bottom: 0.1rem;
    }

    .dashboard-filter-content .filter-chip {
        width: 100%;
    }
}

.object-form-offcanvas {
    width: min(420px, 100vw);
}

@media (max-width: 768px) {
    .object-form-offcanvas {
        width: min(420px, 100vw);
    }
}

/* ---------------------------------------------------------------------------
 * Description-cel in tabellen (o.a. ObjectDetail meldingen).
 * Op desktop ruim, op mobiel ellipsis met tooltip (title-attribute).
 * ------------------------------------------------------------------------- */
.description-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .description-cell {
        max-width: 180px;
    }
}

/* ---------------------------------------------------------------------------
 * ApexCharts thema-fix: voorkom witte achtergrond in dark mode.
 * ApexCharts injecteert inline background op .apexcharts-canvas en de svg;
 * dit overschrijft die met transparant zodat de card-achtergrond zichtbaar blijft.
 * --------------------------------------------------------------------------- */
.apexcharts-canvas,
.apexcharts-canvas svg,
.apexcharts-inner {
    background: transparent !important;
}

[data-theme="dark"] .chart-card {
    background: var(--color-surface) !important;
}

[data-theme="dark"] .apexcharts-canvas,
[data-theme="dark"] .apexcharts-canvas svg {
    background: transparent !important;
}

/* ApexCharts tooltip in dark mode */
[data-theme="dark"] .apexcharts-tooltip {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}
[data-theme="dark"] .apexcharts-tooltip-title {
    background: color-mix(in srgb, var(--color-surface) 80%, var(--color-bg)) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

/* ---------------------------------------------------------------------------
 * Standaard breakpoints (voor toekomstige consolidatie).
 * Huidige media queries gebruiken nog meerdere waarden; nieuwe styles zouden
 * deze 3 breakpoints moeten gebruiken om onderhoud te vereenvoudigen.
 *   --bp-mobile:  480px  (klein telefoon)
 *   --bp-tablet:  768px  (tablet portrait / hamburger menu grens)
 *   --bp-desktop: 1100px (desktop sidebar layout)
 * ------------------------------------------------------------------------- */
:root {
    --bp-mobile: 480px;
    --bp-tablet: 768px;
    --bp-desktop: 1100px;
}

