/* Inter — self-hosted (OFL, zie fonts/LICENSE-Inter.txt).
   Vervangt de externe Google Fonts <link>: offline-first (FO 13) vereist dat de
   UI ook zonder netwerk in het juiste font rendert. De woff2's worden door de
   webapp-service-worker geprecached (sfowebapp/sw.js). url() is relatief t.o.v.
   dit stylesheet, dus dezelfde paden werken vanuit sfo.html én passpoint.html. */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('./fonts/inter-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('./fonts/inter-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('./fonts/inter-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('./fonts/inter-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('./fonts/inter-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('./fonts/inter-latin-ext-500-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('./fonts/inter-latin-ext-600-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('./fonts/inter-latin-ext-700-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Primary palette - SFO Blauw (cyan) */
    --primary: #00A2BF;
    --primary-dark: #007A91;
    --primary-light: #E0F5FA;
    --primary-50: #E6F7FB;
    --primary-100: #CCF0F7;
    --primary-500: #00A2BF;
    --primary-600: #008FA8;
    --primary-700: #007A91;
    --primary-900: #004D5C;

    /* Secondary - SFO Donkerblauw */
    --secondary: #283583;
    --secondary-dark: #1E2A6E;
    --secondary-light: #E8EAF4;

    /* Accent - SFO Oranje */
    --accent: #F9981C;
    --accent-dark: #E07D00;
    --accent-light: #FEF0DB;

    /* Neutrals */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Semantic kleuren */
    --success: #059669;
    --success-light: #D1FAE5;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --warning-bg: #FFFBEB;
    --error: #DC2626;
    --error-light: #FEE2E2;
    --error-bg: #FEF2F2;

    /* Surfaces */
    --background: var(--gray-100);
    --surface: #FFFFFF;
    --surface-raised: #FFFFFF;
    --surface-overlay: rgba(15, 23, 42, 0.6);

    /* Text */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-500);
    --text-muted: var(--gray-400);
    --text-inverse: #FFFFFF;

    /* Borders */
    --border: var(--gray-200);
    --border-strong: var(--gray-300);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing (4px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Typography scale */
    --font-xs: 11px;
    --font-sm: 13px;
    --font-base: 15px;
    --font-lg: 17px;
    --font-xl: 20px;
    --font-2xl: 24px;
    --font-3xl: 30px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Legacy aliases (voor bestaande code) */
    --admin-blue: var(--primary);
    --admin-blue-hover: var(--primary-dark);
    --admin-bg: var(--primary-light);
    --admin-purple: var(--primary);
    --debug-purple: #7C3AED;
    --debug-purple-hover: #6D28D9;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Permissie-gebaseerde zichtbaarheid (generiek)
   Elementen met data-perm="xxx" zijn standaard verborgen.
   Wanneer body.perm--xxx aanwezig is, worden ze getoond.
   syncPermClasses() in JS beheert de body classes. */
[data-perm] { display: none !important; }
body.perm--admin_panel [data-perm="admin_panel"] { display: block !important; }
body.perm--dev_tools [data-perm="dev_tools"] { display: block !important; }
/* Wijzigingsverzoeken beoordelen (migratie 94). Zonder dit recht ziet een vrijwilliger
   de goedkeur- en afwijsknoppen niet meer; de server weigert de actie sowieso. */
body.perm--change_approval [data-perm="change_approval"] { display: inline-block !important; }

/* ============================================================
   Global fold/unfold button — herbruikbaar overal in het prototype
   ============================================================ */
.fold-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    margin-left: auto;
}
.fold-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}
/* Variant for light backgrounds (category headers etc.) */
.fold-btn--light {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary, #6B7280);
}
.fold-btn--light:hover {
    background: rgba(0, 0, 0, 0.14);
}

/* ============================================================
   Global info button (i) — herbruikbaar overal in het prototype
   ============================================================ */
.sfo-info-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: white;
    font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 18px;
    font-style: italic; font-weight: 700; text-transform: none; padding-bottom: 1px;
    cursor: pointer; vertical-align: middle; line-height: 1; flex-shrink: 0;
}

/* Prototype toolbar: combined title + nav */
/* Mobile blocker: shown on small screens */
.mobile-blocker {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--primary, #F26522);
    color: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px;
}
.mobile-blocker-close {
    position: absolute;
    top: 16px;
    left: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.mobile-blocker-close:active {
    background: rgba(255,255,255,0.35);
}
.mobile-blocker p {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}
.mobile-blocker-sub {
    font-size: 14px;
    opacity: 0.9;
    max-width: 280px;
    line-height: 1.5;
}
.mobile-blocker-divider {
    width: 40px;
    height: 1px;
    background: rgba(255,255,255,0.3);
    margin: 4px 0;
}
.mobile-blocker-hint {
    font-size: 14px;
    opacity: 0.9;
    max-width: 280px;
    line-height: 1.5;
}
.mobile-blocker-link {
    display: inline-block;
    background: white;
    color: var(--primary, #F26522);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    margin-top: 4px;
}
.mobile-blocker-link:active {
    opacity: 0.85;
}
.mobile-blocker-link-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.6);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 0;
}
@media (max-width: 768px) {
    .mobile-blocker {
        display: flex;
    }
}

.prototype-toolbar {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Header */
.prototype-header {
    text-align: center;
    margin-bottom: 10px;
    color: white;
}

.prototype-header h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.3px;
    opacity: 0.85;
}

.prototype-header p {
    color: #9CA3AF;
    font-size: 14px;
}

/* Nav rows: buttons row + indicator row */
.nav-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-row-buttons {
    justify-content: center;
    margin-bottom: 4px;
}

.nav-row-indicator .screen-indicator {
    max-width: none;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #9CA3AF;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.nav-icon-btn:hover:not(.disabled) {
    background: rgba(255,255,255,0.18);
    color: white;
}

.nav-icon-btn.disabled {
    opacity: 0.3;
    cursor: default;
}

.sim-btn-group {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.sim-btn-group .nav-icon-btn {
    border-radius: 0;
    background: transparent;
}
.sim-btn-group .nav-icon-btn:first-child { border-radius: 8px 0 0 8px; }
.sim-btn-group .nav-icon-btn:last-child { border-radius: 0 8px 8px 0; }
.sim-btn-group .nav-icon-btn:only-child { border-radius: 8px; }
.sim-btn-group.sim-active {
    background: rgba(255,255,255,0.12);
}
.sim-btn-group.sim-active .nav-icon-btn + .nav-icon-btn {
    border-left: 1px solid rgba(255,255,255,0.15);
}

@keyframes simPausePulse {
    0%, 100% { background: #43B5B5; opacity: 1; }
    50% { background: #43B5B5; opacity: 0.4; }
}
.nav-icon-btn.sim-paused-pulse {
    background: #43B5B5 !important;
    color: white !important;
    animation: simPausePulse 1.5s ease-in-out infinite;
}

/* Role simulation selector (prototype-only) */
#protoRoleSelect {
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
#protoRoleSelect:hover { background: rgba(255,255,255,0.18); }
#protoRoleSelect:focus { border-color: var(--primary); }
#protoRoleSelect option { background: #2a2a2a; color: #fff; }

#protoRoleBanner {
    display: none;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 4px 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* User menu */
.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #9CA3AF;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.user-menu-btn:hover {
    background: rgba(255,255,255,0.18);
    color: white;
}

.user-dropdown-name {
    padding: 10px 16px 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #1F2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #D1D5DB;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.user-dropdown-divider {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 4px 0;
}

.user-dropdown-logout {
    color: #EF4444;
}

.user-dropdown-logout:hover {
    background: rgba(239,68,68,0.1);
    color: #EF4444;
}

/* Screen indicator */
.screen-indicator {
    width: 100%;
    max-width: 460px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    padding: 0 10px;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.screen-indicator .current {
    background: var(--primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-arrow:hover:not(.disabled) {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-arrow.disabled {
    opacity: 0.2;
    cursor: default;
}

/* Phone + Sidebar Wrapper */
.phone-wrapper {
    position: relative;
}

.sync-sidebar {
    position: absolute;
    left: calc(100% + 60px);
    top: 0;
    width: calc(50vw - 280px);
    min-width: 500px;
    height: 812px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

/* Phone Frame */
.phone-container {
    position: relative;
}

.phone-frame {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 50px;
    padding: 12px 12px 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ble-status-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 0;
    padding: 4px 10px 4px 7px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    color: white;
    transition: background 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    /* Default: inactive = red */
    background: var(--error);
}

.ble-status-btn.active {
    background: var(--success);
}

.ble-status-btn .ble-status-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ble-control-bar {
    width: 375px;
    margin-top: 12px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 162, 191, 0.3);
}

/* Sidebar section bar — debug logs, sync panels (geen glow) */
.sidebar-section-bar {
    width: 100%;
    background: var(--debug-purple);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background 0.15s;
}
.sidebar-section-bar:hover {
    background: var(--debug-purple-hover);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--background);
    border-radius: 40px 40px 50px 50px;
    overflow: hidden;
    position: relative;
}

.notch {
    width: 150px;
    height: 30px;
    background: #000;
    border-radius: 0 0 20px 20px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.home-indicator {
    display: none;
}

.status-bar {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 25px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1C1C1E;
    background: #FFFFFF;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    pointer-events: none;
}

.status-time {
    letter-spacing: 0.5px;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Screen Container */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    overflow: hidden;
    background: var(--background);
}

.screen.active {
    display: flex;
}

.screen-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* Minimale padding voor raised nav-primary icon */
.screen.has-visible-nav .screen-content {
    padding-bottom: 0;
}

/* Screen action bar (Scan QR / Handmatig buttons) */
.screen-action-bar {
    display: flex;
    gap: 10px;
    padding: 10px calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--border);
    background: white;
}

/* Geofence scherm-gate: statusbalk in exact de bestaande device-check-balk-stijl
   (uniform met "Apparaat niet gereed"), plus uitgeschakelde scan-acties tot GPS bevestigt */
#p4-geofence-gate {
    background: var(--error-bg, #FEE2E2);
    border-bottom: 1px solid #FECACA;
    padding: 6px 16px;
    display: none;
    align-items: center;
    font-size: var(--font-sm);
    color: var(--error, #DC2626);
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
body.geofence-gate-blocking .screen-action-bar,
body.geofence-gate-blocking .ble-status-btn,
body.geofence-gate-blocking #p4RecordList {
    opacity: 0.45;
    pointer-events: none;
}

/* Offline-gating (FO 13). Zelfde visuele taal als de geofence-gate hierboven, met een
   bewust verschil: GEEN pointer-events:none. De control moet aantikbaar blijven, want
   anders kan de gebruiker de uitleg nooit opvragen. De capture-listener in passpoint.js
   vangt de klik af en toont de modal.
   Dit is een UI-laag voor duidelijkheid, geen handhaving: apiSend() blokkeert de
   schrijfactie ook als dit attribuut ergens ontbreekt. */
body.is-offline [data-offline="online"],
/* Online-only acties binnen schermen die verder wel offline bruikbaar zijn.
   Deze selectors MOETEN gelijk lopen met ONLINE_ONLY_SELECTOR in passpoint.js.
   8b: beoordelen van wijzigingsverzoeken en checkpoint-overrides.
   9d/9e: tijdregistraties archiveren en herstellen. */
body.is-offline .cr-field-approve-btn,
body.is-offline .cr-field-reject-btn,
body.is-offline .cr-approve-all-btn,
body.is-offline .cr-reject-all-btn,
body.is-offline .notif-approve-btn,
body.is-offline .notif-reject-btn,
body.is-offline #sm-bulk-archive-btn,
body.is-offline #sa-bulk-restore-btn {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Een volledig online-only SCHERM dimt alleen zijn inhoud. De app-bar blijft op volle
   sterkte zodat de terugknop bruikbaar en leesbaar blijft, en de gate-strip moet juist
   opvallen. Alle tien de online-only schermen hebben dezelfde opbouw
   (.screen > .screen-content > .app-bar + inhoud), dus dit dekt ze allemaal. */
body.is-offline .screen[data-offline="online"] > .screen-content > *:not(.app-bar):not(.offline-screen-gate) {
    opacity: 0.45;
}
body.is-offline .screen[data-offline="online"] > .screen-content > .app-bar {
    opacity: 1;
    cursor: default;
}

/* Statusstrip bovenaan een volledig online-only scherm, gemodelleerd op #p4-geofence-gate */
.offline-screen-gate {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warning-bg, #FFFBEB);
    color: #92400E;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid rgba(146, 64, 14, 0.15);
}
body.is-offline .offline-screen-gate {
    display: flex;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    align-items: flex-end;
    background: white;
    border-top: 1px solid var(--border);
    padding: 0 env(safe-area-inset-right, 8px) calc(8px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 8px);
    z-index: 90;
    overflow: visible;
    flex-shrink: 0;
    height: 64px;
}

/* Bottom nav items */

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 0;
    gap: 3px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    color: var(--gray-400);
    text-decoration: none;
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Primary (center) nav button - raised FAB */
.nav-item.nav-primary .nav-icon {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -18px;
    box-shadow: 0 4px 12px rgba(0, 162, 191, 0.35);
}

.nav-item.nav-primary .nav-icon svg {
    stroke: white;
    width: 24px;
    height: 24px;
}

.nav-item.nav-primary {
    color: var(--primary);
}

.nav-item.nav-primary .nav-label {
    color: var(--primary);
    font-weight: 600;
}

.nav-item.nav-primary.active .nav-icon {
    background: var(--primary);
}

/* Dashboard permissie-gating: verberg tab maar behoud ruimte voor gecentreerde FAB */
.nav-item[data-perm] {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
}
body.perm--view_dashboard .nav-item[data-perm="view_dashboard"] {
    visibility: visible;
    pointer-events: auto;
}
body.perm--view_dashboard .app-bar-bell[data-perm="view_dashboard"] {
    display: flex !important;
}

/* App Bar */
.app-bar {
    height: 112px;
    background: var(--primary);
    color: white;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 56px 16px 0;
    font-weight: 600;
    font-size: 18px;
    position: sticky;
    top: 0;
    z-index: 80;
    flex-shrink: 0;
}

.app-bar.admin {
    background: var(--admin-blue);
}

/* Offline header badge (compact, for dark screens like QR scanner) */
.offline-header-badge {
    display: none;
    align-items: center;
    gap: 4px;
    background: var(--warning);
    color: white;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 700;
    white-space: nowrap;
}
.offline-header-badge.visible {
    display: inline-flex;
}
.offline-header-badge svg {
    width: 12px;
    height: 12px;
}

/* Offline indicator */
.offline-indicator {
    background: var(--warning-bg);
    border-bottom: 1px solid #FDE68A;
    padding: 6px 16px;
    display: none;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-sm);
    position: sticky;
    top: 112px;
    z-index: 79;
    flex-shrink: 0;
}
.offline-indicator.visible {
    display: flex;
}
.offline-indicator-text {
    color: #92400E;
}
.offline-indicator-text strong {
    font-weight: 600;
}
.offline-indicator-text span {
    opacity: 0.75;
}
.offline-indicator-badge {
    background: var(--warning);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 700;
    flex-shrink: 0;
    display: none;
}
.offline-indicator-badge.queue-pending {
    display: inline-block;
    background: var(--warning);
}
.offline-indicator-badge.queue-failed {
    display: inline-block;
    background: var(--error);
}

/* Device check indicator */
.device-check-indicator {
    background: var(--error-bg, #FEE2E2);
    border-bottom: 1px solid #FECACA;
    padding: 6px 16px;
    display: none;
    align-items: center;
    font-size: var(--font-sm);
    position: sticky;
    top: 112px;
    z-index: 78;
    flex-shrink: 0;
    cursor: pointer;
}
.device-check-indicator.visible {
    display: flex;
}
.device-check-indicator-text {
    color: var(--error, #DC2626);
    font-weight: 600;
}
.device-check-indicator-link {
    color: var(--error, #DC2626);
    font-weight: 400;
    text-decoration: underline;
    margin-left: 6px;
}
/* Schuif device-check-indicator op als offline-indicator erboven zit */
.offline-indicator.visible + .device-check-indicator {
    top: calc(112px + 33px);
}
/* Schuif metrics-strip op als device-check-indicator erboven zit */
.device-check-indicator + .metrics-strip {
    top: calc(112px + 33px);
}
.device-check-indicator.visible + .metrics-strip {
    top: calc(112px + 33px);
}
.offline-indicator.visible + .device-check-indicator + .metrics-strip {
    top: calc(112px + 33px);
}
.offline-indicator.visible + .device-check-indicator.visible + .metrics-strip {
    top: calc(112px + 66px);
}

.metrics-strip {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 112px;
    z-index: 79;
}
/* Wanneer offline-indicator erboven zit, schuift metrics-strip op */
.offline-indicator + .metrics-strip {
    top: calc(112px + 33px);
}

.metric-tile {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    height: 52px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    border-right: 1px solid var(--border);
}

.metric-tile:last-child {
    border-right: none;
}

.metric-tile::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background var(--transition-fast);
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-tile-error .metric-value { color: var(--error); }
.metric-tile-warning .metric-value { color: var(--warning); }
.metric-tile-primary .metric-value { color: var(--primary); }
.metric-tile-success .metric-value { color: var(--success); }

.metric-tile-active {
    background: var(--primary-100);
}
.metric-tile-active::after {
    background: var(--primary);
}
.metric-tile-active .metric-label {
    color: var(--primary-700);
    font-weight: 600;
}
.metric-tile-neutral.metric-tile-active { background: var(--primary-100); }
.metric-tile-neutral.metric-tile-active::after { background: var(--primary); }
.metric-tile-neutral.metric-tile-active .metric-label { color: var(--primary-700); }
.metric-tile-error.metric-tile-active { background: var(--error-light); }
.metric-tile-error.metric-tile-active::after { background: var(--error); }
.metric-tile-error.metric-tile-active .metric-label { color: var(--error); }
.metric-tile-warning.metric-tile-active { background: var(--warning-light); }
.metric-tile-warning.metric-tile-active::after { background: var(--warning); }
.metric-tile-warning.metric-tile-active .metric-label { color: var(--warning); }
.metric-tile-success.metric-tile-active { background: var(--success-light); }
.metric-tile-success.metric-tile-active::after { background: var(--success); }
.metric-tile-success.metric-tile-active .metric-label { color: var(--success); }
/* Admin-tegel: SFO donkerblauw (--secondary), zelfde patroon als de andere varianten */
.metric-tile-secondary .metric-value { color: var(--secondary); }
.metric-tile-secondary.metric-tile-active { background: var(--secondary-light); }
.metric-tile-secondary.metric-tile-active::after { background: var(--secondary); }
.metric-tile-secondary.metric-tile-active .metric-label { color: var(--secondary); }

.metrics-strip:has(.metric-tile-active) .metric-tile:not(.metric-tile-active) {
    opacity: 1;
}
.metrics-strip:has(.metric-tile-active) .metric-tile:not(.metric-tile-active) .metric-value,
.metrics-strip:has(.metric-tile-active) .metric-tile:not(.metric-tile-active) .metric-label {
    opacity: 1;
}

.app-bar > :first-child {
    justify-self: start;
}

.app-bar > :last-child {
    justify-self: end;
}

.app-bar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    transition: background 0.2s;
    padding-bottom: 2px;
}

.app-bar-icon:hover,
.app-bar-icon:active {
    background: rgba(255,255,255,0.30);
}

/* Bell button in app-bar header */
.app-bar-bell,
.app-bar-help {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: white;
    font-size: 14px;
    padding: 0;
    justify-self: end;
}
.app-bar-bell:hover,
.app-bar-bell:active,
.app-bar-help:hover,
.app-bar-help:active {
    background: rgba(255,255,255,0.30);
}
.app-bar-bell .sfo-icon,
.app-bar-help .sfo-icon {
    width: 18px;
    height: 18px;
}
.app-bar-bell .notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 9px;
    width: 16px;
    height: 16px;
}

.app-bar-title {
    justify-self: center;
    text-align: center;
}

.app-bar-welcome {
    height: 112px;
    padding: 56px 16px 0;
    grid-template-columns: 1fr;
}
.app-bar-welcome .app-bar-title {
    justify-self: start;
    text-align: left;
}
.app-bar-welcome .app-bar-bell,
.app-bar-welcome .app-bar-help {
    position: absolute;
    right: 16px;
    bottom: 8px;
}
/* Handleiding-knop staat rechts; is de bel zichtbaar (view_dashboard), dan
   schuift de handleiding-knop een knopbreedte + 8px marge naar links. */
body.perm--view_dashboard .app-bar-welcome .app-bar-help {
    right: 60px;
}
/* Prototype: _initHelpButton() zet deze class wanneer #screen-help ontbreekt. */
.app-bar-help--hidden {
    display: none !important;
}

.app-bar-welcome .welcome-text {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2px;
}

/* Clickable Elements */
.clickable {
    cursor: pointer;
    transition: transform 0.1s, opacity 0.1s;
}

.clickable:hover {
    opacity: 0.9;
}

.clickable:active {
    transform: scale(0.98);
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: transform 0.1s, opacity 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-admin {
    background: var(--admin-blue);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

/* ── Admin Icon Buttons ──
   Uniform icon-only buttons for admin list actions.
   Uses .sfo-icon from the SVG sprite sheet.

   Icon categorization:
   - Admin-only:    icon-admin, icon-key, icon-chart, icon-people, icon-building
   - Admin actions: icon-edit, icon-trash, icon-plus-circle (admin CRUD operations)
   - App-wide:      icon-scan, icon-pin, icon-filter, icon-search, icon-settings, icon-profile,
                    icon-clock, icon-bell, icon-check, icon-check-circle, icon-x-circle,
                    icon-warning, icon-offline, icon-signal, icon-home, icon-logout
   - Data/import:   icon-import, icon-export, icon-sync, icon-refresh, icon-file,
                    icon-clipboard, icon-package, icon-history (admin context)
   - Activity:      icon-runner, icon-cycling, icon-mtb, icon-walking, icon-family
   - Hardware:      icon-bluetooth, icon-qr, icon-camera, icon-sound, icon-vibrate
   - Input:         icon-keyboard, icon-numpad, icon-abc, icon-backspace
   - Branding:      icon-flag, icon-medal, icon-map, icon-rocket, icon-pause, icon-obstacle
   - Contact:       icon-phone, icon-phone-call, icon-email, icon-user, icon-whatsapp
*/

/* Uniform admin icon button — 32x32, light bg, subtle border, 16px icon.
   Reference: QR scan button on P9 BLE tag configuration. */
.admin-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.admin-icon-btn:active {
    background: var(--border);
    color: var(--text-secondary);
}

.admin-icon-btn .sfo-icon {
    width: 16px;
    height: 16px;
}

/* Delete variant — identical button, only icon color is red */
.admin-icon-btn-delete {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.admin-icon-btn-delete:active {
    background: #FEE2E2;
}

.admin-icon-btn-delete .sfo-icon {
    width: 16px;
    height: 16px;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    background: white;
    outline: none;
}

/* Admin Form Fields (compact variant for bottom sheets & modals) */
.admin-form-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    box-sizing: border-box;
}

select.admin-form-input {
    appearance: auto;
}

textarea.admin-form-input {
    resize: vertical;
}

.admin-form-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card:active {
    transform: translateY(0);
}

/* ===== SCREEN SPECIFIC STYLES ===== */

/* Organization Screen */
.org-screen {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 76px 24px 40px;
}

.org-logo {
    margin: 24px auto 32px;
    text-align: center;
}

.org-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.org-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.org-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    text-align: center;
    margin-bottom: 40px;
}

.org-form {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-top: auto;
}

.code-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
justify-content: center;
}

.code-box {
    flex: 1;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
max-width: 48px;
}

/* PIN Lock */
.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
}
.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
}
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}
.pin-key {
    padding: 16px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.pin-key:active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
/* Manual Entry Keypad (screen-manual) */
.keypad-btn {
    background: var(--background);
    border: none;
    border-radius: 10px;
    padding: 16px 0;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.keypad-btn:active {
    opacity: 0.7;
}
.keypad-btn--backspace {
    background: #f0ad4e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.keypad-btn--clear {
    background: #d9534f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-key-empty {
    border: none;
    background: transparent;
    pointer-events: none;
}
@keyframes pin-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
.pin-shake {
    animation: pin-shake 0.4s ease;
}

/* Pin Overlay Close Button — consistent met p8-floating-close */
.pin-overlay-close {
    position: absolute;
    top: max(calc(env(safe-area-inset-top, 0px) + 60px), 60px);
    right: calc(env(safe-area-inset-right, 0px) + 16px);
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
}
.pin-overlay-close:active {
    background: rgba(255, 255, 255, 0.35);
}

/* Sessie verlopen (FO 13): niet-blokkerende banner bovenin.
   Bewust geen overlay en geen modal: de vrijwilliger moet kunnen doorwerken terwijl
   deze in beeld staat, want scans blijven gewoon in de wachtrij lopen. */
.auth-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    padding-top: max(8px, calc(env(safe-area-inset-top, 0px) + 4px));
    background: var(--warning, #F59E0B);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 60;
}

.auth-banner.visible {
    display: flex;
}

.auth-banner-btn {
    flex: 0 0 auto;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.auth-banner-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

/* Pincode als inlogmethode (FO 17): begroeting met de herkende naam en de terugval
   naar het gewone inlogformulier. Classes in plaats van inline styles, zodat de
   zichtbaarheid via classList gaat en niet via element.style. */
.pin-greeting {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 4px;
    font-weight: 600;
}

.pin-fallback {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.pin-row-hidden {
    display: none;
}

/* Pincodescherm: opbouwen vanaf de onderkant.
 *
 * PROBLEEM: #screen-pin en #screen-login delen dezelfde .login-screen + .org-form,
 * maar de pincodekaart is fors hoger door het numerieke toetsenbord (alleen dat blok
 * is al circa 274px). Totale hoogte komt daarmee rond de 783px, en met foutmelding
 * plus pogingenteller rond de 813px. Een gangbare Android-PWA heeft 640 tot 760px.
 * Omdat .screen en .sfo-app allebei overflow:hidden hebben kan er niets scrollen, en
 * omdat .org-form margin-top:auto heeft valt die auto-marge bij overloop weg naar nul
 * en schuift het overschot er aan de ONDERKANT uit: precies waar het toetsenbord zit.
 *
 * OPLOSSING: de kaart krijgt voorrang op de header. De kaart en de teksten krimpen
 * niet (flex-shrink:0), alleen het logo geeft ruimte prijs. Alle druk landt daarmee
 * bovenaan, waar alleen decoratie staat, in plaats van onderaan op de toetsen.
 *
 * BEWUST alleen op #screen-pin: het inlogscherm past wel en blijft ongemoeid. De
 * id-selector wint op specificiteit van .login-screen verderop, ongeacht volgorde.
 */
#screen-pin .login-screen {
    padding-top: 24px;
    /* .login-screen had geen safe-area onderaan, waardoor de onderste strook op
       Android met gebarennavigatie onder de systeembalk viel. */
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
}

/* Volgt de kleinere bovenmarge, anders valt de knop over de titel. */
#screen-pin .pin-overlay-close {
    top: max(calc(env(safe-area-inset-top, 0px) + 12px), 12px);
}

#screen-pin .org-title,
#screen-pin .org-subtitle,
#screen-pin .org-form {
    flex-shrink: 0;
}

#screen-pin .org-form {
    padding: 16px;
}

/* Enige krimpbare element. min-height:0 is nodig omdat een kolom-flexitem
   standaard min-height:auto heeft en dus niet onder zijn inhoud kan zakken. */
#screen-pin .org-logo {
    min-height: 0;
    overflow: hidden;
}

/* Lage schermen: het logo levert getrapt in voordat het gekropt hoeft te worden. */
@media (max-height: 700px) {
    #screen-pin .org-subtitle { margin-bottom: 16px; }
    #screen-pin .org-logo { margin: 12px auto 16px; }
    #screen-pin .org-logo img { max-width: 150px; }
}

@media (max-height: 620px) {
    #screen-pin .org-logo { display: none; }
}

/* Login Screen */
.login-screen {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 76px 24px 40px;
    position: relative;
}

.login-header {
    text-align: center;
}

.login-logo {
    margin: 16px auto 0;
    text-align: center;
}

.login-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.login-org-name {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-app-name {
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    margin-bottom: 40px;
}

.login-form {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-top: auto;
}

.login-form h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

/* Checkpoint Selection */
.welcome-section {
    padding: 12px 24px 16px;
    background: var(--primary);
}

.welcome-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.volunteer-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.checkpoint-list {
    padding: 8px 16px 16px;
}

.checkpoint-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
}

.checkpoint-card:active {
    transform: scale(0.985);
}

.checkpoint-card.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm), 0 0 0 2px rgba(0, 162, 191, 0.15);
}

.checkpoint-card.selected-reg {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px var(--warning-light);
}

.checkpoint-card.selected-reg .progress-fill {
    background: var(--warning);
}

.checkpoint-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    color: white;
    font-size: var(--font-base);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkpoint-info {
    flex: 1;
    min-width: 0;
}

.checkpoint-name {
    font-size: var(--font-base);
    font-weight: 600;
}

.checkpoint-location {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-top: 1px;
}

.checkpoint-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.progress-text {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* Main Tracking */
.ble-status {
    background: var(--success);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.ble-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.scan-popup {
    background: #D1FAE5;
    border: 2px solid var(--success);
    border-radius: 16px;
    padding: 14px;
    margin: 12px 16px;
}

.scan-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.scan-popup-title {
    font-weight: 700;
    color: var(--success);
}

.scan-popup-name {
    font-size: 18px;
    font-weight: 700;
}

.scan-popup-category {
    font-size: 13px;
    color: var(--text-secondary);
}

.cp-dots {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.cp-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.cp-dot.done {
    background: var(--success);
    color: white;
}

.cp-dot.pending {
    background: var(--border);
    color: var(--text-muted);
}

.pending-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    margin: 0 16px 12px;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: white;
}

.pending-btn:hover {
    opacity: 0.95;
}

.pending-btn-icon {
    font-size: 28px;
}

.pending-btn-info {
    flex: 1;
}

.pending-btn-title {
    font-weight: 600;
    font-size: 15px;
}

.pending-btn-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.pending-btn-count {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 18px;
}

.recent-section {
    padding: 0 16px;
    flex: 1;
}

.section-title {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px 4px;
    margin: 0;
}

.section-title:first-child {
    margin-top: 0;
}

/* Deelnemer Info card */
.info-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child {
    border-bottom: none;
}
.info-row.muted {
    opacity: 0.4;
}
.info-label {
    color: var(--text-secondary);
    font-size: 13px;
}
.info-val {
    font-weight: 600;
    font-size: 13px;
}
.info-sub {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}
.info-placeholder {
    font-style: italic;
    color: var(--text-muted);
}
.day-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.scan-item {
    background: white;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    transition: background 1s ease, border-color 1s ease;
}

.num-badge {
    min-width: 32px;
    height: 24px;
    background: var(--background);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Scan item states */
.scan-item.scan-registered {
    background: #F0FDF4;
    border: 1px solid #A7F3D0;
}
.scan-item.scan-registered .num-badge {
    background: var(--success);
    color: white;
}

.scan-item.scan-pending {
    background: #EFF6FF;
    border: 1px solid var(--primary);
}
.scan-item.scan-pending .num-badge {
    background: var(--primary);
    color: white;
}

.scan-item.scan-warning {
    background: #FFF7ED;
    border: 1px solid #FDBA74;
}
.scan-item.scan-warning .num-badge {
    background: var(--warning);
    color: white;
}

.scan-item.scan-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
}
.scan-item.scan-error .num-badge {
    background: var(--error);
    color: white;
}

.scan-icon {
    font-size: 20px;
}

.scan-info {
    flex: 1;
}

.scan-name {
    font-size: 14px;
    font-weight: 600;
}

.scan-category {
    font-size: 12px;
    color: var(--text-secondary);
}

.scan-time {
    font-size: 11px;
    color: var(--text-muted);
}

.pending-sync-icon {
    width: 12px;
    height: 12px;
    color: var(--warning);
    margin-left: 4px;
    vertical-align: middle;
    animation: pending-sync-spin 2s linear infinite;
}

@keyframes pending-sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border);
}

.action-btn {
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    color: white;
}

.action-btn.primary {
    background: var(--primary);
}

.action-btn.secondary {
    background: var(--secondary);
}

.action-btn-icon {
    font-size: 24px;
}

.sync-bar {
    background: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.sync-stats {
    display: flex;
    gap: 12px;
}

.sync-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-stat.pending { color: var(--warning); }
.sync-stat.synced { color: var(--success); }

/* QR Scanner */
.qr-screen {
    background: #000;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.qr-header {
    padding: 60px 20px 20px;
}

.qr-back {
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-viewfinder {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.qr-frame {
    width: 280px;
    height: 280px;
    border: none;
    position: relative;
}
.qr-frame::before,
.qr-frame::after,
.qr-frame .qr-corner-bl,
.qr-frame .qr-corner-br {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    border-color: #F59E0B;
    border-style: solid;
}
.qr-frame::before {
    top: 0; left: 0;
    border-width: 4px 0 0 4px;
    border-radius: 4px 0 0 0;
}
.qr-frame::after {
    top: 0; right: 0;
    border-width: 4px 4px 0 0;
    border-radius: 0 4px 0 0;
}
.qr-frame .qr-corner-bl {
    bottom: 0; left: 0;
    border-width: 0 0 4px 4px;
    border-radius: 0 0 0 4px;
}
.qr-frame .qr-corner-br {
    bottom: 0; right: 0;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 4px 0;
}

.qr-footer {
    padding: 30px;
    text-align: center;
    color: white;
}

.qr-instruction {
    font-size: 16px;
    margin-bottom: 8px;
}

.qr-hint {
    font-size: 13px;
    opacity: 0.7;
}

/* QR scanner containers — video fills viewfinder (same pattern as webapp) */
#p5-qr-reader,
#p9-ble-qr-video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}
#p5-qr-reader video,
#p9-ble-qr-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}
#p5-qr-reader #qr-shaded-region,
#p9-ble-qr-video #qr-shaded-region {
    border-color: transparent !important;
}
#p5-qr-reader > div > div,
#p9-ble-qr-video > div > div {
    border: none !important;
    box-shadow: none !important;
}
#p5-qr-reader img,
#p5-qr-reader a,
#p9-ble-qr-video img,
#p9-ble-qr-video a {
    display: none !important;
}

.qr-scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    z-index: 10;
    pointer-events: none;
}
.qr-scan-frame::before,
.qr-scan-frame::after,
.qr-scan-frame .qr-corner-bl,
.qr-scan-frame .qr-corner-br {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    border-color: #F59E0B;
    border-style: solid;
}
.qr-scan-frame::before {
    top: 0; left: 0;
    border-width: 4px 0 0 4px;
    border-radius: 4px 0 0 0;
}
.qr-scan-frame::after {
    top: 0; right: 0;
    border-width: 4px 4px 0 0;
    border-radius: 0 4px 0 0;
}
.qr-scan-frame .qr-corner-bl {
    bottom: 0; left: 0;
    border-width: 0 0 4px 4px;
    border-radius: 0 0 0 4px;
}
.qr-scan-frame .qr-corner-br {
    bottom: 0; right: 0;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 4px 0;
}
.qr-scan-line {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #F59E0B 20%, #F59E0B 80%, transparent);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: qr-scan-sweep 2s ease-in-out infinite;
}
@keyframes qr-scan-sweep {
    0%, 100% { top: 8px; }
    50% { top: calc(100% - 10px); }
}

/* Participants List */
.search-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 148px;
    z-index: 78;
    flex-shrink: 0;
}

/* Zoekbalk in een flex-kolom (P8b): niet sticky, mag niet krimpen */
.search-bar--fixed {
    position: static;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}

.filter-btn {
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}





.stats-row {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: var(--background);
    border-radius: 10px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Participant number badge (P7, P7b, PM headers) */
.participant-num-badge {
    min-width: 40px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.participant-num-badge--warning {
    background: white;
    color: var(--warning);
}

/* Detail screen stat cells (P7, P7b, PM time stats) */
.detail-stat-cell {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-right: 1px solid var(--border);
}
.detail-stat-cell:last-child {
    border-right: none;
}
.detail-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-muted);
}
.detail-stat-label {
    font-size: 10px;
    color: var(--text-muted);
}

.participant-list {
    padding: 12px 16px;
}

.participant-card {
    background: white;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.participant-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.participant-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    font-size: 15px;
}

.participant-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.participant-status {
    display: flex;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.done { background: var(--success); }
.status-dot.pending { background: var(--border); }

/* Admin Dashboard */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
}

.admin-card {
    background: white;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-card-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.admin-card-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 1px;
}

.admin-card-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Settings */
.settings-section {
    background: white;
    margin: 8px 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 16px 8px;
    margin: 0;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 10px 10px;
    min-height: 44px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--background);
}

.settings-icon {
    width: 24px;
    height: 24px;
    background: var(--background);
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 8px;
}

.settings-icon-lg {
    width: 32px;
    height: auto;
    align-self: stretch;
    border-radius: 8px;
}

.settings-icon .notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
}

.settings-label {
    flex: 1;
    font-size: 13px;
}

.settings-value {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Settings footer (version + copyright) */
.settings-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 16px;
}

.settings-footer-copyright {
    margin-top: 4px;
    font-size: 11px;
}

.settings-footer-link {
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}

/* Settings accordion */
.settings-accordion-header {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    min-height: 48px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.settings-accordion-header:hover {
    background: var(--background);
}

.settings-accordion-header .settings-label-block {
    flex: 1;
    margin-left: 8px;
}

.settings-accordion-header .settings-label-block .settings-label {
    font-size: 14px;
    font-weight: 600;
}

.settings-sublabel {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.accordion-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.settings-accordion-header.open .accordion-chevron {
    transform: rotate(90deg);
}

.settings-accordion-content {
    display: none;
    padding-left: 16px;
    zoom: 0.9;
}

.settings-accordion-content.open > .settings-item:last-child {
    border-bottom: 1px solid var(--border);
}

.settings-accordion-content.open {
    display: block;
}

.toggle {
    width: 44px;
    height: 24px;
    background: var(--secondary);
    border-radius: 24px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.toggle.off {
    background: var(--border);
}

.toggle.off::after {
    right: auto;
    left: 2px;
}

/* Import Screens */
/* Settings value color modifiers */
.settings-value--primary { color: var(--primary); }
.settings-value--error { color: var(--error); }

/* Progress bar segments (sync/csv step indicators) */
.progress-segment {
    flex: 1;
    background: var(--border);
    transition: background 0.3s;
}

/* Admin edit modal footer actions */
.admin-edit-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    flex-shrink: 0;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    margin: 16px;
}

.upload-area:hover {
    border-color: var(--admin-blue);
    background: #FAF5FF;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.import-mode-list {
    margin: 0 16px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.import-mode-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.import-mode-item:last-child {
    border-bottom: none;
}

.import-mode-item.selected {
    background: #FAF5FF;
}

.import-mode-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.import-mode-radio.selected {
    border-color: var(--admin-blue);
}

.import-mode-radio.selected::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--admin-blue);
    border-radius: 50%;
}

.import-mode-title {
    font-size: 14px;
    font-weight: 600;
}

.import-mode-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: white;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.step-dot.active {
    background: var(--admin-blue);
    width: 24px;
    border-radius: 4px;
}

.step-dot.done {
    background: var(--success);
}

/* Import Stats */
.import-stats {
    display: flex;
    gap: 8px;
    padding: 16px;
}

.import-stat {
    flex: 1;
    padding: 12px 8px;
    border-radius: 10px;
    text-align: center;
}

.import-stat.add { background: #D1FAE5; color: #059669; }
.import-stat.update { background: #DBEAFE; color: #2563EB; }
.import-stat.delete { background: #FEE2E2; color: #DC2626; }
.import-stat.same { background: var(--background); color: var(--text-secondary); }

.import-stat-number {
    font-size: 20px;
    font-weight: 700;
}

.import-stat-label {
    font-size: 10px;
    font-weight: 500;
}

/* Preview Items */
.preview-list {
    padding: 0 16px;
}

.preview-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid transparent;
}

.preview-item.add { border-left-color: var(--success); }
.preview-item.update { border-left-color: var(--primary); }
.preview-item.delete { border-left-color: var(--error); }

.preview-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.preview-badge.add { background: #D1FAE5; color: #059669; }
.preview-badge.update { background: #DBEAFE; color: #2563EB; }
.preview-badge.delete { background: #FEE2E2; color: #DC2626; }

.preview-id {
    font-weight: 600;
    font-size: 13px;
}

.preview-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Import Result */
.result-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin: 0 auto 16px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--success);
    margin-bottom: 24px;
}

.result-stats {
    background: white;
    border-radius: 12px;
    margin: 0 16px;
    overflow: hidden;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

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

.result-row-icon {
    width: 32px;
    font-size: 18px;
}

.result-row-label {
    flex: 1;
    font-size: 14px;
}

.result-row-value {
    font-size: 16px;
    font-weight: 600;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 6px;
    padding: 6px 16px;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 148px;
    z-index: 77;
    flex-shrink: 0;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-chip.has-value {
    background: #DBEAFE;
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip-icon {
    font-size: 14px;
}

.filter-chip-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.filter-chip.active .filter-chip-count {
    background: rgba(255,255,255,0.2);
}

.filter-chip-clear {
    margin-left: 4px;
    font-size: 12px;
    opacity: 0.7;
}

/* Lege lijst of laadfout in de notificatielijst (P8b) */
.notif-archive-empty {
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.notif-archive-empty--error {
    color: var(--error);
}

/* ===== Uniforme filterbalk boven een lijst =====
   Zelfde opzet als de filterbalk van P6 (Deelnemers) en P10 (Gebruikers), maar
   als CSS-classes in plaats van inline styles. Gebruikt door P8b (Alle notificaties). */
.list-filter-bar {
    z-index: 77;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.list-filter-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
}

.list-filter-bar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--background);
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

/* Reset verschijnt pas zodra er een filter of zoekterm actief is */
.list-filter-bar-btn--reset {
    display: none;
    color: var(--error);
}

.list-filter-bar-btn--reset.is-visible {
    display: flex;
}

.list-filter-bar-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Actieve-filter-chips onder de filterbalk; tik op een chip heft dat filter op */
.active-filter-chips {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 16px 6px;
}

.active-filter-chips.is-visible {
    display: flex;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary-100);
    color: var(--primary-700);
}

.active-filter-chip--warning {
    background: var(--warning-light);
    color: var(--warning);
}

.active-filter-chip--success {
    background: var(--success-light);
    color: var(--success);
}

.active-filter-chip--error {
    background: var(--error-light);
    color: var(--error);
}

.active-filter-chip--neutral {
    background: var(--gray-200);
    color: var(--text-secondary);
}

/* Filter Bottom Sheet */
.filter-sheet {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 200;
}

.filter-sheet.active {
    display: flex;
    flex-direction: column;
}

.filter-sheet-backdrop {
    flex: 1;
    background: rgba(0,0,0,0.5);
}

.filter-sheet-content {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 14px 16px 32px;
    max-height: 75%;
    overflow-y: auto;
}

.filter-sheet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.filter-sheet-header-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* Reset- en toon-resultaten knop in de sheet-header. P6/P10 zetten dit nog inline;
   die inline waarde is identiek en wint, dus dit verandert daar niets. */
.filter-sheet-header-actions .btn {
    padding: 6px 12px;
    font-size: 11px;
}

.filter-sheet-title {
    font-size: 14px;
    font-weight: 700;
    flex: 1;
}

.filter-sheet-close {
    width: 28px;
    height: 28px;
    background: var(--background);
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkpoint edit bottom sheet (same pattern as filter-sheet) */
.cp-edit-sheet {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 200;
}

.cp-edit-sheet.active {
    display: flex;
    flex-direction: column;
}

.cp-edit-sheet-backdrop {
    flex: 1;
    background: rgba(0,0,0,0.5);
}

.cp-edit-sheet-content {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cp-edit-sheet-fields {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
}


.filter-section {
    margin-bottom: 12px;
}

.filter-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--background);
    border: 1.5px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-option:hover {
    background: #E5E7EB;
}

.filter-option.selected {
    background: #DBEAFE;
    border-color: var(--primary);
    color: var(--primary);
}

.filter-option.success-style.selected {
    background: #DCFCE7;
    border-color: var(--success);
    color: #166534;
}

.filter-option.success-style.selected .filter-option-count {
    color: #166534;
}

.filter-option.warning-style.selected {
    background: #FFF7ED;
    border-color: #F97316;
    color: #9A3412;
}

.filter-option.warning-style.selected .filter-option-count {
    color: #9A3412;
}

.filter-option.error-style.selected {
    background: #FEE2E2;
    border-color: var(--error);
    color: #991B1B;
}

.filter-option.error-style.selected .filter-option-count {
    color: #991B1B;
}

.filter-option.primary-style.selected {
    background: #E0F2FE;
    border-color: var(--primary);
    color: #1E40AF;
}

.filter-option.primary-style.selected .filter-option-count {
    color: #1E40AF;
}

.filter-option-icon {
    font-size: 14px;
}

.filter-option-count {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
}

.filter-option.selected .filter-option-count {
    color: var(--primary);
}

/* Checkpoint Filter Grid */
.checkpoint-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.checkpoint-filter-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.checkpoint-filter-btn:hover {
    background: #E5E7EB;
}

.checkpoint-filter-btn.selected {
    background: #DBEAFE;
    border-color: var(--primary);
    color: var(--primary);
}

.checkpoint-filter-btn.selected-not {
    background: #FEE2E2;
    border-color: var(--error);
    color: var(--error);
}

.checkpoint-filter-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Filter Summary Bar */
.filter-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: #DBEAFE;
    font-size: 12px;
    color: var(--primary);
    position: sticky;
    top: 182px;
    z-index: 76;
    flex-shrink: 0;
}

.filter-summary-text {
    flex: 1;
}

.filter-summary-clear {
    font-weight: 600;
    cursor: pointer;
}

/* Active Filter Tags */
.active-filters {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.active-filter-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #DBEAFE;
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary);
}

.active-filter-tag-remove {
    cursor: pointer;
    font-size: 14px;
    margin-left: 2px;
}

/* Navigation Help */
.nav-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-size: 13px;
    max-width: 280px;
}

.nav-help h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--primary);
}

.nav-help p {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.nav-help-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Screen Map Button */
.screen-map-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.screen-map-btn:hover {
    transform: scale(1.05);
}

/* Screen Map Modal - popup anchored to button */
.screen-map-modal {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 1000;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.screen-map-modal.active {
    display: block;
}

.screen-map-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.screen-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.screen-map-header h2 {
    font-size: 20px;
}

.screen-map-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.screen-map-section {
    margin-bottom: 20px;
}

.screen-map-section h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.screen-map-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.screen-map-item {
    padding: 10px;
    background: var(--background);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.screen-map-item:hover {
    background: var(--primary);
    color: white;
}

.screen-map-item.current {
    background: var(--primary);
    color: white;
}

       /* Offline Banner */
.offline-banner {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-bottom: 2px solid var(--error);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.offline-icon {
    font-size: 24px;
}

.offline-text {
    flex: 1;
}

.offline-title {
    font-weight: 600;
    font-size: 14px;
    color: #991B1B;
}

.offline-subtitle {
    font-size: 12px;
    color: #B91C1C;
}

.offline-badge {
    background: var(--error);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Admin Sync Overview */
.sync-overview-section {
    margin: 16px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.sync-overview-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sync-overview-title {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-overview-refresh {
    color: var(--admin-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sync-checkpoint-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-checkpoint-item:last-child {
    border-bottom: none;
}

.sync-cp-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.sync-cp-number.online { background: var(--success); }
.sync-cp-number.warning { background: var(--warning); }
.sync-cp-number.offline { background: var(--error); }

.sync-cp-info {
    flex: 1;
}

.sync-cp-name {
    font-weight: 600;
    font-size: 14px;
}

.sync-cp-volunteer {
    font-size: 12px;
    color: var(--text-secondary);
}

.sync-cp-status {
    text-align: right;
}

.sync-cp-time {
    font-size: 12px;
    font-weight: 600;
}

.sync-cp-time.recent { color: var(--success); }
.sync-cp-time.warning { color: var(--warning); }
.sync-cp-time.offline { color: var(--error); }

.sync-cp-pending {
    font-size: 10px;
    color: var(--text-muted);
}

/* ===== SFO Custom Icon System ===== */
.sfo-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Icon size utilities */
.sfo-icon.icon-xs  { width: 14px; height: 14px; }
.sfo-icon.icon-sm  { width: 16px; height: 16px; }
.sfo-icon.icon-md  { width: 18px; height: 18px; }
.sfo-icon.icon-lg  { width: 20px; height: 20px; }
.sfo-icon.icon-xl  { width: 24px; height: 24px; }
.sfo-icon.icon-2xl { width: 28px; height: 28px; }
.sfo-icon.icon-3xl { width: 32px; height: 32px; }

/* ========== BLE Scanner Test Screen ========== */

.ble-header-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
}

/* Two-column page layout: controls left, devices right */
.ble-page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
    align-items: start;
}
.ble-page-layout .ble-section {
    margin: 0 0 8px 0;
}
.ble-page-right {
    position: sticky;
    top: 60px;
}
.ble-grid-devices {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
@media (max-width: 800px) {
    .ble-page-layout {
        grid-template-columns: 1fr;
    }
    .ble-page-right {
        position: static;
    }
    .ble-grid-devices {
        max-height: 400px;
    }
}

/* Grid for passpoint embedded view */
.ble-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 12px;
}
.ble-grid .ble-section {
    margin: 0;
}
@media (max-width: 700px) {
    .ble-grid {
        grid-template-columns: 1fr;
    }
}

.ble-section {
    background: var(--surface);
    border-radius: 10px;
    padding: 12px;
    margin: 8px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.ble-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Compat rows */
.ble-compat-info {
    font-size: 12px;
}

.ble-compat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.ble-compat-row:last-child { border-bottom: none; }
.ble-compat-icon { font-size: 14px; width: 20px; text-align: center; }
.ble-compat-label { font-weight: 500; flex: 1; font-size: 12px; }
.ble-compat-detail { color: var(--text-muted); font-size: 11px; max-width: 120px; text-align: right; }

/* Controls */
.ble-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ble-control-row:last-child { margin-bottom: 0; }
.ble-control-label {
    font-size: 12px;
    font-weight: 500;
    min-width: 65px;
}

.ble-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
}

/* Distance toggle buttons */
.ble-toggle-group {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}
.ble-toggle {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.ble-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.ble-toggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.ble-range-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ble-range {
    flex: 1;
    accent-color: var(--primary);
    height: 4px;
}
.ble-range-val {
    font-size: 11px;
    font-family: monospace;
    color: var(--text-muted);
    min-width: 120px;
    text-align: right;
}

/* Status bar */
.ble-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.ble-status-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ble-status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ble-scan-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}
.ble-scan-dot.scanning {
    background: var(--success);
    animation: blePulse 1.5s ease-in-out infinite;
}

@keyframes blePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.ble-status-label {
    font-size: 13px;
    font-weight: 500;
}

.ble-timer {
    font-family: monospace;
    font-weight: 600;
    font-size: 13px;
}

.ble-device-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Action buttons */
.ble-action-row {
    display: flex;
    gap: 6px;
}

.ble-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.ble-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.ble-btn-start {
    background: var(--success);
    color: white;
}
.ble-btn-start:hover:not(:disabled) { background: #059669; }
.ble-btn-stop {
    background: var(--error);
    color: white;
}
.ble-btn-stop:hover:not(:disabled) { background: #DC2626; }
.ble-btn-clear {
    background: var(--background);
    color: var(--text-secondary);
    flex: 0.5;
}

/* Empty state */
.ble-empty {
    text-align: center;
    padding: 20px 8px;
    color: var(--text-muted);
}
.ble-empty-icon {
    font-size: 32px;
    margin-bottom: 6px;
    opacity: 0.4;
}
.ble-empty-hint {
    font-size: 11px;
    margin-top: 2px;
}

/* Device list */
.ble-device-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ble-device-card {
    background: var(--background);
    border-radius: 8px;
    padding: 10px;
    border-left: 3px solid var(--border);
    transition: all 0.3s;
}
.ble-device-card.ble-device-active {
    border-left-color: var(--success);
    background: #F0FDF4;
}

.ble-device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.ble-device-name {
    font-weight: 600;
    font-size: 13px;
}
.ble-device-rssi {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}
.ble-device-id {
    font-family: monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    word-break: break-all;
}
.ble-device-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
    align-items: center;
}
.ble-device-mfr {
    font-family: monospace;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 3px;
    word-break: break-all;
}

/* Signal bars */
.ble-signal-bars {
    display: inline-flex;
    gap: 1px;
    align-items: flex-end;
    height: 12px;
}
.ble-bar {
    width: 3px;
    background: var(--border);
    border-radius: 1px;
}
.ble-bar:nth-child(1) { height: 3px; }
.ble-bar:nth-child(2) { height: 6px; }
.ble-bar:nth-child(3) { height: 9px; }
.ble-bar:nth-child(4) { height: 12px; }
.ble-bar.ble-bar-active { background: var(--success); }

/* Log */
.ble-log {
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 10px;
    background: #1F2937;
    border-radius: 8px;
    padding: 8px;
    color: #D1D5DB;
    min-height: 40px;
}

.ble-log-entry {
    padding: 2px 0;
    display: flex;
    gap: 6px;
}
.ble-log-time { color: #6B7280; white-space: nowrap; }
.ble-log-msg { word-break: break-word; }
.ble-log-success .ble-log-msg { color: #34D399; }
.ble-log-error .ble-log-msg { color: #F87171; }
.ble-log-warn .ble-log-msg { color: #FBBF24; }

/* Instructions */
.ble-instructions {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
}
.ble-instruction-item {
    padding: 6px 0;
    font-size: 11px;
    line-height: 1.4;
    border-bottom: 1px solid #DBEAFE;
}
.ble-instruction-item:last-child { border-bottom: none; }
.ble-instruction-item code {
    background: #DBEAFE;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    font-family: monospace;
    word-break: break-all;
}

/* ========== Checkpoint Registration Popup ========== */

.cp-popup {
    margin: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin 0.4s ease-out;
}

.cp-popup.visible {
    max-height: 100px;
    margin: 8px 16px;
}

.cp-popup-inner {
    background: var(--success);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   FEEDBACK PANEL
   ======================================== */

/* Feedback toggle bar — above the tiles */
.feedback-toggle-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    user-select: none;
    transition: background 0.15s;
    flex-shrink: 0;
}

.feedback-toggle-bar:hover {
    background: var(--primary-dark);
}

/* feedback-toggle-arrow: uses global .fold-btn (margin-left:0 because expand-btn has auto) */
.feedback-toggle-arrow {
    margin-left: 0;
}

.feedback-badge {
    background: white;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.feedback-badge-review {
    height: 28px;
    border-radius: 6px;
    background: var(--warning);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 0 10px;
    gap: 4px;
    white-space: nowrap;
}

/* Feedback sidebar — left of phone frame, below news ticker */
.feedback-sidebar {
    position: fixed;
    left: 20px;
    top: calc(var(--feedback-top, 80px) + var(--ticker-offset, 0px));
    width: 580px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    bottom: var(--feedback-bottom, 20px);
    overflow: hidden;
}

/* Page navigator — screen badges between toggle bar and tiles */
.feedback-page-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-shrink: 0;
}

.feedback-page-nav-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.feedback-page-nav-actions {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.feedback-status-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 2px;
}

.feedback-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.feedback-status-pill-count {
    font-weight: 700;
}

.feedback-status-pill[data-status="nieuw"] {
    background: #E0F2FE;
    color: var(--primary);
}

.feedback-status-pill[data-status="ter_beoordeling"] {
    background: var(--warning-bg);
    color: var(--warning);
}

.feedback-status-pill[data-status="afgewezen"] {
    background: var(--error-bg);
    color: var(--error);
}

.feedback-status-pill[data-status="gesloten"] {
    background: var(--success-bg);
    color: var(--success);
}

.feedback-status-pill.disabled {
    opacity: 0.5;
    background: var(--background);
    color: var(--text-muted);
    pointer-events: none;
    cursor: default;
}

.feedback-status-pill {
    cursor: pointer;
}

.feedback-status-pill.active[data-status="nieuw"] {
    background: var(--primary);
    color: white;
}

.feedback-status-pill.active[data-status="ter_beoordeling"] {
    background: var(--warning);
    color: white;
}

.feedback-status-pill.active[data-status="afgewezen"] {
    background: var(--error);
    color: white;
}

.feedback-status-pill.active[data-status="gesloten"] {
    background: var(--success);
    color: white;
}

.feedback-page-nav-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.feedback-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.15s;
    white-space: nowrap;
}

.feedback-page-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #E0F7FA;
}

.feedback-page-badge.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Status filter active: tint badges with the matching status color */
.feedback-page-badge.current.status-ter_beoordeling {
    background: var(--warning);
    border-color: var(--warning);
}
.feedback-page-badge.current.status-afgewezen {
    background: var(--error);
    border-color: var(--error);
}
.feedback-page-badge.current.status-gesloten {
    background: var(--success);
    border-color: var(--success);
}

.feedback-page-badge-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.3);
    padding: 0 4px;
    border-radius: 6px;
    line-height: 1.5;
}

.feedback-page-badge.current .feedback-page-badge-count {
    background: rgba(255,255,255,0.3);
}

.feedback-page-badge:not(.current) .feedback-page-badge-count {
    background: var(--primary);
    color: white;
}

/* Status filter active: count pill on non-current badges in status color */
.feedback-page-badge:not(.current).status-ter_beoordeling .feedback-page-badge-count {
    background: var(--warning);
}
.feedback-page-badge:not(.current).status-afgewezen .feedback-page-badge-count {
    background: var(--error);
}
.feedback-page-badge:not(.current).status-gesloten .feedback-page-badge-count {
    background: var(--success);
}

.feedback-page-badge-general:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #E8EAF6;
}

.feedback-page-badge-general.current {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.feedback-page-badge-general:not(.current) .feedback-page-badge-count {
    background: var(--secondary);
    color: white;
}

.feedback-page-badge-general:not(.current) .feedback-page-badge-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

.feedback-page-nav-empty {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.feedback-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}


/* Unified tile header — color changes with mode */
.feedback-tile-header {
    flex-shrink: 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    cursor: default;
    user-select: none;
    transition: background 0.25s;
    border-radius: 16px 16px 0 0;
}

.feedback-tile-header.mode-screen {
    background: var(--primary);
}

.feedback-tile-header.mode-general {
    background: var(--secondary);
}

/* Mode toggle badge */
.feedback-mode-toggle {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.feedback-mode-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.feedback-mode-btn:hover {
    color: white;
}

.feedback-mode-btn.active {
    background: white;
    color: var(--primary);
    border-radius: 12px;
}

.feedback-tile-header.mode-general .feedback-mode-btn.active {
    color: var(--secondary);
}


.feedback-tile > .feedback-input-row {
    flex-shrink: 0;
    padding: 12px 16px 8px;
}

.feedback-tile-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 16px;
    flex: 1;
    min-height: 0;
}

.feedback-tile-body .feedback-list {
    padding-bottom: 12px;
}

/* Single tile takes all available space */
#feedbackTile {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.feedback-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
}

/* Tile header count badges removed — filter badges in header replace them */

.feedback-filter-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.feedback-filter-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.feedback-filter-badge.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.feedback-filter-badge.active[data-value="done"] {
    background: #4CAF50;
    border-color: #4CAF50;
}

.feedback-filter-own.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

/* Themed modal dialogs */
.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.feedback-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.feedback-modal-message {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* confirmModal scroll fix - maakt content scrollbaar bij overflow (iPhone) */
#confirmModal > .admin-modal-panel > div {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}
#confirmModal .feedback-modal-message {
    min-height: 0; /* oudere iOS Safari past de auto min-height van een scroll-container niet toe -> modal scrollt anders niet */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.feedback-modal-hint {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-bottom: 6px;
    font-style: italic;
}

.feedback-modal-input {
    width: 100%;
    min-height: 100px;
    max-height: 50vh;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.feedback-modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0,150,136,0.15);
}

.feedback-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.feedback-modal-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.feedback-modal-btn.cancel {
    background: var(--bg);
    color: var(--text);
}

.feedback-modal-btn.cancel:hover {
    background: var(--border);
}

.feedback-modal-btn.confirm {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.feedback-modal-btn.confirm:hover {
    opacity: 0.9;
}

.feedback-modal-btn.danger {
    background: #e53935;
    color: white;
    border-color: #e53935;
}

.feedback-modal-btn.danger:hover {
    background: #c62828;
    border-color: #c62828;
}

/* Quick input */
.feedback-input-row {
    display: flex;
    gap: 6px;
}

.feedback-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.feedback-input:focus {
    border-color: var(--primary);
}

.feedback-submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.feedback-submit-btn:hover {
    background: var(--primary-dark);
}

/* List */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px 0;
}

/* Item */
.feedback-item {
    background: var(--background);
    border-radius: 10px;
    transition: opacity 0.15s;
    overflow: hidden;
}

.feedback-item.done {
    opacity: 0.6;
}

.feedback-item.expanded {
    background: #F0F9FF;
    border: 1px solid var(--primary);
    opacity: 1;
}

/* Accordion header (always visible) */
.feedback-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
    min-height: 36px;
}

.feedback-item-header:hover {
    background: rgba(0,0,0,0.03);
}

.feedback-check,
.feedback-check-placeholder {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.feedback-check-placeholder {
    cursor: default;
}

.feedback-header-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.feedback-header-preview {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
}

.feedback-item.done .feedback-header-preview {
    text-decoration: line-through;
    color: var(--text-muted);
}

.feedback-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.feedback-header-time {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.feedback-toast {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
    background: rgba(16,185,129,0.1);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    margin-top: 4px;
}
.feedback-toast.show {
    opacity: 1;
}
.feedback-item.feedback-new {
    background: rgba(16,185,129,0.08);
    transition: background 2s ease;
}
.feedback-item.feedback-new .feedback-item-header {
    background: transparent;
}
.feedback-header-user {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.feedback-header-replies {
    font-size: 10px;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.feedback-expand-arrow {
    font-size: 12px;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
}

/* Accordion body (expandable) */
.feedback-item-body {
    padding: 0 10px 10px 36px;
}

.feedback-message {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.feedback-item.done .feedback-message {
    text-decoration: line-through;
    color: var(--text-muted);
}

.feedback-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    align-items: center;
}

.feedback-user {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

.feedback-time {
    font-size: 10px;
    color: var(--text-muted);
}

.feedback-ref {
    font-size: 9px;
    font-weight: 700;
    background: var(--secondary);
    color: white;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.feedback-cat {
    font-size: 9px;
    font-weight: 600;
    background: #FEF3C7;
    color: #D97706;
    padding: 1px 5px;
    border-radius: 4px;
}

/* Actions */
.feedback-actions {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.feedback-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.feedback-action-btn:hover {
    background: var(--border);
    color: var(--primary);
}

.feedback-action-delete:hover {
    color: var(--error);
}

/* Replies */
.feedback-replies {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-reply {
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
    padding: 6px 10px;
    margin-left: 12px;
}

.feedback-reply-message {
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    white-space: pre-line;
    word-break: break-word;
}

.feedback-reply-meta {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    align-items: center;
    flex-wrap: wrap;
}

.feedback-reply-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.feedback-reply-actions .feedback-action-btn {
    padding: 2px 4px;
}

/* Status badge */
.feedback-status-badge {
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}

/* Reviewer name in header (ter beoordeling) */
.feedback-reviewer-mini {
    font-size: 9px;
    font-weight: 600;
    color: var(--warning);
    white-space: nowrap;
}

/* Review action buttons (Akkoord/Afwijzen) */
.feedback-review-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.feedback-review-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.feedback-review-btn.approve {
    background: var(--success);
    color: white;
}

.feedback-review-btn.reject {
    background: var(--error);
    color: white;
}

.feedback-review-btn.approve:hover { opacity: 0.85; }
.feedback-review-btn.reject:hover { opacity: 0.85; }

/* Feedback tile title */
.feedback-tile .feedback-tile-header .feedback-panel-title {
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ===== Checkpoint Post Pills ===== */
.cp-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}
.cp-pill.on          { background: var(--primary); color: white; }
.cp-pill.on.reg      { background: #F59E0B; color: white; }
.cp-pill.off         { background: #E5E7EB; color: #9CA3AF; }
.cp-pill.off.reg     { background: #FEF3C7; color: #D97706; }

.cp-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.cp-chip.on          { background: var(--primary); color: white; }
.cp-chip.on.reg      { background: #F59E0B; color: white; }
.cp-chip.off         { background: #E5E7EB; color: #374151; }
.cp-chip.off.reg     { background: #FEF3C7; color: #D97706; }

.cp-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    background: #FEF3C7;
    color: #D97706;
}

/* ========== News Ticker (fixed, aligned to prototype toolbar top) ========== */
.news-ticker {
    position: fixed;
    left: 20px;
    top: var(--feedback-top, 80px);
    width: 580px;
    z-index: 11;
    flex-shrink: 0;
    transition: opacity 0.3s, max-height 0.3s, transform 0.3s;
    max-height: 50px;
    overflow: hidden;
}

.news-ticker.hidden {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}

.news-ticker-content {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.news-ticker-text {
    flex: 1;
    min-width: 0;
}

.news-ticker-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.news-ticker-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* ========== Install Webapp Modal ========== */
.install-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.install-modal {
    background: white;
    border-radius: 20px;
    padding: 28px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: installModalIn 0.3s ease;
}

@keyframes installModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.install-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.install-modal-logo img {
    height: 52px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    background: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    padding: 6px 10px;
}

.install-modal-close {
    background: var(--primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.install-modal-close:hover {
    background: var(--primary-dark);
    color: white;
}

.install-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 6px;
}

.install-modal-subtitle {
    font-size: 13px;
    color: #64748B;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Steps */
.install-step {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.install-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #F26522);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-step-content {
    flex: 1;
    min-width: 0;
}

.install-step-title {
    font-size: 15px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 4px;
}

.install-step-desc {
    font-size: 13px;
    color: #64748B;
    margin: 0 0 8px;
    line-height: 1.5;
}

/* Link box */
.install-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 10px;
}

.install-link-url {
    flex: 1;
    font-size: 11px;
    color: var(--primary, #F26522);
    font-weight: 500;
    word-break: break-all;
    font-family: monospace;
}

.install-link-copy {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    color: #64748B;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.install-link-copy:hover {
    background: #F1F5F9;
    color: var(--primary, #F26522);
}

/* Platform instructions */
.install-platform {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.install-platform:last-child {
    margin-bottom: 0;
}

.install-platform-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1E293B;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E2E8F0;
}

.install-platform-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.install-mini-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.install-mini-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.install-modal-footer {
    margin-top: 20px;
    text-align: center;
}

.install-modal-footer .btn-primary {
    padding: 10px 32px;
    font-size: 14px;
}

/* ===== Permissions Panel (section inside feedback sidebar) ===== */
.permissions-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.perm-toggle-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-blue, #283583);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    user-select: none;
    transition: background 0.15s;
    flex-shrink: 0;
}
.perm-toggle-bar:hover { background: var(--admin-blue-hover, #1e2a6e); }
.perm-toggle-bar.active { border-radius: 12px 12px 4px 4px; }

.perm-badge {
    background: white;
    color: var(--admin-blue, #283583);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.perm-expand-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.15s, border-color 0.15s;
}
.perm-expand-btn:hover {
    background: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.8);
}

/* perm-toggle-arrow: now uses global .fold-btn (margin-left:0 because expand-btn has auto) */
.perm-toggle-arrow {
    margin-left: 0;
}

.perm-tile {
    background: var(--surface, white);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.perm-tile-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0;
}

/* Matrix header */
.perm-matrix-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #F9FAFB;
    border-bottom: 2px solid var(--border, #E5E7EB);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.perm-matrix-label-col {
    flex: 1;
    min-width: 0;
}

.perm-matrix-role-col {
    width: 72px;
    text-align: center;
    flex-shrink: 0;
}
.perm-matrix-role-col.editable {
    color: var(--admin-blue, #283583);
}
.perm-role-full {
    display: block;
    font-size: 7px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.7;
    white-space: nowrap;
}

.perm-matrix-action-col {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.perm-action-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    background: var(--background, #F9FAFB);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-secondary, #6B7280);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.perm-action-btn:active {
    background: var(--border, #E5E7EB);
}
.perm-btn-unlock {
    color: var(--text-muted, #9CA3AF);
}
.perm-btn-unlock:hover {
    color: var(--admin-blue, #283583);
    border-color: var(--admin-blue, #283583);
    background: #F5F3FF;
}
.perm-btn-undo {
    color: #D97706;
    border-color: #FBBF24;
}
.perm-btn-undo:hover {
    background: #FFFBEB;
    color: #B45309;
}
.perm-btn-save {
    color: #15803D;
    border-color: #22C55E;
}
.perm-btn-save:hover {
    background: #DCFCE7;
    color: #166534;
}
.perm-row-editing {
    background: #FEFCE8;
}
.perm-row-editing:hover {
    background: #FEF9C3;
}

/* Category headers */
.perm-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #F3F4F6;
    border-bottom: 1px solid var(--border, #E5E7EB);
    cursor: pointer;
    user-select: none;
}

/* perm-category-arrow: now uses global .fold-btn--light */

.perm-category-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perm-category-count {
    font-size: 10px;
    color: var(--text-muted, #9CA3AF);
    background: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* Permission rows */
.perm-matrix-row-wrap {
    border-bottom: 1px solid #F3F4F6;
}
.perm-matrix-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    min-height: 36px;
}
.perm-matrix-row:hover {
    background: #FAFAFA;
}
.perm-row-description {
    padding: 0 16px 8px;
    font-size: 12px;
    color: var(--text-muted, #6B7280);
    line-height: 1.4;
}
.perm-row-expanded {
    background: #F9FAFB;
}
.perm-row-expanded .perm-matrix-row {
    border-bottom: none;
}

.perm-matrix-row .perm-matrix-label-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.perm-label-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
}

.perm-impl-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    background: var(--text-muted, #9CA3AF);
    opacity: 0.4;
}
.perm-impl-dot.active {
    background: var(--success, #22C55E);
    opacity: 1;
}

.perm-filter-bar {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
}
.perm-filter-toggle {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-muted, #9CA3AF);
    background: transparent;
}
.perm-filter-toggle.active {
    background: var(--admin-blue, #3B82F6);
    color: white;
}

.perm-label-name {
    font-size: 9px;
    color: var(--text-muted, #9CA3AF);
    font-family: monospace;
}

.perm-label-editable:hover {
    background: rgba(124, 58, 237, 0.06);
    border-radius: 6px;
}
.perm-label-editable:hover .perm-label-text {
    color: var(--admin-blue, #283583);
}

/* Toggle cells */
.perm-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    height: 28px;
    transition: background 0.1s;
}
.perm-toggle.active {
    color: #15803D;
}
.perm-toggle.active.clickable:hover {
    background: #DCFCE7;
}
.perm-toggle.readonly {
    opacity: 0.7;
}
.perm-toggle-off {
    color: #DC2626;
    font-size: 14px;
    font-weight: 700;
}
.perm-toggle:not(.readonly).clickable:hover {
    background: #F3F4F6;
}

/* Edit button */
.perm-edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-muted, #9CA3AF);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.perm-edit-btn:hover {
    background: #F3F4F6;
    color: var(--admin-blue, #283583);
}

/* Quick input section */
.perm-quick-input {
    padding: 10px 12px;
    border-top: 2px solid var(--border, #E5E7EB);
    background: #FAFAFA;
}

.perm-quick-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.perm-quick-row {
    display: flex;
    gap: 4px;
}

.perm-quick-field {
    padding: 6px 8px;
    border: 1.5px solid var(--border, #E5E7EB);
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    box-sizing: border-box;
}
.perm-quick-field:focus {
    border-color: var(--admin-blue, #283583);
    outline: none;
}

.perm-quick-add-btn {
    background: var(--admin-blue, #283583);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.perm-quick-add-btn:hover {
    background: var(--admin-blue-hover, #1e2a6e);
}

/* Add permission inline fields */
.perm-add-field {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--border, #E5E7EB);
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
    background: white;
    color: var(--text-primary, #1F2937);
}
.perm-add-field:focus {
    border-color: var(--admin-blue, #283583);
    outline: none;
}
.perm-add-field-mono {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted, #9CA3AF);
}

/* Add permission form layout */
.perm-add-form {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FAFFF8;
}
.perm-add-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.perm-add-row--split {
    flex-direction: row;
    gap: 8px;
}
.perm-add-row--split > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.perm-add-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.perm-add-roles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.perm-add-role-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1.5px solid var(--border, #E5E7EB);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.perm-add-role-item:hover {
    border-color: var(--text-muted, #9CA3AF);
}
.perm-add-role-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #FEE2E2;
    color: #DC2626;
}
.perm-add-role-toggle.active {
    background: #DCFCE7;
    color: #15803D;
}
.perm-add-role-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
}
.perm-add-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: #15803D;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    align-self: flex-start;
}
.perm-add-submit:hover {
    background: #166534;
}

/* ============================================================
   App Toast — 10px onder de header (112px in prototype)
   ============================================================ */
.app-toast {
    position: absolute;
    top: 122px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    text-align: center;
}

.app-toast.toast-success { background: #22C55E; color: #FFFFFF; }
.app-toast.toast-error   { background: #EF4444; color: #FFFFFF; }
.app-toast.toast-warning { background: #F59E0B; color: #FFFFFF; }

.app-toast.app-toast-persistent {
    pointer-events: auto;
    white-space: normal;
    max-width: 280px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}
.app-toast-persistent .toast-msg {
    flex: 1;
}
.app-toast-persistent .toast-close {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
}

/* ============================================================
   Admin Modal Overlay — herbruikbaar voor admin/PO/PM popups
   Gebruik: .admin-modal-overlay > .admin-modal-backdrop + .admin-modal-panel
   ============================================================ */
.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}
.admin-modal-overlay.active {
    display: flex;
}
.admin-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}
.admin-modal-panel {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 760px;
    max-height: 85vh;
    background: var(--background, #F9FAFB);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: white;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}
.admin-modal-title {
    font-size: 17px;
    font-weight: 700;
}
.admin-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.admin-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}
.admin-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 16px;
    min-height: 0;
    background: var(--background, #F9FAFB);
}

/* ============================================================
   Permissies modal body overrides
   ============================================================ */
#permFullscreenBody .perm-matrix-label-col {
    flex: 1;
    min-width: 0;
}
#permFullscreenBody .perm-matrix-role-col {
    width: 80px;
}
#permFullscreenBody .perm-matrix-row {
    padding: 8px 16px;
    min-height: 44px;
}
#permFullscreenBody .perm-matrix-row-wrap {
    background: white;
}
#permFullscreenBody .perm-row-description {
    padding: 0 20px 10px;
    font-size: 13px;
}
#permFullscreenBody .perm-label-text {
    font-size: 14px;
}
#permFullscreenBody .perm-label-name {
    font-size: 10px;
}
#permFullscreenBody .perm-matrix-header {
    font-size: 13px;
    padding: 12px 16px;
    letter-spacing: 0.3px;
    color: var(--text-secondary, #6B7280);
}
#permFullscreenBody .perm-role-full {
    font-size: 10px;
    opacity: 0.85;
}
#permFullscreenBody .perm-matrix-role-col {
    width: 90px;
}
/* Category group cards */
#permFullscreenBody .perm-category {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, #E5E7EB);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
#permFullscreenBody .perm-category-header {
    padding: 12px 16px;
    background: var(--admin-blue, #283583);
    border-bottom: none;
}
#permFullscreenBody .perm-category-label {
    font-size: 13px;
    color: white;
    letter-spacing: 0.3px;
}
#permFullscreenBody .perm-category-arrow {
    color: rgba(255, 255, 255, 0.7);
}
#permFullscreenBody .fold-btn.fold-btn--light {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
#permFullscreenBody .fold-btn.fold-btn--light:hover {
    background: rgba(255, 255, 255, 0.35);
}
#permFullscreenBody .perm-category-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
/* Add section */
#permFullscreenBody .perm-add-section {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, #E5E7EB);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ===== SCREEN 8: EVENT DASHBOARD ===== */

/* Dashboard scroll area */
.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

/* Deelnemers grid: 4 sub-tiles op één rij */
.p8-deelnemers-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; margin-bottom: 10px; }

/* Hero section: deelnemers + sub-tiles */
.p8-hero { display: flex; gap: 10px; margin-bottom: 10px; }
.p8-hero-main {
    background: white; border-radius: var(--radius, 12px); padding: 16px 12px;
    text-align: center; flex: 0 0 120px; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
}
.p8-hero-main-icon {
    width: 36px; height: 36px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 6px;
    background: var(--background); color: var(--text-secondary);
}
.p8-hero-main-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p8-hero-main-value { font-size: 36px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.p8-hero-main-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 4px; }

/* Dashboard tile update flash — subtle fade overlay */
@keyframes p8-tile-flash {
    0%   { box-shadow: inset 0 0 0 50px rgba(0, 162, 191, 0.25); }
    100% { box-shadow: inset 0 0 0 50px rgba(0, 162, 191, 0); }
}
.p8-flash {
    animation: p8-tile-flash 3s ease-out;
}

/* Sub-tiles grid */
.p8-sub-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.p8-sub-tile {
    background: white; border-radius: 10px; padding: 8px 6px; text-align: center;
    cursor: pointer; transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
    display: flex; flex-direction: column; justify-content: center;
    border: 1px solid var(--border);
}
.p8-sub-tile:active { transform: scale(0.95); }
.p8-sub-tile-value { font-size: 18px; font-weight: 800; line-height: 1.1; }
.p8-sub-tile-label {
    font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2px;
    margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.p8-sub-tile-total { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* Expandable tile indicator — corner triangle */
.p8-tile-expandable { position: relative; overflow: hidden; }
.p8-tile-expandable::after { content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent currentColor transparent; opacity: 0.3; transition: opacity 0.2s; }
.p8-tile-active.p8-tile-expandable::after, .p8-cp-active.p8-tile-expandable::after { opacity: 0.6; }

/* Sub-tile color variants */
.p8-sub-error { background: var(--error) !important; border-color: var(--error) !important; }
.p8-sub-error .p8-sub-tile-value { color: white !important; }
.p8-sub-error .p8-sub-tile-label { color: white !important; }
.p8-sub-primary .p8-sub-tile-value { color: var(--primary); }
.p8-sub-primary .p8-sub-tile-label { color: var(--primary); }
.p8-sub-warning .p8-sub-tile-value { color: var(--warning); }
.p8-sub-warning .p8-sub-tile-label { color: var(--warning); }
.p8-sub-success .p8-sub-tile-value { color: var(--success); }
.p8-sub-success .p8-sub-tile-label { color: var(--success); }
.p8-sub-tile.p8-sub-success.p8-tile-completed { background: var(--success); border-color: var(--success); }
.p8-tile-completed .p8-sub-tile-value { color: #fff !important; }
.p8-tile-completed .p8-sub-tile-label { color: rgba(255,255,255,0.9) !important; }
.p8-tile-completed .p8-sub-tile-total { color: rgba(255,255,255,0.7); }
.p8-tile-completed .p8-cp-progress-bar { background: rgba(255,255,255,0.4) !important; }
.p8-sub-neutral .p8-sub-tile-value { color: var(--text-secondary); }
.p8-sub-neutral .p8-sub-tile-label { color: var(--text-secondary); }
.p8-sub-live { background: var(--primary); }
.p8-sub-live .p8-sub-tile-value { color: white; }
.p8-sub-live .p8-sub-tile-label { color: rgba(255,255,255,0.85); }
.p8-sub-tile-wide { grid-column: 1 / -1; }

/* CP sub-tile variant */
.p8-sub-cp { border-top: 2px solid var(--border); padding: 8px 6px; }
.p8-cp-progress { width: 100%; height: 4px; background: var(--background); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.p8-cp-progress-bar { height: 100%; border-radius: 2px; transition: width 0.4s ease; }

/* PassPoints grid (3 kolommen) */
.p8-cp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.p8-act-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.p8-act-grid .p8-sub-tile { min-width: 0; overflow: hidden; }
.p8-act-grid .p8-sub-tile-label { display: flex; gap: 2px; }
.p8-act-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; min-width: 0; }
.p8-cp-grid .p8-sub-tile { cursor: pointer; border: 1px solid var(--border); transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s; }
.p8-cp-grid .p8-sub-tile:active { transform: scale(0.95); }
.p8-cp-grid .p8-sub-tile.p8-cp-active { border: 2px solid var(--primary); box-shadow: 0 2px 8px rgba(0,162,191,0.2); }
.p8-cp-grid.has-cp-active .p8-sub-tile:not(.p8-cp-active) { opacity: 0.5; }
.p8-cp-expand { grid-column: 1 / -1; }

/* Event progress bar */
.p8-event-progress { background: white; border-radius: var(--radius, 12px); padding: 12px 14px; margin-top: 12px; margin-bottom: 12px; border: 1px solid var(--border); }
.p8-event-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.p8-event-progress-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.p8-event-progress-pct { font-size: 13px; font-weight: 700; color: var(--success); }
.p8-progress { width: 100%; height: 8px; background: var(--background); border-radius: 4px; overflow: hidden; }
.p8-progress-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.p8-progress-success { background: var(--success); }
.p8-progress-warning { background: var(--warning); }
.p8-progress-primary { background: var(--primary); }
.p8-progress-error { background: var(--error); }
.p8-progress-segmented { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--background); }
.p8-progress-segmented > div { height: 100%; transition: width 0.4s ease; }
.p8-event-progress-legend { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.p8-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-muted); }
.p8-legend-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Stuurinformatie grid */
.p8-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.p8-grid .p8-sub-tile { cursor: pointer; border: 1px solid var(--border); transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s; }
.p8-grid .p8-sub-tile:active { transform: scale(0.95); }
.p8-grid .p8-sub-tile.p8-tile-active { border: 2px solid var(--primary); box-shadow: 0 2px 8px rgba(0,162,191,0.2); }
.p8-grid .p8-sub-tile.p8-sub-error.p8-tile-active { box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.p8-grid .p8-sub-tile.p8-sub-warning.p8-tile-active { background: var(--warning) !important; border-color: var(--warning) !important; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.p8-grid .p8-sub-tile.p8-sub-warning.p8-tile-active .p8-sub-tile-value,
.p8-grid .p8-sub-tile.p8-sub-warning.p8-tile-active .p8-sub-tile-label,
.p8-grid .p8-sub-tile.p8-sub-warning.p8-tile-active .p8-sub-tile-total { color: white !important; }
.p8-grid .p8-sub-tile.p8-sub-primary.p8-tile-active { background: var(--primary) !important; border-color: var(--primary) !important; box-shadow: 0 2px 8px rgba(0,162,191,0.3); }
.p8-grid .p8-sub-tile.p8-sub-primary.p8-tile-active .p8-sub-tile-value,
.p8-grid .p8-sub-tile.p8-sub-primary.p8-tile-active .p8-sub-tile-label,
.p8-grid .p8-sub-tile.p8-sub-primary.p8-tile-active .p8-sub-tile-total { color: white !important; }
.p8-grid .p8-sub-tile.p8-sub-success.p8-tile-active { background: var(--success) !important; border-color: var(--success) !important; box-shadow: 0 2px 8px rgba(34,197,94,0.3); }
.p8-grid .p8-sub-tile.p8-sub-success.p8-tile-active .p8-sub-tile-value,
.p8-grid .p8-sub-tile.p8-sub-success.p8-tile-active .p8-sub-tile-label,
.p8-grid .p8-sub-tile.p8-sub-success.p8-tile-active .p8-sub-tile-total { color: white !important; }
.p8-grid.has-active .p8-sub-tile:not(.p8-tile-active):not(.p8-sub-live) { opacity: 0.5; }

/* Expand panels */
.p8-expand { margin: 0; padding: 0; display: none; }
.p8-cp-grid .p8-expand { grid-column: 1 / -1; }
.p8-expand.p8-expand-open { display: block; margin-top: 10px; }
.p8-expand-inner { background: white; border-radius: var(--radius, 12px); padding: 14px; border: 1px solid var(--border); }
.p8-expand-inner.p8-miller-container { background: transparent; border: none; padding: 0; }
.p8-expand-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 10px; }
.p8-empty-state { padding: 12px 16px; font-size: 13px; color: var(--text-muted); }
.p8-miller-container.p8-miller-empty { background: white; border: 1px solid var(--border); border-radius: var(--radius, 12px); padding: 0; }
.p8-miller-container.p8-miller-empty .p8-miller-col-1 { flex: 1 1 100%; }
.p8-miller-container.p8-miller-empty .p8-miller-col-2, .p8-miller-container.p8-miller-empty .p8-miller-col-3 { display: none !important; }
.p8-expand-row { display: flex; align-items: center; padding: 8px 6px 8px 10px; gap: 6px; background: white; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 4px; transition: background 0.2s ease; }
.p8-act-icon { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p8-expand-row:last-child { margin-bottom: 0; }
.p8-expand-row-label { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-primary); min-width: 0; }
.p8-expand-row-value { min-width: 24px; height: 20px; background: var(--background); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--text-secondary); flex-shrink: 0; padding: 0 5px; }
.p8-drill-chevron { flex-shrink: 0; }

.p8-expand-link {
    display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
    color: var(--primary); cursor: pointer; padding-top: 10px; margin-top: 6px;
    border-top: 1px solid var(--background);
}

/* Status dots */
.p8-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.p8-dot-success { background: var(--success); }
.p8-dot-warning { background: var(--warning); }
.p8-dot-error { background: var(--error); }
.p8-dot-primary { background: var(--primary); }

/* Drill-down navigation */
.p8-drill-row { cursor: pointer; transition: background 0.15s; }
.p8-drill-row:hover { background: var(--background); }
.p8-drill-chevron { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p8-drill-back { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; padding-bottom: 8px; border-bottom: 1px solid var(--background); margin-bottom: 4px; }
.p8-drill-chevron-back { width: 14px; height: 14px; stroke: var(--primary); }
.p8-drill-breadcrumb { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--background); flex-wrap: wrap; }
.p8-drill-breadcrumb-home { width: 26px; height: 26px; border-radius: 6px; background: var(--warning); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: transform 0.1s; }
.p8-drill-breadcrumb-home:active { transform: scale(0.9); }
.p8-drill-breadcrumb-home-error { background: var(--error); }
.p8-drill-breadcrumb-sep { width: 12px; height: 12px; flex-shrink: 0; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p8-drill-breadcrumb-link { font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; }
.p8-drill-breadcrumb-link:hover { text-decoration: underline; }
.p8-drill-breadcrumb-current { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

/* Drill-down detail (niveau 3) */
.p8-drill-detail-card { background: white; border-radius: 12px; padding: 14px; border: 1px solid var(--border); }
.p8-drill-detail-header { display: flex; align-items: center; gap: 10px; padding: 0 0 8px; }
.p8-drill-detail-info { min-width: 0; }
.p8-drill-detail-name { font-size: 14px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p8-drill-detail-status { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.p8-drill-phone-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: white; cursor: pointer; vertical-align: middle; margin-left: 4px; }
.p8-drill-phone-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
body.perm--participant_view_contact .p8-drill-phone-btn[data-perm] { display: inline-flex !important; }
.p8-drill-detail-metrics { display: flex; gap: 6px; margin: 6px 0 10px; }
.p8-drill-detail-metric { flex: 1; background: var(--background); border-radius: 8px; padding: 8px 6px; text-align: center; }
.p8-drill-detail-metric-val { font-size: 15px; font-weight: 800; line-height: 1.2; }
.p8-drill-detail-metric-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.p8-drill-detail-cp-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.p8-drill-detail-cp-list { background: var(--background); border-radius: 8px; overflow: hidden; }
.p8-drill-detail-cp-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid white; }
.p8-drill-detail-cp-row:last-child { border-bottom: none; }
.p8-drill-detail-cp-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: white; font-size: 9px; flex-shrink: 0; }
.p8-drill-detail-cp-name { flex: 1; font-size: 12px; font-weight: 500; }
.p8-drill-detail-cp-time { font-size: 12px; min-width: 40px; text-align: right; }

/* P7 checkpoint registreer-button (vrijwilliger op post) */
.p7-my-post { background: var(--primary-light); }
.p7-cp-register-btn { background: var(--primary); color: white; border: none; padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.p7-cp-register-btn:active { opacity: 0.7; }

/* Progress bar (voortgangsbalk, globaal herbruikbaar) */
.pp-progress-track { position: relative; height: 48px; margin: 0 11px 2px; overflow: visible; }
.pp-progress-bar { position: absolute; top: 31px; left: 0; right: 0; height: 5px; background: var(--background); border-radius: 2.5px; }
.pp-progress-fill { height: 100%; border-radius: 2.5px; transition: width 0.4s ease; }
.pp-progress-cp { position: absolute; top: 23px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 2; }
.pp-progress-cp-eta { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text-muted); white-space: nowrap; margin-bottom: 2px; line-height: 1.3; text-align: center; }
.pp-progress-cp-badge { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; line-height: 1; }
.pp-progress-km-row { position: relative; height: 14px; margin: 0 11px 8px; }
.pp-progress-km-label { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 10px; color: var(--text-muted); }
.pp-progress-active { position: absolute; top: 0; height: 100%; border-radius: 2.5px; overflow: hidden; background-size: 17px 17px; animation: pp-progress-slide 0.8s linear infinite; opacity: 0.7; }
@keyframes pp-progress-slide { 0% { background-position: 0 0; } 100% { background-position: 17px 0; } }
.pp-progress-runner { position: absolute; top: 15px; transform: translateX(-50%); z-index: 4; pointer-events: none; }
.pp-progress-runner-icon { fill: none; stroke: var(--text-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 2px rgba(255,255,255,0.9)) drop-shadow(0 0 2px rgba(255,255,255,0.9)); animation: pp-runner-bob 2s ease-in-out infinite; }
@keyframes pp-runner-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.pp-progress-runner-finished { top: 1px; }
.pp-progress-runner-finished .pp-progress-runner-icon { animation: none; }
.pp-progress-finish-flag { position: absolute; top: -3px; right: -5px; width: 9px; height: 9px; fill: none; stroke: var(--success); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Drill-down overdue badges */
.p8-drill-badge-warning { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: #FFF7ED; color: #92400E; white-space: nowrap; }

/* Miller columns (tablet/desktop drill-down) */
.p8-miller-col { display: none; }
.p8-miller-col.p8-miller-active { display: block; }
@media (min-width: 768px) {
    .p8-miller-container { display: flex; gap: 0; }
    .p8-miller-container .p8-miller-col { display: none; flex: 1; min-width: 0; max-height: 400px; overflow-y: auto; padding-right: 10px; }
    .p8-miller-container .p8-miller-col.p8-miller-active { display: block; }
    .p8-miller-container .p8-miller-col + .p8-miller-col.p8-miller-active { padding-left: 4px; }
    .p8-miller-container .p8-miller-col-1 { flex: 0 0 22%; }
    .p8-miller-container .p8-miller-col-2 { flex: 0 0 34%; }
    .p8-miller-container .p8-miller-col-3 { flex: 0 0 44%; max-height: none; overflow-y: visible; }
    .p8-miller-container .p8-drill-breadcrumb { display: none; }
    .p8-miller-selected { border-radius: 8px; }
    /* Geselecteerde deelnemer: default warning (aandacht/lang onderweg) */
    .scan-item.p8-miller-selected { background: var(--warning) !important; border-color: var(--warning) !important; }
    .scan-item.p8-miller-selected .num-badge { background: white !important; color: var(--warning) !important; }
    .scan-item.p8-miller-selected .scan-name { color: white !important; }
    .scan-item.p8-miller-selected .scan-info { color: white !important; }
    /* Geselecteerde deelnemer: pending/onderweg variant (blauw) */
    .scan-item.scan-pending.p8-miller-selected { background: var(--primary) !important; border-color: var(--primary) !important; }
    .scan-item.scan-pending.p8-miller-selected .num-badge { background: white !important; color: var(--primary) !important; }
    /* Geselecteerde deelnemer: registered/gefinisht variant (groen) */
    .scan-item.scan-registered.p8-miller-selected { background: var(--success) !important; border-color: var(--success) !important; }
    .scan-item.scan-registered.p8-miller-selected .num-badge { background: white !important; color: var(--success) !important; }
    /* Geselecteerde deelnemer: error variant (niet-aangemeld) */
    .scan-item.scan-error.p8-miller-selected { background: var(--error) !important; border-color: var(--error) !important; }
    .scan-item.scan-error.p8-miller-selected .num-badge { background: white !important; color: var(--error) !important; }
    .scan-item.scan-error.p8-miller-selected .scan-name { color: white !important; }
    .scan-item.scan-error.p8-miller-selected .scan-info { color: white !important; }
    /* Geselecteerde activiteit: achtergrond via JS inline style */
    .p8-expand-row.p8-miller-selected { color: white !important; }
    .p8-expand-row.p8-miller-selected .p8-expand-row-label { color: white !important; }
    .p8-expand-row.p8-miller-selected .p8-expand-row-value { background: rgba(255,255,255,0.25) !important; color: white !important; }
    .p8-expand-row.p8-miller-selected .p8-drill-chevron { stroke: white !important; }
    .p8-expand-row.p8-miller-selected .p8-act-icon .sfo-icon { stroke: var(--primary) !important; }
}

/* Alert items */
.p8-alert-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid var(--background); }
.p8-alert-item:last-child { border-bottom: none; }
.p8-alert-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; margin-top: 1px; }

/* Notificatie items */
.p8-notif-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--background); }
.p8-notif-item:last-child { border-bottom: none; }
.p8-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.p8-notif-text { flex: 1; font-size: 13px; color: var(--text-primary); }
.p8-notif-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Section title */
.p8-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 4px 8px; display: flex; align-items: center; gap: 10px; }
.p8-completed-toggle { display: inline-flex; align-items: center; gap: 4px; background: var(--background); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 10px; font-weight: 600; color: var(--text-muted); cursor: pointer; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.p8-completed-toggle:active { background: var(--border); }
.p8-completed-toggle svg { flex-shrink: 0; }

/* Centrale voltooid-toggle floating rechts */
.p8-hide-completed-btn {
    display: inline-flex; align-items: center; gap: 4px;
    position: absolute; top: 120px; right: 10px; z-index: 90;
    padding: 5px 10px;
    background: var(--admin-blue); color: rgba(255,255,255,0.9);
    border: none; border-radius: 6px;
    font-size: 10px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.p8-hide-completed-btn:active { background: color-mix(in srgb, var(--admin-blue) 85%, black); }
.p8-hide-completed-btn svg { flex-shrink: 0; }

/* ===== P8 Floating Close Button (landscape) ===== */
.p8-floating-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 150;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.15);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.landscape-phone-frame .p8-floating-close,
.p8-live-overlay.active .p8-floating-close {
    display: flex;
    top: 8px;
    right: 12px;
}
/* Verberg floating close wanneer header zichtbaar is (tablet/desktop) */
.landscape-tablet-frame .p8-live-modal .p8-floating-close,
.landscape-desktop-frame .p8-live-modal .p8-floating-close { display: none !important; }
@media (orientation: landscape) {
    .p8-live-modal .p8-floating-close { display: none !important; }
}
/* Maar toon floating close in landscape-phone (header is daar verborgen) */
.landscape-phone-frame .p8-live-modal .p8-floating-close { display: flex !important; }
/* Verberg dashboard close wanneer live overlay actief is */
#screen-dashboard:has(.p8-live-overlay.active) > .p8-floating-close { display: none !important; }

/* ===== P8 Portrait Blocker ===== */
/* Default: verborgen. Alleen zichtbaar in PWA portrait modus op small screens */
.p8-portrait-blocker {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 200;
    background: var(--primary);
    color: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px;
}
.p8-portrait-blocker svg { animation: p8-live-rotate-phone 1.5s ease-in-out infinite alternate; }
.p8-portrait-blocker p { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.4; }
.p8-portrait-hint { font-size: 13px; opacity: 0.8; }
.p8-portrait-close {
    margin-top: 8px; padding: 10px 24px; border: 2px solid rgba(255,255,255,0.5);
    border-radius: 8px; background: none; color: white; font-size: 15px;
    font-weight: 600; cursor: pointer;
}
.p8-portrait-close:hover { background: rgba(255,255,255,0.15); }
/* Portrait: toon blocker (phone-frame = altijd portrait, PWA portrait op smal scherm) */
.phone-frame .p8-portrait-blocker { display: flex; }
@media (max-width: 600px) and (orientation: portrait) {
    .p8-portrait-blocker { display: flex; }
}
/* Landscape frames: verberg blocker */
.landscape-phone-frame .p8-portrait-blocker,
.landscape-tablet-frame .p8-portrait-blocker,
.landscape-desktop-frame .p8-portrait-blocker { display: none !important; }
@media (orientation: landscape) {
    .p8-portrait-blocker { display: none; }
}

/* ===== TIJDLIJN (Gantt-stijl) ===== */
.p8-timeline { background: white; border-radius: var(--radius, 12px); padding: 14px; margin-bottom: 12px; overflow-x: hidden; overflow-y: visible; border: 1px solid var(--border); }
.p8-timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.p8-timeline-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.p8-timeline-axis { display: flex; justify-content: space-between; padding: 7px 0 0; position: relative; margin-left: 72px; margin-bottom: 0; }
.p8-timeline-axis-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.p8-timeline-axis-minor { font-size: 0; width: 1px; background: var(--border); height: 6px; align-self: flex-end; }

/* Timeline rows */
.p8-timeline-row { display: flex; align-items: center; padding: 5px 0; }
.p8-timeline-row-label { width: 68px; flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--text-primary); padding-right: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: -72px; }
.p8-timeline-row-track { flex: 1; height: 22px; position: relative; background: var(--background); border-radius: 4px; }
.p8-timeline-bar {
    position: absolute; top: 2px; height: 18px; border-radius: 3px; display: flex;
    align-items: center; justify-content: center; font-size: 8px; font-weight: 700;
    color: white; letter-spacing: 0.2px; min-width: 20px;
}
.p8-timeline-bar-done { background: var(--primary); }
.p8-timeline-bar-complete { background: var(--success); }
.p8-timeline-bar-active { background: var(--primary); box-shadow: 0 1px 4px rgba(0,162,191,0.3); }
.p8-timeline-bar-registration { background: var(--warning); }
.p8-timeline-bar-registration.p8-timeline-bar-done { background: var(--warning); }
.p8-timeline-bar-registration.p8-timeline-bar-complete { background: var(--success); }
.p8-timeline-bar-upcoming { background: var(--text-muted); opacity: 0.35; }

/* Progress strip in timeline bars */
.p8-timeline-bar-progress { position: absolute; bottom: 2px; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.18); z-index: 2; }
.p8-timeline-bar-progress-fill { height: 100%; border-radius: 2px; background: rgba(255,255,255,0.9); transition: width 0.4s ease; }
.p8-timeline-row-complete .p8-timeline-bar-progress { display: none; }

/* Time labels in bars */
.p8-timeline-bar-times { display: flex; justify-content: space-between; width: 100%; padding: 0 4px; font-size: 7px; font-weight: 600; opacity: 0.9; box-sizing: border-box; z-index: 1; }

/* Now indicator */
.p8-timeline-body { position: relative; padding-top: 0; margin-left: 72px; }
.p8-tl-badge-name { display: none; }
.p8-tl-filter-badge { touch-action: manipulation; }
.p8-timeline-now-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--admin-blue); z-index: 5; pointer-events: none; }
.p8-timeline-now-pill {
    position: absolute; top: -25px; left: 50%; transform: translateX(-50%);
    background: var(--admin-blue); color: white; font-size: 8px; font-weight: 700;
    padding: 2px 8px; border-radius: 8px; white-space: nowrap; display: flex;
    align-items: center; gap: 4px; z-index: 3; box-shadow: 0 1px 4px rgba(40,53,131,0.3);
}
.p8-timeline-now-pill::after { display: none; }
.p8-timeline-now-pill-dot { width: 5px; height: 5px; border-radius: 50%; background: white; animation: p8-pulse-white 2s ease-in-out infinite; }
@keyframes p8-pulse-white { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Prognose toggle */
/* Prognose bars (eind = rechts van bar, start = links van bar) */
.p8-prognose-bar { position: absolute; top: 2px; height: 18px; border-radius: 0 3px 3px 0; display: flex; align-items: center; justify-content: center; z-index: 1; }
.p8-prognose-bar-start { border-radius: 3px 0 0 3px; }
.p8-prognose-overrun {
    background: repeating-linear-gradient(-45deg, var(--warning), var(--warning) 3px, rgba(249,152,28,0.5) 3px, rgba(249,152,28,0.5) 6px);
    box-shadow: 0 1px 4px rgba(249,152,28,0.3);
}
.p8-prognose-early {
    background: repeating-linear-gradient(-45deg, var(--success), var(--success) 3px, rgba(16,185,129,0.5) 3px, rgba(16,185,129,0.5) 6px);
    border-radius: 3px; box-shadow: 0 1px 4px rgba(16,185,129,0.3);
}
.p8-prognose-bar-start.p8-prognose-early { border-radius: 3px 0 0 3px; }
.p8-prognose-bar-start.p8-prognose-overrun { border-radius: 3px 0 0 3px; }
.p8-prognose-overrun .p8-prognose-time, .p8-prognose-early .p8-prognose-time { display: none; }
.p8-prognose-delta { position: absolute; top: -11px; font-size: 8px; font-weight: 700; white-space: nowrap; transform: translateX(-100%); }
.p8-prognose-delta-start { transform: none; }
.p8-prognose-delta-warn { color: var(--warning); }
.p8-prognose-delta-ok { color: var(--success); }
.p8-timeline .p8-timeline-row-track { overflow: visible; }

/* Timeline info button — extends global .sfo-info-btn */
.p8-timeline-info-btn {
    margin-left: 4px;
}

/* Timeline info modal */
.p8-info-overlay { display: none; position: absolute; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.p8-info-overlay.active { display: flex; }
.p8-info-modal { position: relative; background: white; border-radius: 12px; padding: 20px; max-width: 320px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2); max-height: calc(100vh - 32px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.p8-info-modal h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0 0 12px; }
.p8-info-modal-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.p8-info-modal-dot { width: 16px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.p8-info-modal-label { font-size: 12px; color: var(--text-primary); font-weight: 600; }
.p8-info-modal-desc { font-size: 11px; color: var(--text-secondary); margin-left: 26px; margin-top: -2px; padding-bottom: 4px; }
.p8-info-modal-close { display: block; width: 100%; margin-top: 16px; padding: 10px; border: none; border-radius: 8px; background: var(--primary); color: white; font-size: 13px; font-weight: 700; cursor: pointer; }
.p8-info-modal-close-icon { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: none; background: rgba(0,0,0,0.08); color: var(--text-secondary); font-size: 18px; line-height: 1; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.p8-info-modal-close-icon:hover { background: rgba(0,0,0,0.15); }

/* ============================================================
   Live PassPoint Monitor (fullscreen modal vanuit P8)
   ============================================================ */
.p8-participant-modal { display: none; position: absolute; inset: 0; z-index: 170; background: var(--background); }
.p8-participant-modal.active { display: block; }
.p8-live-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 160;
    background: var(--background);
}
.p8-live-overlay.active {
    display: flex;
}
.p8-live-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--background);
    position: relative;
}
.p8-live-modal-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 16px;
    background: var(--admin-blue);
    color: white;
    flex-shrink: 0;
    z-index: 160;
    position: relative;
}
.p8-live-modal-header > :first-child {
    justify-self: start;
}
.p8-live-modal-header > :last-child {
    justify-self: end;
}
.p8-live-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Default: header verbergen (mobile toont alleen badges + floating close) */
.p8-live-modal-header { display: none; }
/* PWA landscape: header tonen */
@media (orientation: landscape) {
    .p8-live-modal-header { display: grid; }
}
/* Prototype landscape phone: geen header */
.landscape-phone-frame .p8-live-modal-header { display: none !important; }
/* Prototype landscape tablet/desktop: header tonen + match app-bar.admin dimensions */
.landscape-tablet-frame .p8-live-modal-header,
.landscape-desktop-frame .p8-live-modal-header {
    display: grid !important;
    height: 48px;
    padding: 0 20px;
    font-size: 17px;
}
/* Bottom-nav zichtbaar boven live overlay */
.landscape-tablet-frame #screen-dashboard:has(.p8-live-overlay.active) > .bottom-nav,
.landscape-desktop-frame #screen-dashboard:has(.p8-live-overlay.active) > .bottom-nav {
    position: relative;
    z-index: 170;
}
/* Live overlay: bottom-nav respecteren via gemeten hoogte */
.p8-live-overlay.active {
    bottom: var(--live-nav-h, 0px);
}
#screen-dashboard:has(.p8-live-overlay.active) > .bottom-nav {
    position: relative;
    z-index: 170;
}
/* Badge bar wrapper */
.p8-live-cp-badges-bar {
    display: flex;
    align-items: center;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    padding-right: 8px;
}
/* PassPoint badge toggles */
.p8-live-cp-badges {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
}
.p8-live-cp-badge {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.p8-live-cp-badge.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.p8-live-cp-badge.active-reg {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

/* Live PassPoint tile beeldmerk */
.p8-live-beeldmerk {
    width: 24px;
    height: 24px;
    animation: p8-live-pulse 2s ease-in-out infinite;
    overflow: visible;
}
.p8-live-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 14px 14px 0;
    border-color: transparent rgba(255,255,255,0.35) transparent transparent;
    border-radius: 0 10px 0 0;
}
@keyframes p8-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* Landscape button pulse hint wanneer portrait-blocker zichtbaar is */
.p8-live-hint-pulse {
    animation: p8-live-btn-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes p8-live-btn-pulse {
    0%, 100% { background: transparent; color: inherit; }
    50% { background: #43B5B5; color: white; }
}

/* Portrait rotate prompt — toont "kantel je scherm" in portrait, verbergt in landscape */
.p8-live-rotate-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px;
    width: 100%;
    height: 100%;
    background: var(--primary, #F26522);
    color: white;
}
.p8-live-rotate-prompt svg {
    animation: p8-live-rotate-phone 1.5s ease-in-out infinite alternate;
}
.p8-live-rotate-prompt p {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}
.p8-live-rotate-hint {
    font-size: 13px;
    opacity: 0.8;
}
.p8-live-rotate-close {
    margin-top: 8px;
    padding: 10px 24px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    background: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.p8-live-rotate-close:hover {
    background: rgba(255,255,255,0.15);
}
@keyframes p8-live-rotate-phone {
    from { transform: rotate(0deg); }
    to { transform: rotate(-90deg); }
}
/* Default: portrait — toon rotate prompt, verberg modal */
.p8-live-overlay .p8-live-modal {
    display: none;
}
/* Prototype phone-frame: forceer portrait (rotate prompt) — overschrijft media query */
.phone-frame .p8-live-rotate-prompt {
    display: flex !important;
}
.phone-frame .p8-live-overlay .p8-live-modal {
    display: none !important;
}
/* PWA landscape: verberg prompt, toon modal */
@media (orientation: landscape) {
    .p8-live-rotate-prompt {
        display: none;
    }
    .p8-live-overlay .p8-live-modal {
        display: flex;
    }
}
/* Prototype landscape frames: toon modal (overrulet phone-frame) */
.landscape-phone-frame .p8-live-rotate-prompt,
.landscape-tablet-frame .p8-live-rotate-prompt,
.landscape-desktop-frame .p8-live-rotate-prompt {
    display: none !important;
}
.landscape-phone-frame .p8-live-overlay .p8-live-modal,
.landscape-tablet-frame .p8-live-overlay .p8-live-modal,
.landscape-desktop-frame .p8-live-overlay .p8-live-modal {
    display: flex !important;
}

/* Monitor content area */
.p8-live-monitor-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.p8-live-monitor-grid {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.p8-live-record-list {
    padding: 12px 16px;
    overflow-y: auto;
    height: 100%;
}
.p8-live-monitor-detail {
    display: none;
}
.p8-live-detail-content {
    padding: 16px;
    overflow-y: auto;
    height: 100%;
}
/* Empty state — gecentreerd icoon + tekst in beide kolommen */
.p8-live-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    min-height: 200px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}
.p8-live-empty-state .sfo-icon {
    opacity: 0.25;
}

/* PWA landscape: 2-koloms split */
@media (min-width: 768px) {
    .p8-live-monitor-split {
        flex-direction: row;
    }
    .p8-live-monitor-grid {
        flex: 1;
        border-right: 1px solid var(--border);
    }
    .p8-live-monitor-detail {
        display: flex;
        flex: 1;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        background: white;
    }
    .p8-live-detail-content {
        flex: 1;
        min-height: 0;
    }
}
/* Prototype landscape frames: 2-koloms split */
.landscape-phone-frame .p8-live-monitor-split,
.landscape-tablet-frame .p8-live-monitor-split,
.landscape-desktop-frame .p8-live-monitor-split {
    flex-direction: row;
}
.landscape-phone-frame .p8-live-monitor-grid,
.landscape-tablet-frame .p8-live-monitor-grid,
.landscape-desktop-frame .p8-live-monitor-grid {
    flex: 1;
    border-right: 1px solid var(--border);
}
.landscape-phone-frame .p8-live-monitor-detail,
.landscape-tablet-frame .p8-live-monitor-detail,
.landscape-desktop-frame .p8-live-monitor-detail {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: white;
}
.landscape-phone-frame .p8-live-detail-content,
.landscape-tablet-frame .p8-live-detail-content,
.landscape-desktop-frame .p8-live-detail-content {
    flex: 1;
    min-height: 0;
}

/* ============================================================
   Landscape Phone Modal — prototype-only, toont phone-screen
   in landscape orientatie via DOM move
   ============================================================ */
.landscape-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}
.landscape-overlay.active {
    display: flex;
}
.landscape-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}
.landscape-modal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.landscape-phone-frame {
    position: relative;
    width: 812px;
    height: 375px;
    background: #000;
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
/* Override phone-screen styling when inside landscape frame */
.landscape-phone-frame > .phone-screen {
    border-radius: 38px;
}
/* Hide app-bar, bottom-nav, status-bar and notch in landscape modal (mirrors webapp landscape) */
.landscape-phone-frame .app-bar,
.landscape-phone-frame .bottom-nav,
.landscape-phone-frame .status-bar,
.landscape-phone-frame .notch {
    display: none !important;
}
.landscape-phone-frame .p8-hide-completed-btn {
    top: 8px;
}
.landscape-phone-frame .dashboard-scroll {
    height: 100%;
    padding-top: 12px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}
.landscape-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: color-mix(in srgb, var(--admin-blue) 100%, black 30%);
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.landscape-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.landscape-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
/* Portrait blocker — toont "draai je device" overlay in landscape viewer voor niet-dashboard schermen */
.landscape-portrait-blocker {
    display: none;
    position: absolute;
    inset: 12px;
    z-index: 100;
    background: var(--primary, #F26522);
    color: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px;
    border-radius: 38px;
    overflow: hidden;
}
.landscape-tablet-frame .landscape-portrait-blocker {
    inset: 16px;
    border-radius: 12px;
}
.landscape-desktop-frame .landscape-portrait-blocker {
    inset: 8px;
    border-radius: 6px;
}
.landscape-portrait-blocker.active {
    display: flex;
}
.landscape-portrait-blocker svg {
    animation: landscape-rotate-phone 1.5s ease-in-out infinite alternate;
}
.landscape-portrait-blocker p {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}
.landscape-portrait-hint {
    font-size: 13px;
    opacity: 0.8;
}
@keyframes landscape-rotate-phone {
    from { transform: rotate(90deg); }
    to { transform: rotate(0deg); }
}
/* Device toggle (phone / tablet) */
.landscape-device-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 3px;
}
.landscape-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.landscape-toggle-btn svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.landscape-toggle-btn.active {
    background: rgba(255, 255, 255, 0.35);
    color: white;
}
.landscape-toggle-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.85);
}
/* Tablet frame */
.landscape-tablet-frame {
    position: relative;
    width: 1194px;
    height: 834px;
    background: #000;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 92vw;
    max-height: 80vh;
}
.landscape-tablet-frame > .phone-screen {
    border-radius: 12px;
}
.landscape-tablet-frame .status-bar,
.landscape-tablet-frame .notch {
    display: none !important;
}
/* Compact app-bar for tablet/desktop (no status bar padding needed) */
.landscape-tablet-frame .app-bar,
.landscape-desktop-frame .app-bar {
    height: 48px;
    padding: 0 20px;
    font-size: 17px;
}
.landscape-tablet-frame .p8-hide-completed-btn,
.landscape-desktop-frame .p8-hide-completed-btn {
    top: 56px;
}
/* Neutralize sticky positioning inside all landscape frames — prevents z-index bleed
   through portrait blocker and eliminates gap between app-bar and content */
.landscape-device-frame .metrics-strip,
.landscape-device-frame .offline-indicator,
.landscape-device-frame .device-check-indicator,
.landscape-device-frame .search-bar,
.landscape-device-frame [id$="filterBarWrapper"] {
    position: relative !important;
    top: 0 !important;
    z-index: auto !important;
}

/* Desktop frame — fills most of the viewport */
.landscape-desktop-frame {
    position: relative;
    width: calc(100vw - 80px);
    height: calc(100vh - 120px);
    background: #000;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.landscape-desktop-frame > .phone-screen {
    border-radius: 6px;
}
.landscape-desktop-frame .status-bar,
.landscape-desktop-frame .notch {
    display: none !important;
}

/* ---- Landscape device frames: keep tiles at portrait proportions ---- */
/* In portrait the phone is ~351px content width, grids are 3-col → tiles ~107px.
   Use auto-fill so wider frames get more tiles per row instead of stretching them. */
.landscape-device-frame .p8-cp-grid,
.landscape-device-frame .p8-act-grid,
.landscape-device-frame .p8-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.landscape-device-frame .p8-deelnemers-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
}
.landscape-device-frame .p8-sub-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}
/* Hero section: in wider frames, let sub-grid expand naturally */
.landscape-device-frame .p8-hero {
    flex-wrap: nowrap;
}
/* Expand panels span full width regardless of column count */
.landscape-device-frame .p8-expand,
.landscape-device-frame .p8-cp-expand {
    grid-column: 1 / -1;
}

/* ============================================================
   Tablet view — slightly larger fonts & spacing
   ============================================================ */
.landscape-tablet-frame .p8-section-title {
    font-size: 12px; letter-spacing: 0.6px;
}
.landscape-tablet-frame .p8-sub-tile-value { font-size: 20px; }
.landscape-tablet-frame .p8-sub-tile-label { font-size: 10px; margin-bottom: 4px; }
.landscape-tablet-frame .p8-cp-progress { margin-top: 6px; }
.landscape-tablet-frame .p8-sub-tile-total { font-size: 12px; }
.landscape-tablet-frame .p8-hero-main-value { font-size: 40px; }
.landscape-tablet-frame .p8-hero-main-label { font-size: 12px; }
/* Tablet timeline */
.landscape-tablet-frame .p8-timeline { padding: 16px; }
.landscape-tablet-frame .p8-timeline-title { font-size: 12px; }
.landscape-tablet-frame .p8-timeline-axis { margin-left: 110px; }
.landscape-tablet-frame .p8-timeline-axis-label { font-size: 11px; }
.landscape-tablet-frame .p8-timeline-row { padding: 6px 0; }
.landscape-tablet-frame .p8-timeline-row-label { width: 106px; font-size: 11px; margin-left: -110px; }
.landscape-tablet-frame .p8-timeline-body { margin-left: 110px; }
.landscape-tablet-frame .p8-tl-badge-name { display: inline; }
.landscape-tablet-frame .p8-timeline-row-track { height: 28px; }
.landscape-tablet-frame .p8-timeline-bar { height: 24px; font-size: 10px; }
.landscape-tablet-frame .p8-timeline-bar-times { font-size: 10px; }
.landscape-tablet-frame .p8-prognose-bar { height: 24px; top: 2px; }
.landscape-tablet-frame .p8-prognose-delta { top: -12px; font-size: 9px; }
.landscape-tablet-frame .p8-timeline-now-pill { font-size: 10px; }
/* Tablet expand panel */
.landscape-tablet-frame .p8-expand-inner { font-size: 13px; }
.landscape-tablet-frame .p8-expand-title { font-size: 13px; }
/* Tablet event progress */
.landscape-tablet-frame .p8-event-progress-title { font-size: 12px; }
.landscape-tablet-frame .p8-event-progress-pct { font-size: 14px; }
.landscape-tablet-frame .p8-legend-item { font-size: 11px; }
/* Tablet bottom-nav */
.landscape-tablet-frame .bottom-nav .nav-label { font-size: 11px; }
.landscape-tablet-frame .bottom-nav .nav-icon svg { width: 22px; height: 22px; }
/* Tablet grids — slightly larger tiles */
.landscape-tablet-frame .p8-cp-grid,
.landscape-tablet-frame .p8-act-grid,
.landscape-tablet-frame .p8-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

/* ============================================================
   Desktop view — larger fonts, spacious tiles, readable timeline
   ============================================================ */
.landscape-desktop-frame .p8-section-title {
    font-size: 13px; letter-spacing: 0.7px; padding: 6px 4px 10px;
}
.landscape-desktop-frame .p8-sub-tile { padding: 12px 10px; border-radius: 12px; }
.landscape-desktop-frame .p8-sub-tile-value { font-size: 24px; }
.landscape-desktop-frame .p8-sub-tile-label { font-size: 11px; margin-bottom: 6px; }
.landscape-desktop-frame .p8-cp-progress { margin-top: 8px; }
.landscape-desktop-frame .p8-sub-tile-total { font-size: 13px; }
.landscape-desktop-frame .p8-hero-main { flex: 0 0 140px; padding: 20px 16px; }
.landscape-desktop-frame .p8-hero-main-value { font-size: 44px; }
.landscape-desktop-frame .p8-hero-main-label { font-size: 13px; }
.landscape-desktop-frame .p8-hero-main-icon { width: 42px; height: 42px; }
.landscape-desktop-frame .p8-hero-main-icon svg { width: 22px; height: 22px; }
/* Desktop timeline — taller rows, bigger labels */
.landscape-desktop-frame .p8-timeline { padding: 20px; }
.landscape-desktop-frame .p8-timeline-title { font-size: 13px; }
.landscape-desktop-frame .p8-timeline-axis { margin-left: 160px; }
.landscape-desktop-frame .p8-timeline-axis-label { font-size: 12px; }
.landscape-desktop-frame .p8-timeline-row { padding: 7px 0; }
.landscape-desktop-frame .p8-timeline-row-label { width: 156px; font-size: 13px; overflow: visible; margin-left: -160px; }
.landscape-desktop-frame .p8-timeline-body { margin-left: 160px; padding-top: 8px; }
.landscape-desktop-frame .p8-tl-badge-name { display: inline; }
.landscape-desktop-frame .p8-timeline-row-track { height: 32px; border-radius: 5px; }
.landscape-desktop-frame .p8-timeline-bar { height: 28px; font-size: 11px; border-radius: 4px; }
.landscape-desktop-frame .p8-timeline-bar-times { font-size: 11px; }
.landscape-desktop-frame .p8-prognose-bar { height: 28px; top: 2px; border-radius: 0 4px 4px 0; }
.landscape-desktop-frame .p8-prognose-bar-start { border-radius: 4px 0 0 4px; }
.landscape-desktop-frame .p8-prognose-delta { top: -13px; font-size: 10px; }
.landscape-desktop-frame .p8-timeline-bar-progress { height: 5px; bottom: 2px; }
.landscape-desktop-frame .p8-timeline-now-pill { font-size: 11px; padding: 3px 8px; }
/* Desktop expand panel */
.landscape-desktop-frame .p8-expand-title { font-size: 14px; }
/* Desktop event progress */
.landscape-desktop-frame .p8-event-progress { padding: 16px 18px; }
.landscape-desktop-frame .p8-event-progress-title { font-size: 13px; }
.landscape-desktop-frame .p8-event-progress-pct { font-size: 15px; }
.landscape-desktop-frame .p8-progress { height: 10px; }
.landscape-desktop-frame .p8-legend-item { font-size: 12px; }
.landscape-desktop-frame .p8-legend-dot { width: 8px; height: 8px; }
/* Desktop bottom-nav */
.landscape-desktop-frame .bottom-nav { padding: 8px 0; }
.landscape-desktop-frame .bottom-nav .nav-label { font-size: 12px; }
.landscape-desktop-frame .bottom-nav .nav-icon svg { width: 24px; height: 24px; }
/* Desktop grids — bigger tiles */
.landscape-desktop-frame .p8-cp-grid,
.landscape-desktop-frame .p8-act-grid,
.landscape-desktop-frame .p8-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.landscape-desktop-frame .p8-deelnemers-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.landscape-desktop-frame .p8-sub-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
/* Desktop dashboard scroll padding */
.landscape-desktop-frame .dashboard-scroll { padding: 16px 24px; }

/* ========== P15 Route Segmenten - Mobile Layout ========== */
.route-seg {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
    background: white;
}
.route-seg-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    width: 20px;
    flex-shrink: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.route-seg-num {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.route-seg-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.route-seg-fields {
    display: contents;
}
.route-seg-fields label {
    display: none;
}
.route-seg-input {
    width: 72px;
    flex-shrink: 0;
    padding: 4px 6px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
}
.route-seg-del {
    width: 24px;
    height: 24px;
    padding: 0;
    flex-shrink: 0;
}
/* Mobile route segmenten: phone-frame (prototype) + echte small viewport (webapp) */
.phone-frame .route-seg-header,
.route-seg-header-mobile-hidden {
    display: none !important;
}
.phone-frame .route-seg,
.route-seg-mobile {
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.phone-frame .route-seg:last-child,
.route-seg-mobile:last-child {
    border-bottom: none;
}
.phone-frame .route-seg-name,
.route-seg-mobile .route-seg-name {
    flex: 1;
    white-space: normal;
    overflow: visible;
}
.phone-frame .route-seg-fields,
.route-seg-mobile .route-seg-fields {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    padding-left: 38px;
    margin-top: 4px;
}
.phone-frame .route-seg-fields label,
.route-seg-mobile .route-seg-fields label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    min-width: 0;
}
.phone-frame .route-seg-input,
.route-seg-mobile .route-seg-input {
    width: 56px;
}
/* Route: vast start-segment */
.route-seg-start {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.route-seg-start-icon {
    width: 20px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.route-seg-start-icon svg {
    width: 14px;
    height: 14px;
}
.route-seg-start-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.route-seg-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}
/* Route: drag icon sizing */
.route-seg-drag-icon {
    width: 16px;
    height: 16px;
}
/* Route: delete icon sizing */
.route-seg-del-icon {
    width: 12px;
    height: 12px;
    color: var(--error);
}
/* Route: header action buttons (undo/redo/save) */
#screen-routes .app-bar-title {
    justify-self: start;
    text-align: left;
}
.route-header-actions {
    display: none;
    gap: 2px;
    align-items: center;
    justify-self: end;
}
.route-header-actions.visible {
    display: flex;
}
.route-action-btn {
    border: none;
    color: white;
    padding-bottom: 0;
}
.route-action-btn:disabled {
    opacity: 0.25;
    pointer-events: none;
}
.route-action-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    .route-seg-header {
        display: none !important;
    }
    .route-seg {
        flex-wrap: wrap;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    .route-seg:last-child {
        border-bottom: none;
    }
    .route-seg-name {
        flex: 1;
        white-space: normal;
        overflow: visible;
    }
    .route-seg-fields {
        display: flex;
        gap: 6px;
        align-items: center;
        width: 100%;
        padding-left: 28px;
        margin-top: 4px;
    }
    .route-seg-fields label {
        display: block;
        font-size: 10px;
        color: var(--text-muted);
        min-width: 0;
    }
    .route-seg-input {
        width: 56px;
    }
}

/* Dual-thumb time slider active state (scan management) */
#sm-thumb-min:active, #sm-thumb-max:active {
    transform: translateX(-10px) scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ============================================================
   Change Request (Wijzigingsverzoek) System
   ============================================================ */

/* Edit button in P7/P7b app-bar */
.cr-edit-btn.cr-edit-disabled {
    opacity: 0.3;
    pointer-events: none;
}
.cr-edit-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Modal panel */
.cr-modal-panel {
    max-width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.cr-modal-content {
    padding: 20px;
}

/* Modal header */
.cr-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.cr-modal-name {
    font-size: 16px;
    font-weight: 700;
}
.cr-modal-cat {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Form fields */
.cr-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cr-field-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    width: 80px;
}
.cr-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    max-width: 200px;
    background: white;
}
.cr-input:focus {
    outline: none;
    border-color: var(--primary);
}
.cr-field-wrap {
    flex: 1;
    max-width: 200px;
}
.cr-field-wrap .cr-input {
    max-width: 100%;
    width: 100%;
}
.cr-input-error {
    border-color: var(--error) !important;
    outline: none;
}
.cr-current {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
select.cr-input {
    max-width: 200px;
}
.cr-textarea {
    max-width: 100%;
    resize: vertical;
    min-height: 60px;
}
input[type=number].cr-input {
    max-width: 80px;
}

/* Inactive banner with reregister button */
.cr-inactive-banner {
    margin-bottom: 12px;
    text-align: center;
}
.cr-inactive-banner-inner {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
}
.cr-inactive-banner-text {
    font-size: 13px;
    color: var(--error);
    font-weight: 600;
}

/* Notification badge */
.notif-badge {
    width: 18px;
    height: 18px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}
/* Badge inside bottom nav: positioned relative to nav-item (mockup style) */
.nav-item > .notif-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
}

/* Deregister link */
.cr-deregister-link {
    margin-top: 8px;
    text-align: left;
}
.cr-deregister-btn {
    color: var(--error);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Family members section */
.cr-family-section {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.cr-family-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.cr-family-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cr-family-member {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 8px;
    background: var(--background);
    border-radius: var(--radius);
    cursor: pointer;
}
.cr-family-member input[type=checkbox] {
    accent-color: var(--primary);
}

/* Pending changes banner */
.cr-pending-banner {
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.cr-pending-icon {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 1px;
}
.cr-pending-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
}
.cr-pending-changes {
    font-size: 11px;
    color: var(--text-secondary);
}
.cr-pending-change-item {
    margin-top: 2px;
}

/* Pending indicator on info-rows in P7/P7b */
.info-row.cr-pending {
    background: #FFFBEB;
}

/* Pending change request banner on P7/P7b (same pattern as cr-inactive-banner-text) */
.cr-p7-pending-banner {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.cr-p7-pending-title {
    font-size: 13px;
    color: #D97706;
    font-weight: 600;
}
.cr-p7-pending-detail {
    font-size: 12px;
    color: #92400E;
    margin-top: 2px;
}
.cr-p7-pending-change {
    font-size: 12px;
    color: #92400E;
    margin-top: 4px;
    line-height: 1.4;
}
.cr-p7-pending-field {
    font-weight: 600;
    color: #92400E;
}
.cr-p7-pending-old {
    color: #92400E;
    opacity: 0.7;
}
.cr-p7-pending-arrow {
    color: #D97706;
    font-weight: 600;
}
.cr-p7-pending-new {
    color: #D97706;
    font-weight: 600;
}

/* Pending badge on P6 list (replaces checkpoint pills) */
.cr-p6-pending-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #FEF3C7;
    color: #D97706;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.cr-pending-indicator {
    font-size: 11px;
    color: var(--warning);
    margin-top: 2px;
}
.cr-pending-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #FEF3C7;
    color: #D97706;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

/* Inactive participant badge */
.cr-inactive-badge {
    background: var(--text-muted) !important;
    color: white !important;
}
.cr-inactive-name-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}

/* Modal actions */
.cr-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* ============================================================
   Responsive prototype-layout
   Onder 1620px passen de vaste zijkolommen niet meer naast de
   gecentreerde telefoon (bijv. met devtools open). Ticker,
   feedback-kolom en sync-sidebar verlaten dan de fixed/absolute
   positionering en stapelen in de normale flow: ticker boven de
   toolbar (body is flex-kolom, vandaar order), feedback- en
   sync-panelen onder de telefoon.
   ============================================================ */
@media (max-width: 1620px) {
    .news-ticker {
        position: static;
        order: -1;
        width: min(580px, 100%);
        margin: 0 auto 12px;
    }
    .news-ticker.hidden {
        margin: 0 auto;
    }
    .feedback-sidebar {
        position: static;
        width: min(580px, 100%);
        max-height: 85vh;
        margin-top: 24px;
    }
    .phone-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .sync-sidebar {
        position: static;
        width: min(500px, calc(100vw - 40px));
        min-width: 0;
        height: auto;
        max-height: 812px;
        margin-top: 16px;
    }
}

