:root {
    --primary: #5B8C5A;
    --primary-dark: #4a7349;
    --secondary: #003459;
    --text: #333;
    --text-light: #666;
    --bg: #fff;
    --bg-light: #f8f9fa;
    --border: #e0e0e0;
}

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

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg-light);
}

/* --- Layout --- */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */

.sidebar {
    width: 240px;
    background: var(--secondary);
    color: #fff;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    width: 100%;
    max-width: 140px;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #fff;
}

.sidebar .subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-footer {
    margin-top: auto;
}

.impressum-link {
    font-size: 0.8rem;
}

.copyright {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.5rem 0.75rem;
}

/* Impressum page */
.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.card h3:first-child {
    margin-top: 0;
}

.sidebar hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1rem 0;
}

.nav-link {
    display: block;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* --- Content --- */

.content {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
    max-width: 1200px;
}

/* --- Page components --- */

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

/* --- Controls --- */

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.controls label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

/* Dash radio items & dropdowns */
.controls .dash-radioitems label,
.controls .dash-dropdown {
    font-size: 0.85rem;
}

/* --- Stat cards (home page) --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    border-top: 3px solid var(--primary);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* --- Graph containers --- */

.dash-graph {
    width: 100%;
    min-height: 400px;
}

/* --- Map pages --- */

.map-container .dash-graph {
    min-height: 550px;
}

/* --- Sidebar header (title + hamburger) --- */

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Hamburger button (hidden on desktop) --- */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: -0.25rem;
}

.hamburger-icon {
    display: block;
    width: 44px;
    height: 4px;
    background: #fff;
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    background: #fff;
    position: absolute;
    left: 0;
}

.hamburger-icon::before {
    top: -14px;
}

.hamburger-icon::after {
    top: 14px;
}

/* --- Page footer (hidden on desktop, shown on mobile) --- */

.page-footer {
    display: none;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 1rem 1.25rem;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar hr {
        display: none;
    }
    .sidebar-header {
        width: 100%;
    }
    .hamburger-btn {
        display: block;
    }
    .nav-links {
        display: none;
        width: 100%;
        padding-top: 0.75rem;
    }
    .nav-links.open {
        display: block;
    }
    .nav-links.open .nav-link {
        display: block;
        padding: 0.5rem 0.75rem;
    }
    .sidebar-footer {
        display: none;
    }
    .content {
        margin-left: 0;
        padding: 1.25rem;
    }
    .app-container {
        flex-direction: column;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Show page footer */
    .page-footer {
        display: block;
        background: var(--secondary);
        color: #fff;
        padding: 1.5rem 1.25rem;
    }
    .page-footer-inner {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1rem;
    }
    .footer-logo {
        height: 32px;
        opacity: 0.7;
    }
    .footer-links {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    .footer-link {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        font-size: 0.85rem;
    }
    .footer-link:hover {
        color: #fff;
    }
    .footer-copy {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.45);
    }

    /* Hide every other slider mark label on tablet */
    .dash-slider-mark:nth-child(even) {
        display: none !important;
    }
}

@media (max-width: 600px) {
    /* On small mobile, show only every 3rd mark (0:00, 6:00, 12:00, 18:00, 24:00) */
    .dash-slider-mark {
        display: none !important;
    }
    .dash-slider-mark:nth-child(3n+1) {
        display: block !important;
    }
}
