* { box-sizing: border-box; }

:root { 
    --bg-dark: #070d18; 
    --sidebar-bg: #092144; 
    --card-bg: rgba(14, 65, 131, 0.4); 
    --neon-blue: #4deaf8; 
    --accent-blue: #0567f9; 
    --text-main: #ffffff; 
    --text-muted: #8b9bb4; 
    --danger: #ff4d4d; 
    --success: #00e676; 
}

body { background-color: var(--bg-dark); color: var(--text-main); font-family: 'Segoe UI', sans-serif; margin: 0; display: flex; height: 100vh; overflow: hidden; }

#sidebar { width: 480px; background-color: var(--sidebar-bg); border-right: 1px solid var(--accent-blue); display: flex; flex-direction: column; padding: 15px 0; overflow-y: auto; z-index: 1000; transition: 0.3s; }
.brand { padding: 5px 20px 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: center; align-items: center; }
#sidebarLogo { width: 100%; max-width: 250px; height: auto; display: block; }
.section-title { font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; padding: 15px 20px 8px 20px; text-transform: uppercase; }
.date-picker-container { padding: 0 10px; display: flex; justify-content: center; }

.flatpickr-calendar { background: var(--bg-dark) !important; border: 1px solid var(--accent-blue) !important; box-shadow: none !important; width: 310px !important; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--neon-blue) !important; border-color: var(--neon-blue) !important; color: var(--bg-dark) !important; opacity: 1 !important; z-index: 2; font-weight: bold; }
.flatpickr-day.inRange { background: rgba(77, 234, 248, 0.25) !important; box-shadow: none !important; border-color: transparent !important; }
.flatpickr-day.past { background: rgba(14, 65, 131, 0.4); color: var(--text-muted); border-radius: 50%; }
.flatpickr-months .flatpickr-month { background: transparent !important; color: var(--neon-blue) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { background: var(--bg-dark) !important; }
span.flatpickr-weekday { color: var(--text-main) !important; }

.nav-link { padding: 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-muted); transition: all 0.2s; }
.nav-link:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--text-main); background: rgba(77, 234, 248, 0.1); border-left: 4px solid var(--neon-blue); font-weight: bold; }

#main-content { flex-grow: 1; padding: 20px 30px; display: flex; flex-direction: column; overflow-y: auto; width: 100%; }
.header-container { display: flex; align-items: flex-start; margin-bottom: 20px; gap: 15px; }
.title-wrapper { display: flex; flex-direction: column; }
h1 { margin: 0 0 5px 0; font-size: 22px; font-weight: normal; }

/* Nieuwe Live Status Styling */
.live-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pulse-dot { width: 8px; height: 8px; background-color: var(--success); border-radius: 50%; box-shadow: 0 0 8px var(--success); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.7; } 50% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(0.95); opacity: 0.7; } }

/* Nieuwe Datum Navigatie Styling */
.date-nav { display: flex; gap: 5px; align-items: center; margin-right: auto; }
.nav-btn { background: var(--card-bg); border: 1px solid rgba(77, 234, 248, 0.3); color: var(--text-main); padding: 5px 12px; border-radius: 4px; cursor: pointer; transition: 0.2s; font-size: 13px; }
.nav-btn:hover { background: rgba(77, 234, 248, 0.1); border-color: var(--neon-blue); }
.today-btn { font-weight: bold; color: var(--neon-blue); }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 15px; }
.kpi-card { background: var(--card-bg); border-radius: 8px; padding: 12px 15px; border: 1px solid rgba(77, 234, 248, 0.2); }
.kpi-title { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: bold; }
.kpi-value span { font-size: 14px; font-weight: normal; color: var(--text-muted); }

.chart-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 10px; width: 100%; }
.custom-legend { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.legend-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-muted); transition: 0.2s; }
.legend-item:hover { color: var(--text-main); }
.legend-item.hidden { text-decoration: line-through; opacity: 0.5; }
.legend-color { width: 12px; height: 12px; border-radius: 3px; }
.legend-line { width: 16px; height: 2px; border-radius: 1px; }

canvas { touch-action: pan-y; }

.chart-wrapper { background: var(--card-bg); border-radius: 8px; padding: 15px; border: 1px solid rgba(77, 234, 248, 0.2); flex-grow: 1; min-height: 0; position: relative; }
#errorMessage { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--danger); background: rgba(255,0,0,0.1); padding: 20px; border-radius: 8px; display: none; text-align: center; }

#mobileMenuBtn { display: none; }
#sidebarOverlay { display: none; }

/* --- UI: UITKLAPMENU ZIJBALK --- */
.nav-group-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-sub-menu {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15); /* Maakt het submenu net een tintje donkerder */
    border-left: 2px solid #00a8ff; /* Pas deze kleur aan naar de blauw/groen van jouw app */
    margin-left: 15px;
    margin-bottom: 5px;
}
.sub-link {
    padding-left: 15px !important;
    font-size: 0.9em;
    margin: 2px 0;
}
/* Verbergt het menu */
.hidden-menu {
    display: none !important;
}
/* Het pijltje dat draait */
.expand-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}
.expand-icon.open {
    transform: rotate(180deg);
}

/* --- MOBIELE (APP) WEERGAVE --- */
@media (max-width: 900px) {
    body { display: block; height: auto; overflow-y: auto; overflow-x: hidden; }
    #main-content { padding: 15px; height: auto; overflow-y: visible; }
    #sidebar { position: fixed; top: 0; left: -360px; bottom: 0; width: 340px; box-shadow: 2px 0 10px rgba(0,0,0,0.5); }
    #sidebar.open { left: 0; }
    #sidebarOverlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 999; }
    #sidebarOverlay.open { display: block; }
    #mobileMenuBtn { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; background: var(--card-bg); border: 1px solid var(--accent-blue); color: var(--neon-blue); border-radius: 50%; font-size: 20px; cursor: pointer; margin-top: 5px; }
    .kpi-grid { grid-template-columns: 1fr; gap: 10px; }
    .chart-wrapper { min-height: 450px; margin-bottom: 30px; }
    .header-container { margin-bottom: 10px; }
    h1 { font-size: 20px; }
    .chart-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .date-nav { justify-content: space-between; margin-right: 0; }
    .custom-legend { justify-content: center; }
}

