:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f5f6fa;
    --chart-background: #ffffff;
    --text-color: #2c3e50;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

.dashboard-container {
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-title img {
    height: 35px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-export-button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.header-export-button.csv {
    background-color: #27ae60;
    color: white;
}

.header-export-button.csv:hover {
    background-color: #219a52;
    transform: translateY(-1px);
}

.header-export-button.excel {
    background-color: #2ecc71;
    color: white;
}

.header-export-button.excel:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

.logout-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 0.9em;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.charts-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Container für zwei zusammengehörige Charts */
.chart-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    background-color: rgba(44, 62, 80, 0.05);
    border-radius: 15px;
}

/* Größerer vertikaler Abstand für Chart-Gruppen mit mehreren Zeilen (z.B. Beatmung/Isolation) */
.chart-pair.chart-pair-multi {
    row-gap: 30px; /* vertikaler Abstand zwischen den Chart-Reihen */
}

/* Anpassung der Chart-Section */
.chart-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

/* Trennlinien können entfernt werden, da wir jetzt Rahmen haben */
.charts-grid::after,
.charts-grid::before {
    display: none;
}

/* Optional: Hover-Effekt für bessere Interaktivität */
.chart-pair:hover {
    box-shadow: 0 0 15px rgba(44, 62, 80, 0.1);
    transition: box-shadow 0.3s ease;
}

.chart-container {
    background-color: var(--chart-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 400px;
    position: relative;
}

.chart-container canvas {
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: calc(100% - 65px) !important;
    cursor: default;
    user-select: none;
}

/* Chart Scrollbalken */
.chart-scrollbar-container {
    position: absolute;
    /* Scrollbalken direkt an den unteren Rand des Chart-Containers setzen,
       damit alle Charts einer Zeile exakt auf einer horizontalen Linie liegen */
    bottom: 0;
    left: 50px;
    right: 20px;
    height: 20px;
    padding: 0;
    display: block;
    z-index: 10;
}

.chart-scrollbar {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    cursor: pointer;
}

.chart-scrollbar:hover {
    opacity: 1;
    background: #e8e8e8;
}

/* Chrome, Safari, Edge */
.chart-scrollbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: calc(var(--scrollbar-width, 20%) * 1);
    min-width: 50px;
    max-width: 100%;
    height: 18px;
    background: #ffffff;
    border: 1px solid #999999;
    border-radius: 2px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.chart-scrollbar::-webkit-slider-thumb:hover {
    background: #f8f8f8;
    border-color: #777777;
}

.chart-scrollbar::-webkit-slider-thumb:active {
    cursor: grabbing;
    background: #eeeeee;
    border-color: #666666;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Firefox */
.chart-scrollbar::-moz-range-thumb {
    width: calc(var(--scrollbar-width, 20%) * 1);
    min-width: 50px;
    max-width: 100%;
    height: 18px;
    background: #ffffff;
    border: 1px solid #999999;
    border-radius: 2px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.chart-scrollbar::-moz-range-thumb:hover {
    background: #f8f8f8;
    border-color: #777777;
}

.chart-scrollbar::-moz-range-thumb:active {
    cursor: grabbing;
    background: #eeeeee;
    border-color: #666666;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.chart-container h2 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin: 0 0 25px 0;
    text-align: center;
    position: relative;
}

.chart-total {
    font-size: 0.75em;
    color: #666;
    display: block;
    margin-top: 5px;
    text-align: center;
}

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: var(--chart-background);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.login-form button {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: #2980b9;
}

/* Neuer Filter-Bereich */
.dashboard-filters {
    background-color: var(--chart-background);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    flex-shrink: 0;
}

.filter-group select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Dropdown-Legende Styles */
.chart-legend-dropdown {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.legend-button {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.legend-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    min-width: 200px;
}

.legend-content.show {
    display: block;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
}

.legend-item input[type="checkbox"] {
    margin: 0;
}


.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    height: 50px;
    width: auto;
    margin-bottom: 15px;
}

/* Anpassung für Dashboard-Titel */
.dashboard-title h1 {
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
    color: #666666;  /* Mittleres Grau statt Blau */
    margin: 0;
    font-size: 24px;
}

/* Anpassung für Login-Titel */
.login-header h1 {
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
    color: #666666;  /* Mittleres Grau statt Blau */
    margin: 0;
    font-size: 24px;
}


/* Spezielle Anpassungen für die neuen Charts 9-13 */
/* Begrenze die Breite der Chart-Container für konsistente Darstellung */
.chart-container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Spezifische Anpassungen für Charts mit langen Labels */
#chart9, #chart10, #chart11, #chart12, #chart13 {
    font-size: 0.9em; /* Kleinere Schrift für bessere Platzausnutzung */
}

/* Filter-Bereiche für neue Charts optimieren */
.dashboard-filters {
    flex-wrap: wrap;
    max-width: 100%;
    min-height: 60px; /* Mindesthöhe für konsistente Darstellung */
}

.dashboard-filters .filter-group {
    min-width: 180px;
    max-width: 250px;
    margin-bottom: 10px; /* Zusätzlicher Abstand bei Umbruch */
}

.dashboard-filters .filter-group select {
    max-width: 100%;
    min-width: 120px;
    font-size: 0.9em;
}

.dashboard-filters .filter-group label {
    white-space: nowrap; /* Verhindert Zeilenumbruch bei Labels */
    margin-right: 8px;
}

/* Reset-Button für individuelle Charts */
.filter-reset-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    min-width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-left: auto;
}

.filter-reset-btn:hover {
    background-color: #7f8c8d;
    transform: rotate(90deg);
}

.filter-reset-btn:active {
    background-color: #6c7b7d;
}

/* Chart-Titel für neue Charts anpassen */
.chart-container h2 {
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    max-width: 100%;
}

/* Donut-Chart spezielle Anpassungen */
#chartAssignmentTypes {
    max-width: 100%;
}

/* Responsive Anpassungen für kleinere Bildschirme */
@media (max-width: 1400px) {
    .chart-pair {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-container {
        height: 350px;
    }
}

@media (max-width: 1200px) {
    .dashboard-filters {
        gap: 15px;
        padding: 12px;
    }
    
    .filter-group {
        min-width: 140px;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-filters {
        gap: 10px;
        padding: 10px;
    }
    
    .filter-group {
        min-width: 120px;
        max-width: 100%;
        width: 100%;
    }
    
    .filter-group select {
        min-width: 100px;
    }
    
    .filter-reset-btn {
        font-size: 0.9em;
        min-width: 24px;
        height: 24px;
        padding: 4px 6px;
        margin-top: 10px;
        margin-left: auto;
        align-self: flex-end;
        border-radius: 3px;
    }
}


@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-export-button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 0.85em;
    }
}

/* Chart-Header und Export-Buttons für einzelne Charts */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.chart-header h2 {
    margin: 0;
    padding-top: 2px; /* minimale Verschiebung nach unten für optische Ausrichtung */
    font-size: 1.2em;
    color: var(--primary-color);
    flex: 1;
}

.chart-export-buttons {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    margin-left: 15px;
}

.chart-export-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    color: #495057;
}

.chart-export-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-export-btn.csv:hover {
    background-color: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.chart-export-btn.excel:hover {
    background-color: #cce5ff;
    border-color: #3498db;
    color: #004085;
}

.chart-export-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Responsive Anpassungen für Chart-Export-Buttons */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .chart-export-buttons {
        align-self: flex-end;
        margin-left: 0;
    }
    
    .chart-export-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8em;
    }
}

/* === INTERAKTIVE ZEITLEISTE STYLES === */

.timeline-container {
    background-color: var(--chart-background);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}

.timeline-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2em;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.4;
    margin-top: 8px;
}

.timeline-date-inputs {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.date-input-group label {
    font-size: 0.85em;
    font-weight: 500;
    color: var(--primary-color);
}

.date-time-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

.timeline-date-input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    flex: 1;
    min-width: 130px;
}

.timeline-time-input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    width: 100px;
}

.timeline-date-input:focus,
.timeline-time-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.weekday-filter-group {
    flex: 1;
    min-width: 300px;
}

.weekday-checkboxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.weekday-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.weekday-checkbox:hover {
    background-color: #f0f0f0;
}

.weekday-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.weekday-checkbox span {
    font-size: 0.9em;
    font-weight: 500;
}

.weekday-checkbox input[type="checkbox"]:checked + span {
    color: var(--secondary-color);
    font-weight: 600;
}

.timeline-quick-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 2px;
}

.timeline-apply-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.timeline-apply-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.timeline-reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.timeline-reset-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.timeline-info-bar {
    text-align: center;
    margin-bottom: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

.timeline-info-bar span {
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 500;
}

.timeline-content {
    position: relative;
    padding: 20px 0;
    margin: 20px 0;
}

.timeline-track {
    position: relative;
    height: 40px;
    margin: 10px 20px;
    cursor: grab;
}

.timeline-track:active {
    cursor: grabbing;
}

.timeline-background {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 50%, #e9ecef 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.timeline-selected-range {
    position: absolute;
    top: 50%;
    height: 8px;
    background: linear-gradient(90deg, var(--secondary-color) 0%, #2980b9 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.timeline-handles {
    position: relative;
    height: 100%;
}

.timeline-handle {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    border: 3px solid white;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
    z-index: 10;
}

.timeline-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.6);
}

.timeline-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.timeline-handle-left {
    z-index: 11;
}

.timeline-handle-right {
    z-index: 11;
}

.timeline-handle-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 20;
}

.timeline-handle-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.timeline-handle:hover .timeline-handle-tooltip {
    opacity: 1;
    bottom: 35px;
}

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    width: 2px;
    height: 12px;
    background: #adb5bd;
    transform: translate(-50%, -50%);
}

.timeline-marker.major {
    height: 18px;
    background: #6c757d;
    width: 3px;
}

.timeline-marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #6c757d;
    white-space: nowrap;
    margin-top: 5px;
}

.timeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.timeline-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-btn-reset {
    background-color: #6c757d;
    color: white;
}

.timeline-btn-reset:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.timeline-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-preset-btn {
    padding: 6px 12px;
    border: 1px solid var(--secondary-color);
    background: white;
    color: var(--secondary-color);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    font-weight: 500;
}

.timeline-preset-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

.timeline-preset-btn.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* Responsive Design für Timeline */
@media (max-width: 1200px) {
    .timeline-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .timeline-presets {
        justify-content: center;
    }
}

@media (max-width: 1000px) {
    .timeline-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .timeline-header h3 {
        text-align: center;
        margin-top: 0;
    }
    
    .timeline-date-inputs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .timeline-container {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .timeline-date-inputs {
        justify-content: space-between;
        gap: 8px;
    }
    
    .date-input-group {
        min-width: 100px;
        flex: 1;
    }
    
    .weekday-filter-group {
        min-width: 100%;
        flex: 100%;
    }
    
    .weekday-checkboxes {
        gap: 6px;
        justify-content: center;
    }
    
    .weekday-checkbox {
        padding: 3px 6px;
    }
    
    .weekday-checkbox span {
        font-size: 0.85em;
    }
    
    .date-time-wrapper {
        flex-direction: column;
        gap: 4px;
    }
    
    .timeline-date-input,
    .timeline-time-input {
        font-size: 0.85em;
        padding: 5px 6px;
        width: 100%;
        min-width: 100%;
    }
    
    .timeline-quick-actions {
        justify-content: center;
        margin-top: 8px;
        flex: 100%;
    }
    
    .timeline-apply-btn,
    .timeline-reset-btn {
        padding: 8px 16px;
        font-size: 0.8em;
    }
    
    .timeline-info-bar {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    .timeline-track {
        margin: 10px 10px;
    }
    
    .timeline-preset-btn {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    
    .timeline-handle {
        width: 18px;
        height: 18px;
    }
    
    .timeline-handle:hover {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Timeline Animation */
@keyframes timelineHighlight {
    0% { box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(52, 152, 219, 0.6); }
    100% { box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3); }
}

.timeline-selected-range.updating {
    animation: timelineHighlight 0.6s ease-in-out;
}

/* Zeitleiste Loading State */
.timeline-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.timeline-container.loading .timeline-track {
    cursor: not-allowed;
}

/* Accessibility */
.timeline-handle:focus {
    outline: 3px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

.timeline-preset-btn:focus,
.timeline-btn:focus {
    outline: 2px solid rgba(52, 152, 219, 0.5);
    outline-offset: 1px;
}

/* Globale Filter Styles */
.global-filters-container {
    background: var(--chart-background);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e6ed;
    position: sticky;
    top: 10px;
    z-index: 100;
    transition: all 0.3s ease;
}

.global-filters-container.scrolled {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.global-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.global-filters-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2em;
    font-weight: 600;
}

.filters-reset-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filters-reset-btn:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.global-filters-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.global-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.global-filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.global-filter-select {
    padding: 10px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: white;
    font-size: 0.9em;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    /* Multi-Select spezifische Stile */
    min-height: 80px;
    max-height: 120px;
    overflow-y: auto;
    min-width: 180px;
}

.global-filter-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.global-filter-select:hover {
    border-color: #bdc3c7;
}

/* Hilfetext für Multi-Select */
.filter-help {
    color: #7f8c8d;
    font-size: 0.75em;
    margin-top: 2px;
    display: block;
    font-style: italic;
}

/* Multi-Select Optionen */
.global-filter-select option {
    padding: 4px 6px;
    font-size: 0.9em;
}

.global-filter-select option:checked {
    background-color: var(--secondary-color) !important;
    color: white !important;
    font-weight: 500;
}

.global-filter-select option:hover {
    background-color: #ecf0f1 !important;
}

/* Dediziertes Suchfeld */
.search-section {
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.global-search-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    background: white;
    font-size: 1em;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.global-search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.global-search-input::placeholder {
    color: #bdc3c7;
    font-style: italic;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e6ed;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

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

.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #f8f9fa;
}

.suggestion-category {
    background-color: var(--secondary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
}

.suggestion-text {
    flex: 1;
    font-size: 0.9em;
}

.suggestion-meta {
    font-size: 0.8em;
    color: #7f8c8d;
}

/* Filter-Dropdowns */
.filter-dropdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
}

.filter-dropdown-container {
    position: relative;
    min-width: 300px;
    width: 100%;
    pointer-events: auto !important;
}

.filter-dropdown-btn {
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-height: 44px;
    pointer-events: auto !important;
    z-index: 10;
    position: relative;
}

.filter-dropdown-btn:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.filter-dropdown-btn.active {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.filter-label {
    font-weight: 600;
    color: var(--text-color);
}

.filter-count {
    color: #7f8c8d;
    font-size: 0.85em;
    margin: 0 8px;
    flex: 1;
    text-align: left;
    margin-left: 12px;
}

.filter-count.has-selection {
    color: var(--secondary-color);
    font-weight: 600;
}

.dropdown-arrow {
    color: #bdc3c7;
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.filter-dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e6ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 300px;
    width: 100%;
}

.filter-dropdown-content.active {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
}

.dropdown-title {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-color);
}

.clear-filter-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-filter-btn:hover {
    background-color: #e74c3c;
    color: white;
}

.dropdown-options {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}

.dropdown-option {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    cursor: pointer !important;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
    user-select: none;
    min-height: 44px;
    gap: 10px;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f1f3f4;
}

.dropdown-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer !important;
    margin: 0;
    accent-color: var(--secondary-color);
}

.option-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
    cursor: pointer !important;
}

.dropdown-option input[type="checkbox"] {
    margin: 0;
    margin-right: 10px;
    cursor: pointer;
}

.option-text {
    flex: 1;
    font-size: 0.9em;
    color: var(--text-color);
}

.dropdown-option input[type="checkbox"]:checked + .option-text {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Scroll-Styling für Dropdowns */
.filter-dropdown-content::-webkit-scrollbar,
.dropdown-options::-webkit-scrollbar,
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-content::-webkit-scrollbar-track,
.dropdown-options::-webkit-scrollbar-track,
.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb,
.dropdown-options::-webkit-scrollbar-thumb,
.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb:hover,
.dropdown-options::-webkit-scrollbar-thumb:hover,
.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.active-filters {
    padding-top: 15px;
    border-top: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.active-filters-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.active-filters-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-badge {
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

.filter-badge .remove-badge {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.filter-badge .remove-badge:hover {
    opacity: 1;
}

.filter-values {
    position: relative;
    cursor: help;
}

.filter-values[title]:hover {
    text-decoration: underline;
    cursor: help;
}

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

/* Responsive Design für globale Filter */
@media (max-width: 768px) {
    .global-filters-container {
        margin: 15px 0 10px 0;
        padding: 15px;
        border-radius: 8px;
        top: 5px;
    }
    
    .global-filters-content {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .global-filters-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        margin-bottom: 15px;
    }
    
    .global-filters-header h3 {
        font-size: 1.1em;
        text-align: center;
    }
    
    .filters-reset-btn {
        padding: 10px 16px;
        font-size: 0.85em;
    }
    
    .global-filter-select {
        padding: 12px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    /* Responsive Anpassungen für neues Filter-Interface */
    .search-container {
        max-width: 100%;
    }
    
    .global-search-input {
        font-size: 16px; /* Verhindert Zoom auf iOS */
        padding: 12px 16px;
    }
    
    .filter-dropdowns {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-dropdown-container {
        min-width: 100%;
    }
    
    .filter-dropdown-btn {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .search-suggestions {
        max-height: 200px;
    }
    
    .suggestion-item {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .suggestion-category {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .suggestion-text {
        font-size: 1em;
        word-break: break-word;
    }
    
    .suggestion-meta {
        font-size: 0.85em;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 12px;
    }
    
    .filter-badge {
        font-size: 0.75em;
        padding: 5px 10px;
    }
    
    /* Sticky Anpassung für mobile */
    .global-filters-container.scrolled {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    }
}

/* Sticky Datumsanzeige */
.sticky-date-display {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    display: none; /* Initially hidden */
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sticky-date-display.visible {
    display: flex;
    animation: fadeInDown 0.3s ease;
}

.sticky-date-display:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    background: rgba(52, 152, 219, 1);
}

.date-icon {
    font-size: 1.1em;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .sticky-date-display {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 14px;
        font-size: 0.85em;
        max-width: calc(100vw - 40px);
    }

    .global-filters-container {
        top: 0;
        margin: 10px 0 5px 0;
        padding: 12px;
    }
    
    .global-filters-content {
        gap: 12px;
    }
    
    .global-filter-group label {
        font-size: 0.9em;
    }
}


/* ================================================================
   BKN DASHBOARD — NEW LAYOUT STYLES
   Appended to existing styles.css
   ================================================================ */

/* ── Filter Bar ───────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.filter-input {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.88rem;
    background: #fafafa;
    min-width: 130px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-input:focus {
    border-color: #4A7FC1;
    background: #fff;
}

.filter-select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.88rem;
    background: #fafafa;
    min-width: 150px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: #4A7FC1;
    background: #fff;
}

/* Weekday pills */
.weekday-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pill {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.pill input[type="checkbox"] {
    display: none;
}

.pill span {
    padding: 5px 9px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #666;
    background: #fafafa;
    transition: all 0.15s;
    user-select: none;
}

.pill input[type="checkbox"]:checked + span {
    background: #4A7FC1;
    border-color: #4A7FC1;
    color: #fff;
}

.pill:hover span {
    border-color: #4A7FC1;
    color: #4A7FC1;
}

/* Toggle checkboxes */
.toggle-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 7px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #444;
    white-space: nowrap;
}

.toggle-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4A7FC1;
    cursor: pointer;
}

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

.btn-primary {
    padding: 7px 16px;
    background: #4A7FC1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-primary:hover { background: #3a6aaa; }

.btn-secondary {
    padding: 7px 16px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover { border-color: #aaa; color: #444; }

/* Export buttons in header */
.btn-export {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-export.csv   { background: #27ae60; color: #fff; }
.btn-export.excel { background: #2ecc71; color: #fff; }
.btn-export.csv:hover   { background: #219a52; }
.btn-export.excel:hover { background: #27ae60; }

.btn-logout {
    background: #3498db;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-logout:hover { background: #2980b9; }

/* Active filters bar */
.active-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: #f0f6ff;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.active-filters-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #4A7FC1;
    color: #fff;
    border-radius: 20px;
    font-size: 0.78rem;
}

.filter-badge button {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.filter-badge button:hover { opacity: 1; }

/* ── Dashboard Sections ───────────────────────────────────────── */
.dashboard-section {
    margin-bottom: 36px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin: 0 0 16px 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* ── Chart Rows ───────────────────────────────────────────────── */
.chart-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-row.two-col { grid-template-columns: repeat(2, 1fr); }
.chart-row.one-col { grid-template-columns: 1fr; }

/* ── Chart Cards ──────────────────────────────────────────────── */
.chart-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.chart-card-narrow {
    min-height: 340px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    min-height: 28px;
}

.chart-card-header span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Canvas wrapper fills remaining space */
.chart-canvas-wrapper {
    position: relative;
    flex: 1;
    min-height: 300px;
}

.chart-canvas-short {
    min-height: 220px;
}

.chart-canvas-wrapper canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ── Heatmap ──────────────────────────────────────────────────── */
.heatmap-container {
    padding: 8px 0;
    overflow-x: auto;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 36px repeat(24, 1fr);
    gap: 3px;
    min-width: 600px;
}

.heatmap-corner {
    background: transparent;
}

.heatmap-hour-label {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    padding: 2px 0;
}

.heatmap-day-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: default;
    transition: transform 0.1s;
    min-width: 20px;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 1;
    position: relative;
}

/* ── Chart placeholder (for missing routes) ───────────────────── */
.chart-placeholder {
    color: #aaa;
    font-size: 0.85rem;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .chart-row.two-col { grid-template-columns: 1fr; }
    .filter-bar { gap: 12px; }
}

@media (max-width: 600px) {
    .dashboard-container { padding: 12px; }
    .chart-card { min-height: 300px; }
}

/* ── Sticky Filter Bar ────────────────────────────────────────── */
.filter-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.active-filters-bar {
    position: sticky;
    top: 0;
    z-index: 199;
}

/* ── Sticky filter panel ──────────────────────────────────────── */
.sticky-filters {
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── Date row inside filter panel ────────────────────────────── */
.filter-date-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.filter-date-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-small-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
}

/* ── Funkrufzeichen inline ───────────────────────────────────── */
.filter-rmi-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Notarzt / Schwangerschaft toggles ───────────────────────── */
.filter-toggle-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 0;
    margin-left: 4px;
}

.filter-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #444;
    font-weight: 500;
    white-space: nowrap;
}

.filter-toggle-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4A7FC1;
    cursor: pointer;
}

/* ── Section & card styles ───────────────────────────────────── */
.dashboard-section {
    margin-bottom: 36px;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin: 0 0 14px 2px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.chart-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-row.two-col { grid-template-columns: repeat(2, 1fr); }
.chart-row.one-col { grid-template-columns: 1fr; }

.chart-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.chart-card-narrow { min-height: 340px; }

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-card-header span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
}

.chart-canvas-wrapper {
    position: relative;
    flex: 1;
    min-height: 300px;
}

.chart-canvas-short { min-height: 220px; }

.chart-canvas-wrapper canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ── Heatmap ─────────────────────────────────────────────────── */
.heatmap-container { padding: 8px 0; overflow-x: auto; }

.heatmap-grid {
    display: grid;
    grid-template-columns: 36px repeat(24, 1fr);
    gap: 3px;
    min-width: 600px;
}

.heatmap-corner { background: transparent; }

.heatmap-hour-label {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    padding: 2px 0;
}

.heatmap-day-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: default;
    transition: transform 0.1s;
    min-width: 20px;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 1;
    position: relative;
}

.chart-placeholder {
    color: #bbb;
    font-size: 0.85rem;
    text-align: center;
    padding: 60px 20px;
    font-style: italic;
}

@media (max-width: 1024px) {
    .chart-row.two-col { grid-template-columns: 1fr; }
}


/* ================================================================
   SIDEBAR LAYOUT
   ================================================================ */

/* Override body so there's no extra padding */
body {
    overflow-x: hidden;
}

.dashboard-root {
    display: flex;
    min-height: 100vh;
    background: #f5f6fa;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid #eee;
}

.sidebar-header .dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .dashboard-title img {
    height: 28px;
    width: auto;
}

.sidebar-header .dashboard-title h1 {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* ── Sidebar sections ─────────────────────────────────────────── */
.sidebar-section {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
    margin-bottom: 2px;
}

.sidebar-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 2px;
}

.sidebar-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fafafa;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.sidebar-input:focus {
    border-color: #4A7FC1;
    background: #fff;
}

.sidebar-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Weekday pills ────────────────────────────────────────────── */
.weekday-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.weekday-pill {
    cursor: pointer;
}

.weekday-pill input[type="checkbox"] { display: none; }

.weekday-pill span {
    display: block;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    background: #fafafa;
    transition: all 0.15s;
    user-select: none;
}

.weekday-pill input:checked + span {
    background: #4A7FC1;
    border-color: #4A7FC1;
    color: #fff;
}

.weekday-pill:hover span { border-color: #4A7FC1; color: #4A7FC1; }
.weekday-pill input:checked + span:hover { color: #fff; }

/* ── Multi-select checkboxes ─────────────────────────────────── */
.sidebar-multiselect {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
}

.sidebar-multiselect::-webkit-scrollbar { width: 4px; }
.sidebar-multiselect::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #444;
    transition: background 0.1s;
    border-radius: 4px;
}

.multiselect-option:hover { background: #f0f6ff; }

.multiselect-option input[type="checkbox"] {
    width: 13px;
    height: 13px;
    accent-color: #4A7FC1;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Toggle checkboxes ───────────────────────────────────────── */
.sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #444;
    padding: 3px 0;
}

.sidebar-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #4A7FC1;
    cursor: pointer;
}

/* ── Reset button ────────────────────────────────────────────── */
.sidebar-reset-btn {
    width: 100%;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sidebar-reset-btn:hover {
    border-color: #E84A4A;
    color: #E84A4A;
    background: #fff5f5;
}

/* ── Active filters in sidebar ───────────────────────────────── */
.sidebar-active-filters { flex: 1; }

.no-filters-text {
    font-size: 0.78rem;
    color: #ccc;
    font-style: italic;
}

.filter-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #eef4ff;
    color: #4A7FC1;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 2px 0;
}

/* ── Sidebar footer ─────────────────────────────────────────── */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.sidebar-footer-exports {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.sidebar-export-btn {
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
}

.sidebar-export-btn:hover { background: #f0f0f0; border-color: #bbb; }

.sidebar-logout-btn {
    padding: 7px 28px;
    background: #3498db;
    color: #fff;
    border-radius: 6px;
    font-size: 0.78rem;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-logout-btn:hover { background: #2980b9; }

/* ── Main content area ───────────────────────────────────────── */
.dashboard-main {
    flex: 1;
    min-width: 0;
    padding: 28px 24px;
    overflow-y: auto;
}

/* ── Chart layout ────────────────────────────────────────────── */
.dashboard-section { margin-bottom: 36px; }

.section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #bbb;
    margin: 0 0 14px 2px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.chart-row { display: grid; gap: 20px; margin-bottom: 20px; }
.chart-row.two-col { grid-template-columns: repeat(2, 1fr); }
.chart-row.one-col { grid-template-columns: 1fr; }

.chart-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.chart-card-narrow { min-height: 320px; }

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-card-header span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.chart-canvas-wrapper {
    position: relative;
    flex: 1;
    min-height: 280px;
}

.chart-canvas-short { min-height: 200px; }

.chart-canvas-wrapper canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ── Heatmap ─────────────────────────────────────────────────── */
.heatmap-container { padding: 8px 0; overflow-x: auto; }

.heatmap-grid {
    display: grid;
    grid-template-columns: 36px repeat(24, 1fr);
    gap: 3px;
    min-width: 500px;
}

.heatmap-corner { background: transparent; }
.heatmap-hour-label { text-align: center; font-size: 0.65rem; color: #aaa; }
.heatmap-day-label {
    font-size: 0.72rem; font-weight: 600; color: #888;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 5px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: default;
    min-width: 18px;
    transition: transform 0.1s;
}

.heatmap-cell:hover { transform: scale(1.15); z-index: 1; position: relative; }

.chart-placeholder {
    color: #ccc; font-size: 0.82rem;
    text-align: center; padding: 60px 20px; font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .chart-row.two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dashboard-root { flex-direction: column; }
    .sidebar { width: 100%; min-width: unset; height: auto; position: relative; }
    .dashboard-main { padding: 16px; }
}

/* ── Sidebar dropdown (Dringlichkeit / Beatmung / Isolation) ─── */
.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown-btn {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    font-size: 0.85rem;
    color: #444;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
    text-align: left;
}

.sidebar-dropdown-btn:hover { border-color: #4A7FC1; }

.sidebar-dropdown.open .sidebar-dropdown-btn {
    border-color: #4A7FC1;
    background: #fff;
}

.drop-arrow {
    font-size: 0.75rem;
    color: #aaa;
    transition: transform 0.2s;
}

.sidebar-dropdown.open .drop-arrow { transform: rotate(180deg); }

.sidebar-dropdown-panel {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 300;
    padding: 4px 0;
    max-height: 200px;
    overflow-y: auto;
}

.sidebar-dropdown.open .sidebar-dropdown-panel { display: block; }

/* ── Hour inputs side by side ────────────────────────────────── */
.sidebar-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sidebar-input-small {
    min-width: 0;
}

/* ================================================================
   COLLAPSIBLE SIDEBAR
   ================================================================ */

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: #4A7FC1; background: #f0f6ff; }

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

/* Toggle button shown when sidebar is collapsed */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 300;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.sidebar-toggle-btn:hover { border-color: #4A7FC1; color: #4A7FC1; }

/* Collapsed state */
.sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
}

.dashboard-root.sidebar-collapsed .dashboard-main {
    padding-left: 68px; /* leave room for toggle button */
}

/* Smooth transition */
.sidebar {
    transition: width 0.25s ease, min-width 0.25s ease;
}
.dashboard-main {
    transition: padding-left 0.25s ease;
}

/* ── Searchable dropdown ──────────────────────────────────────── */
.dropdown-search {
    display: block;
    width: calc(100% - 16px);
    margin: 6px 8px 4px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.82rem;
    color: #444;
    outline: none;
    box-sizing: border-box;
    background: #f9f9f9;
}
.dropdown-search:focus {
    border-color: #4A7FC1;
    background: #fff;
}

/* ── Badge × remove button ───────────────────────────────────── */
.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-remove {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 1px;
    cursor: pointer;
    margin-left: 2px;
    border-radius: 3px;
}
.badge-remove:hover {
    color: #e84a4a;
    background: rgba(232,74,74,0.1);
}

/* ── Filter save buttons ──────────────────────────────────────── */
.sidebar-save-btn {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #4A7FC1;
    border-radius: 6px;
    background: #f0f6ff;
    color: #4A7FC1;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}
.sidebar-save-btn:hover {
    background: #dceeff;
}
.sidebar-clear-saved-btn {
    margin-top: 4px;
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: none;
    color: #aaa;
    font-size: 0.78rem;
    cursor: pointer;
    text-align: left;
}
.sidebar-clear-saved-btn:hover {
    color: #e84a4a;
    border-color: #e84a4a;
}

/* ── Quick filter buttons ─────────────────────────────────────── */
.quick-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 8px;
}
.quick-filter-btn {
    padding: 5px 4px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fafafa;
    color: #555;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.quick-filter-btn:hover {
    border-color: #4A7FC1;
    color: #4A7FC1;
    background: #f0f6ff;
}

/* ── Fullscreen ───────────────────────────────────────────────── */
.chart-fullscreen-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #aaa;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.chart-fullscreen-btn:hover { color: #4A7FC1; }

.chart-card.chart-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    border-radius: 0;
    margin: 0;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.chart-card.chart-fullscreen .chart-canvas-wrapper {
    flex-shrink: 0;
    max-height: none !important;
    height: auto !important;
    min-height: 400px;
    transition: width 0.2s ease, min-height 0.2s ease;
}
body.has-fullscreen { overflow: hidden; }

.fs-zoom-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 0 2px;
    font-size: 0.75rem;
    color: #999;
}
.fs-zoom-reset {
    padding: 3px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    font-size: 0.75rem;
    cursor: pointer;
    color: #555;
}
.fs-zoom-reset:hover { background: #e8e8e8; }

/* ── Sort bar ─────────────────────────────────────────────────── */
.chart-sort-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px 6px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-wrap: wrap;
}
.sort-label {
    font-size: 0.75rem;
    color: #aaa;
    margin-right: 2px;
}
.sort-btn {
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.sort-btn:hover { border-color: #4A7FC1; color: #4A7FC1; }
.sort-btn.active {
    background: #4A7FC1;
    border-color: #4A7FC1;
    color: #fff;
}