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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header & Navigation */
header {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Wochenauswahl */
.week-selector {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
}

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

#week-info {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    min-width: 180px;
    text-align: center;
}

.week-nav-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.week-nav-btn:hover {
    background: var(--primary-hover);
}

/* Dropdown Menu Styles */
.dropdown-item {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background 0.15s;
    display: block;
}

.dropdown-item:hover {
    background: var(--bg-color);
}

.dropdown-item:active {
    background: var(--border-color);
}

#week-status-badge {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s;
}

.nav-btn-primary {
    font-size: 16px;
    padding: 12px 24px;
    font-weight: 600;
}

.nav-btn-small {
    font-size: 13px;
    padding: 8px 16px;
}

.nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Main Content */
main {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-color);
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Action Bar */
.action-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

thead {
    background: var(--bg-color);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

td {
    font-size: 14px;
}

tbody tr:hover {
    background: var(--bg-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-ok {
    background: #d1fae5;
    color: #065f46;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-full {
    background: #e0e7ff;
    color: #3730a3;
}

/* Dienstplan Grid/Tabelle */
.dienstplan-container {
    overflow-x: auto;
    margin-top: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

#dienstplan-grid table {
    border: 1px solid var(--border-color);
}

#dienstplan-grid thead th {
    border: 1px solid var(--border-color);
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#dienstplan-grid tbody td {
    border: 1px solid var(--border-color);
}

/* Erste Spalte (Mitarbeiter) fixieren beim Scrollen */
#dienstplan-grid th:first-child,
#dienstplan-grid td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface-color);
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

#dienstplan-grid thead th:first-child {
    z-index: 20;
    background: var(--bg-color);
}

/* Hover-Effekt auf Zeilen entfernt, damit individuelle Zell-Hintergründe (Opacity, Zuweisungen) sichtbar bleiben */

/* Überlastete Mitarbeiter - roter Rahmen */
#dienstplan-grid tbody tr.overloaded {
    border: 3px solid var(--danger-color);
    border-left: 5px solid var(--danger-color);
}

#dienstplan-grid tbody tr.overloaded td:first-child {
    background: #fef2f2;
    font-weight: 600;
    color: var(--danger-color);
}

#dienstplan-grid tbody tr.overloaded:hover td:first-child {
    background: #fee2e2 !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Shift-Editor Modal (niedriger z-index) */
#modal-shift-editor {
    z-index: 10100;
}

/* Wochenschicht-Details Modal (höherer z-index, damit es über dem Editor erscheint) */
#modal-wochenschicht {
    z-index: 10200;
}

.modal-content {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group input[type="week"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Week Picker Input */
.week-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.week-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Footer */
footer {
    margin-top: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Overview Sections */
.overview-section {
    margin-bottom: 40px;
}

.overview-section:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

    main {
        padding: 20px;
    }

    nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

/* Abwesende Mitarbeiter */
.absent {
    background: #ffedd5 !important;
}

.absent:hover {
    background: #fed7aa !important;
}

/* Hilfeklassen */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Wochenschichten Timeline Editor */
.bereich-editor {
    margin-bottom: 40px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.bereich-editor-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
}

.timeline-container {
    display: flex;
    background: var(--surface-color);
}

.timeline-hours {
    width: 80px;
    background: var(--bg-color);
    border-right: 2px solid var(--border-color);
    flex-shrink: 0;
}

.timeline-hour {
    height: 60px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
}

.timeline-days {
    flex: 1;
    display: flex;
}

.timeline-day {
    flex: 1;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.timeline-day:last-child {
    border-right: none;
}

.timeline-day-header {
    background: var(--bg-color);
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
    height: 66px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.timeline-hour-header {
    background: var(--bg-color);
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    border-bottom: 2px solid var(--border-color);
    height: 66px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-slots {
    position: relative;
}

.timeline-slot {
    height: 30px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s;
}

.timeline-slot:nth-child(even) {
    border-bottom-style: dashed;
    border-bottom-color: #e2e8f0;
}

.timeline-slot:hover {
    background: rgba(37, 99, 235, 0.05);
}

.timeline-slot.selecting {
    background: rgba(37, 99, 235, 0.2);
}

.timeline-shift {
    position: absolute;
    background: var(--primary-color);
    border-radius: 6px;
    padding: 6px 8px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Position wird dynamisch per JavaScript gesetzt für Überlappungen */
}

.timeline-shift:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
    z-index: 10;
}

.timeline-shift-name {
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-shift-time {
    font-size: 10px;
    opacity: 0.9;
}

.timeline-shift-info {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}

.shift-copy-btn {
    position: absolute;
    top: 2px;
    right: 24px;
    background: rgba(16, 185, 129, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.shift-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.timeline-shift:hover .shift-copy-btn,
.timeline-shift:hover .shift-delete-btn {
    display: flex;
}

.shift-copy-btn:hover {
    background: #10b981;
}

.shift-delete-btn:hover {
    background: var(--danger-color);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    color: #64748b;
}

.footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
}

.footer-tagline {
    opacity: 0.7;
}

/* ========================================
   FULLSCREEN / FOKUS-MODUS
   ======================================== */

/* Fullscreen Mode aktiviert */
body.fullscreen-mode {
    overflow: hidden;
}

/* Alle UI-Elemente ausblenden */
body.fullscreen-mode header,
body.fullscreen-mode nav,
body.fullscreen-mode .footer,
body.fullscreen-mode .week-selector {
    display: none !important;
}

/* Fokus-Modus Button im Fullscreen ausblenden */
body.fullscreen-mode #toggle-fullscreen-dienstplan,
body.fullscreen-mode #toggle-fullscreen-uebersicht {
    display: none !important;
}

/* Container im Fullscreen */
body.fullscreen-mode .container {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Dienstplan-Container nutzt gesamten Viewport */
body.fullscreen-mode #tab-dienstplan,
body.fullscreen-mode #tab-uebersicht {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-color);
    padding: 60px 20px 20px 20px;
    overflow: auto;
}

/* Top-Bar Control Menu */
.fullscreen-controls {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

body.fullscreen-mode .fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

body.fullscreen-mode .fullscreen-controls:hover {
    opacity: 1;
}

/* Fullscreen controls content */
.fullscreen-controls span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Control Buttons */
.control-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.control-btn-danger {
    background: var(--danger-color);
}

.control-btn-danger:hover {
    background: #c0392b;
}

/* Current Week Display */
#fs-current-week {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 4px 12px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
}

/* Controls Layout */
.fullscreen-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fullscreen-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-control-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    min-width: 80px;
}

/* Exit Button */
.fullscreen-exit-btn {
    width: 100%;
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fullscreen-exit-btn:hover {
    background: #dc2626;
}

/* Navigation Buttons */
.fullscreen-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    flex: 1;
}

.fullscreen-nav-btn:hover {
    background: var(--primary-hover);
}

.fullscreen-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filter Selects */
.fullscreen-control-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

/* Smooth Transitions */
body.fullscreen-mode #tab-dienstplan,
body.fullscreen-mode #tab-uebersicht {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fullscreen Toggle Button */
.fullscreen-toggle-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-toggle-btn:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fullscreen-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Filter-Bar für Mitarbeiterverwaltung
   ======================================== */

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.filter-bar select {
    min-width: 140px;
}

.filter-bar button {
    white-space: nowrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    transition: border-color 0.2s;
    user-select: none;
}

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

.filter-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.filter-checkbox span {
    cursor: pointer;
}

.filter-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

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

/* Filter count inside filter-bar (for tabs that still use it inline) */
.filter-bar .filter-count {
    margin-left: auto;
}

/* Responsive: Bei kleineren Bildschirmen */
@media (max-width: 1200px) {
    .filter-bar {
        gap: 8px;
    }

    .filter-bar input[type="text"] {
        min-width: 150px;
    }

    .filter-bar select {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar input,
    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }

    .filter-count {
        margin-left: 0;
        text-align: center;
    }
}

/* Simplified: No filter-group wrappers needed */

/* ========================================
   Modal Tabs
   ======================================== */

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-tab:hover {
    color: var(--text-color);
    background: var(--bg-secondary);
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

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

.bereich-tab-content {
    display: none;
}

.bereich-tab-content.active {
    display: block;
}

/* Mitarbeiter Checkbox List */
.mitarbeiter-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.mitarbeiter-checkbox-item:hover {
    background: var(--bg-secondary);
}

.mitarbeiter-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    width: 100%;
}

.mitarbeiter-checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

.mitarbeiter-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

.mitarbeiter-checkbox-item.changed {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding-left: 9px;
}


/* ===== BERICHTE TAB (Monthly Reports) ===== */

/* Statistik-Grid */
.statistik-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Container für Mitarbeiter-Listen (rechte Spalte) */
.mitarbeiter-listen {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

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

.stat-row span {
    color: var(--text-muted);
}

.stat-row strong {
    color: var(--text-color);
    font-size: 16px;
}

.stat-row strong.auslastung-optimal {
    color: #10b981;
}

.stat-row strong.auslastung-voll {
    color: #f59e0b;
}

.stat-row strong.auslastung-ueber {
    color: #ef4444;
}

.abwesenheit-breakdown {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--bg-secondary);
    font-size: 13px;
    color: var(--text-muted);
}

/* Top Mitarbeiter Liste */
.top-mitarbeiter-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-secondary);
    align-items: center;
}

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

.top-mitarbeiter-row .rank {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 25px;
}

.top-mitarbeiter-row .name {
    flex: 1;
}

.top-mitarbeiter-row .stunden {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 8px;
}

.top-mitarbeiter-row .prozent {
    font-size: 12px;
    color: var(--text-muted);
}

/* Bereiche Auslastung (Progress Bars) */
.bereiche-auslastung-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bereich-auslastung-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

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

.bereich-auslastung-label {
    min-width: 150px;
    font-weight: 500;
}

.bereich-auslastung-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bereich-auslastung-bar {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.bereich-auslastung-bar.optimal {
    background: linear-gradient(90deg, #10b981, #059669);
}

.bereich-auslastung-bar.voll {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.bereich-auslastung-bar.ueber {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.bereich-auslastung-bar.unter {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.bereich-auslastung-details {
    min-width: 120px;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
}

/* Bereiche Grid */
.bereiche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.bereich-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.bereich-card h4 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-size: 15px;
}

.bereich-card .stat-row.warning {
    color: var(--warning-color);
    background: rgba(241, 196, 15, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Responsive */
/* Sortable Table */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.sortable-table th.sortable:hover {
    background: #f3f4f6;
}

.sortable-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 12px;
}

.sortable-table th.sort-asc::after {
    content: '▲';
    opacity: 1;
    color: var(--primary-color);
}

.sortable-table th.sort-desc::after {
    content: '▼';
    opacity: 1;
    color: var(--primary-color);
}

/* Auslastung Badge */
.auslastung-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    background: #e5e7eb;
    color: #374151;
}

.auslastung-badge.auslastung-optimal {
    background: #d1fae5;
    color: #065f46;
}

.auslastung-badge.auslastung-voll {
    background: #fef3c7;
    color: #92400e;
}

.auslastung-badge.auslastung-ueber {
    background: #fee2e2;
    color: #991b1b;
}

/* Inaktive Mitarbeiter (Mitarbeiter-Tabelle) */
.inactive-row {
    background: rgba(0, 0, 0, 0.03);
    opacity: 0.7;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(46, 204, 113, 0.15);
    color: #16a34a;
}

.status-badge.inactive {
    background: rgba(149, 165, 166, 0.15);
    color: #6b7280;
}

/* Icon Buttons (Edit, Delete, etc.) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

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

.btn-icon-danger {
    color: var(--danger-color);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-icon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.btn-icon-edit:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.btn-icon-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.btn-icon-delete:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
    transform: scale(1.05);
}

/* Toggle Switch für SmartShifts View Mode */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s ease;
    border-radius: 24px;
}

.toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch-input:checked + .toggle-switch-slider {
    background-color: var(--primary-color);
}

.toggle-switch-input:checked + .toggle-switch-slider:before {
    transform: translateX(20px);
}

.toggle-switch-slider:hover {
    background-color: #94a3b8;
}

.toggle-switch-input:checked + .toggle-switch-slider:hover {
    background-color: #1e40af;
}

.toggle-switch-input:focus + .toggle-switch-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Abwesenheiten Statistik-Cards */
.stat-cards-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.abwesenheit-stat-card {
    padding: 8px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.abwesenheit-stat-card strong {
    color: var(--text-muted);
    margin-right: 4px;
}

@media (max-width: 768px) {
    .statistik-grid {
        grid-template-columns: 1fr;
    }

    .bereiche-grid {
        grid-template-columns: 1fr;
    }

    .bereich-auslastung-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bereich-auslastung-label {
        min-width: unset;
    }

    .bereich-auslastung-bar-container {
        width: 100%;
    }
}

/* ===================================
   Berichte: Sticky Header & Collapsables
   =================================== */

/* Sticky/Floating Header für Monatsnavigation */
.berichte-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.berichte-sticky-header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Collapsable Sections */
.collapsable-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 8px;
    transition: background 0.2s;
}

.collapsable-header:hover {
    background: var(--border-color);
}

.collapse-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapsable-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsable-section {
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsable-section.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Jahresübersicht Styles */
#jahresuebersicht-container {
    display: none;
    margin-top: 20px;
}

#jahresuebersicht-container.active {
    display: block;
}

.jahresuebersicht-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.monat-summary-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.monat-summary-card h4 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--text-color);
}

.monat-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.monat-summary-row span:first-child {
    color: var(--text-muted);
}

.monat-summary-row span:last-child {
    font-weight: 600;
    color: var(--text-color);
}

/* Jahresdiagramm / Chart */
.jahres-chart-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h4 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.chart-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-color);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.chart-grid {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 300px;
    gap: 8px;
    padding: 20px 10px 0;
    position: relative;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-bars {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.chart-bar-ma {
    background: var(--primary-color);
}

.chart-bar-bereich {
    background: var(--warning-color);
}

.chart-bar-stunden {
    background: var(--success-color);
}

.chart-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.chart-baseline {
    height: 1px;
    background: var(--border-color);
    margin-top: -1px;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive Chart */
@media (max-width: 768px) {
    .chart-grid {
        height: 200px;
        gap: 4px;
    }

    .chart-label {
        font-size: 10px;
    }

    .legend-item {
        font-size: 12px;
    }
}

/* ===================================
   Custom Dialogs (Alert & Confirm)
   =================================== */

.custom-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10500; /* Über allen Modals */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.custom-dialog.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.custom-dialog-content {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.25s ease-out;
    text-align: center;
}

.custom-dialog-icon {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1;
}

.custom-dialog-message {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 25px;
    white-space: pre-wrap; /* Preserve line breaks from \n */
}

.custom-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-dialog-actions button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 15px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-dialog {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* ===================================================================
   SmartShifts - Kompakte Table-View
   =================================================================== */

/* Container */
.smartshifts-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === Stunden-Übersicht Sidebar === */
.hours-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 320px;
    background: var(--bg-color);
    border-left: 2px solid var(--border-color);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.hours-sidebar.open {
    transform: translateX(0);
}

.hours-sidebar.collapsed {
    transform: translateX(calc(100% - 40px));
}

/* Toggle Button */
.hours-sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    user-select: none;
}

.hours-sidebar-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-50%) translateX(-2px);
}

.hours-sidebar.collapsed .hours-sidebar-toggle #sidebar-toggle-icon::before {
    content: 'MA\ASTD';
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: pre;
}

.hours-sidebar.open .hours-sidebar-toggle #sidebar-toggle-icon::before {
    content: '◀';
}

/* Sidebar Content */
.hours-sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    overflow: hidden;
}

.hours-sidebar-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.hours-sidebar-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text-color);
}

/* Employee List */
.hours-sidebar-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

/* Scrollbar Styling */
.hours-sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.hours-sidebar-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.hours-sidebar-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.hours-sidebar-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Employee Item */
.hours-sidebar-item {
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hours-sidebar-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(-2px);
}

/* Color Coding - Traffic Light System */
.hours-sidebar-item.utilization-low {
    border-left-color: #22c55e; /* Green <90% */
    background: #f0fdf4;
}

.hours-sidebar-item.utilization-normal {
    border-left-color: #eab308; /* Yellow 90-100% */
    background: #fefce8;
}

.hours-sidebar-item.utilization-over {
    border-left-color: #f97316; /* Orange 100-110% */
    background: #fff7ed;
}

.hours-sidebar-item.utilization-critical {
    border-left-color: #ef4444; /* Red >110% */
    background: #fef2f2;
}

.hours-sidebar-item-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hours-sidebar-item-hours {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hours-sidebar-item.utilization-low .hours-sidebar-item-hours {
    color: #16a34a;
}

.hours-sidebar-item.utilization-normal .hours-sidebar-item-hours {
    color: #ca8a04;
}

.hours-sidebar-item.utilization-over .hours-sidebar-item-hours {
    color: #ea580c;
}

.hours-sidebar-item.utilization-critical .hours-sidebar-item-hours {
    color: #dc2626;
}

.hours-sidebar-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.hours-sidebar-item-conflicts {
    display: flex;
    gap: 4px;
    font-size: 14px;
}

/* Empty State */
.hours-sidebar-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1400px) {
    .hours-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .hours-sidebar {
        width: 100%;
        height: 40vh;
        top: auto;
        bottom: 0;
        transform: translateY(100%);
        border-left: none;
        border-top: 2px solid var(--border-color);
    }

    .hours-sidebar.open {
        transform: translateY(0);
    }

    .hours-sidebar.collapsed {
        transform: translateY(calc(100% - 40px));
    }

    .hours-sidebar-toggle {
        left: 50%;
        top: -40px;
        transform: translateX(-50%);
        width: 80px;
        height: 40px;
        border-radius: 8px 8px 0 0;
    }

    .hours-sidebar.collapsed .hours-sidebar-toggle #sidebar-toggle-icon::before {
        content: '▲';
    }

    .hours-sidebar.open .hours-sidebar-toggle #sidebar-toggle-icon::before {
        content: '▼';
    }
}

/* Employee Details List */
.employee-details-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.employee-details-item {
    padding: 10px 12px;
    background: white;
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.employee-details-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.employee-details-item-day {
    font-weight: 600;
    color: var(--text-color);
}

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

.employee-details-item-shift {
    font-size: 11px;
    color: var(--text-muted);
}

.employee-details-item.is-lead {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.employee-details-item.has-conflict {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.employee-details-item.has-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.employee-details-conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 4px;
}

.employee-details-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

/* Day Section Header (for week view) */
.smartshifts-day-section {
    margin-bottom: 12px;
}

.smartshifts-day-header {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

/* Cards Container (Grid) */
.bereich-cards-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

/* Bereich Card - Kompakte Table Row */
.bereich-card {
    background: var(--surface-color);
    border-radius: 3px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    min-height: 50px;
}

.bereich-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.bereich-card.collapsed .card-body {
    display: none;
}

/* Card Header - Kompakt */
.card-header {
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    min-width: 140px;
    max-width: 140px;
    flex-shrink: 0;
    justify-content: center;
}

.card-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.card-header .status-badges {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.card-header .badge {
    padding: 2px 5px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-orange {
    background: #fed7aa;
    color: #9a3412;
}

.badge-red {
    background: #fecaca;
    color: #991b1b;
}

.card-header .card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-collapse {
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

.btn-collapse:hover {
    background: var(--bg-color);
}

.btn-auto {
    padding: 2px 6px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

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

/* Card Body - Kompakt */
.card-body {
    padding: 6px 8px;
    flex: 1;
    display: flex;
    align-items: center;
    overflow-x: auto;
}

/* Shifts Row - Kompakt */
.shifts-row {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

/* Shift Cell - Ultra kompakt */
.shift-cell {
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 4px;
    background: var(--surface-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 140px;
    max-width: 180px;
    flex: 1;
}

.shift-cell:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Cell Status Colors */
.shift-cell-green {
    background: #ecfdf5;
    border-color: #10b981;
}

.shift-cell-orange {
    background: #fff7ed;
    border-color: #f59e0b;
}

.shift-cell-red {
    background: #fef2f2;
    border-color: #ef4444;
}

.shift-cell-grey {
    background: #f8fafc;
    border-color: #cbd5e1;
    opacity: 0.7;
}

/* Cell Header - Extra kompakt */
.cell-header {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
}

.cell-header strong {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.cell-time {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.1;
}

.cell-besetzung-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cell-besetzung {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.1;
    white-space: nowrap;
}

.cell-badges {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    font-size: 9px;
}

.cell-badges .badge {
    padding: 1px 4px;
    background: var(--bg-color);
    border-radius: 3px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    line-height: 1.2;
}

/* Cell Content - Extra kompakt */
.cell-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cell-lead label,
.cell-team label {
    font-size: 8px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: block;
    margin-bottom: 1px;
    line-height: 1.1;
}

.lead-select {
    width: 100%;
    padding: 3px 5px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 11px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lead-select:hover {
    border-color: var(--primary-color);
}

.lead-select option.recommended {
    font-weight: 600;
}

.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.chip {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s;
    line-height: 1.3;
}

.chip-assigned {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.chip:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Team Dropdowns - Extra kompakt */
.team-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-select {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 10px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    line-height: 1.2;
}

.team-select:hover {
    border-color: var(--primary-color);
}

.team-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Dropdown Option Farben für Warnungen */
.team-select option.option-ok {
    background: #f0fdf4;
    color: #166534;
}

.team-select option.option-info {
    background: #fef3c7;
    color: #92400e;
}

.team-select option.option-warning {
    background: #fee2e2;
    color: #991b1b;
}

.team-select option.option-blocked {
    background: #fecaca;
    color: #7f1d1d;
    font-weight: 600;
}

.team-select option.option-disabled {
    background: #e5e7eb;
    color: #6b7280;
    font-style: italic;
}

/* Lead Select Options */
.lead-select option.option-ok {
    background: #f0fdf4;
    color: #166534;
}

.lead-select option.option-info {
    background: #fef3c7;
    color: #92400e;
}

.lead-select option.option-warning {
    background: #fee2e2;
    color: #991b1b;
}

.lead-select option.option-blocked {
    background: #fecaca;
    color: #7f1d1d;
    font-weight: 600;
}

/* Cell Actions - Kompakt */
.cell-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.btn-add {
    width: 24px;
    height: 24px;
    border: 1px dashed var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add:hover {
    background: var(--primary-color);
    color: white;
    border-style: solid;
}

.btn-auto-cell {
    padding: 3px 6px;
    border: none;
    background: var(--secondary-color);
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: background 0.2s;
}

.btn-auto-cell:hover {
    background: #475569;
}

/* Cell Footer (on hover) */
.cell-footer {
    display: none !important; /* Komplett ausblenden */
}

/* Empty State - Kompakt */
.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* View Toggle Buttons */
.smartshifts-view-btn {
    transition: all 0.2s;
}

.smartshifts-view-btn:hover:not(.active) {
    background: var(--bg-color);
}

.smartshifts-view-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .bereich-cards-container {
        /* Already full width via flex-direction: column */
    }

    .shifts-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .bereich-cards-container {
        /* Already full width via flex-direction: column */
    }

    .bereich-card {
        flex-direction: column;
    }
    
    .card-header {
        max-width: 100%;
        border-left: none;
        border-top: 4px solid var(--primary-color);
    }
    
    .shifts-row {
        flex-direction: column;
    }
    
    .shift-cell {
        max-width: 100%;
    }

    .shift-cell {
        min-height: auto;
    }

    .smartshifts-filters {
        flex-direction: column;
        align-items: stretch !important;
    }

    .smartshifts-nav {
        justify-content: space-between;
        width: 100%;
    }

    .card-header {
        min-width: 150px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .cell-actions {
        flex-direction: column;
    }

    .btn-add,
    .btn-auto-cell {
        width: 100%;
    }
}
