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

/* Container */
.smartshifts-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Hours-Sidebar → Moved to css/modules/sidebar.css */

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

.smartshifts-day-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    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: 3px;
    margin-bottom: 6px;
}

/* 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: 40px;
    padding: 5px;
}

.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 - Prominenter Bereich */
.card-header {
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #f8fafc;
    min-width: 140px;
    max-width: 160px;
    flex-shrink: 0;
    justify-content: center;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.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: 2px 4px;
    flex: 1;
    display: flex;
    align-items: center;
    overflow-x: auto;
}

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

/* Shift Cell - Kompakt mit besserer Lesbarkeit */
.shift-cell {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
    background: var(--surface-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    max-width: 190px;
    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 - Kompakt aber lesbar */
.cell-header {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-bottom: 3px;
    margin-bottom: 3px;
    border-bottom: 1px solid var(--border-color);
}

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

.cell-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.cell-pause {
    display: inline-block;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    cursor: help;
    font-weight: 500;
}

.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;
}

/* Compact section dividers for Lead/Team */
.cell-section-divider {
    font-size: 8px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 0;
    margin-bottom: 3px;
    text-align: center;
    line-height: 1;
}

/* Trennlinie zwischen Lead und Team Bereich */
.cell-lead {
    padding-bottom: 3px;
    margin-bottom: 3px;
}

/* Remove top borders from dividers - label text is enough */
.cell-lead .cell-section-divider,
.cell-team .cell-section-divider {
    border-top: none;
    padding-top: 0;
}

.cell-team {
    padding-top: 0;
}

/* Kompakter Content-Bereich */
.cell-content {
    padding: 4px 2px;
}

.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;
}

/* Dropdown Wrapper für X-Button */
.team-dropdown-wrapper,
.lead-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-bottom: 4px;
}

/* Letzter Dropdown braucht keinen bottom margin */
.team-dropdown-wrapper:last-child {
    margin-bottom: 0;
}

/* X-Button zum Entfernen von Zuweisungen */
.btn-remove-assignment {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 3px;
    width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.btn-remove-assignment:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.btn-remove-assignment:active {
    transform: scale(0.95);
}

/* Anpassung für Team-Dropdown mit X-Button */
.team-dropdown-wrapper .team-select {
    flex: 1;
}

/* Anpassung für Lead-Dropdown mit X-Button */
.lead-dropdown-wrapper .lead-select {
    flex: 1;
}

/* 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%;
    }
}

/* ============================================================================
   SmartShifts Navigation (KW-Liste + Tages-Zeile)
   ============================================================================ */

/* KW-Liste Container */
.smartshifts-kw-navigation {
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 4px;
    overflow: hidden;
}

.kw-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2px 0;
}

/* Hide scrollbar completely - use scroll buttons instead */
.kw-list::-webkit-scrollbar {
    display: none;
}

.kw-list {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Scroll Buttons for KW Navigation */
.kw-scroll-btn {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.kw-scroll-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.kw-scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* KW-Item */
.kw-item {
    flex-shrink: 0;
    padding: 6px 10px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.kw-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.kw-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.kw-item.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Jahr-Navigation Buttons in KW-Liste */
.kw-year-nav {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.kw-year-nav:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tages-Liste Container */
.smartshifts-day-navigation {
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 4px;
}

.day-list {
    display: flex;
    gap: 4px;
    justify-content: space-between;
}

/* Day-Item */
.day-item {
    flex: 1;
    padding: 6px 8px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    min-width: 100px;
    line-height: 1;
}

.day-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.day-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.day-item.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .kw-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .day-item {
        padding: 10px 6px;
        font-size: 12px;
        min-width: 60px;
    }

    .day-list {
        gap: 6px;
    }
}

/* Status-Klassen für farbliche Indikation */
.kw-item.status-neutral,
.day-item.status-neutral {
    border-left: 4px solid #94a3b8; /* Grau - keine Schichten */
}

.kw-item.status-empty,
.day-item.status-empty {
    border-left: 4px solid #ef4444; /* Rot - 0% gefüllt */
}

.kw-item.status-low,
.day-item.status-low {
    border-left: 4px solid #f59e0b; /* Orange - < 50% gefüllt */
}

.kw-item.status-medium,
.day-item.status-medium {
    border-left: 4px solid #eab308; /* Gelb - < 100% gefüllt */
}

.kw-item.status-complete,
.day-item.status-complete {
    border-left: 4px solid #10b981; /* Grün - 100% gefüllt */
}

/* Active items behalten ihre border-color */
.kw-item.active,
.day-item.active {
    border-left-color: white;
}

/* KW-Item internal structure removed - now single line text with stats in tooltip */

/* Day-Item internal structure removed - now single line text */

/* Jahr-Navigation */
.smartshifts-year-navigation {
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 8px;
}

.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.year-item {
    padding: 6px 12px;
    margin: 0 2px;
    border: 2px solid var(--border-color);
    background: white;
    color: inherit;
    border-radius: 8px;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s;
    font-size: 14px;
}

.year-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
    transform: translateY(-1px);
}

.year-item.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

.year-item.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ============================================================================
   Hours Sidebar - Enhanced Controls & Sections
   ============================================================================ */

/* Sidebar Header Styles */
.hours-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-color);
}

.hours-sidebar .sidebar-header h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

.hours-sidebar .sidebar-header .kw-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 8px;
}

.hours-sidebar .sidebar-header .sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.hours-sidebar .sidebar-header .sidebar-toggle:hover {
    background: var(--border-color);
}

/* Sidebar Controls */
.sidebar-controls {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-controls .control-group {
    margin-bottom: 8px;
}

.sidebar-controls .control-group:last-child {
    margin-bottom: 0;
}

.sidebar-controls label {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: var(--text-color);
}

.sidebar-controls input,
.sidebar-controls select {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

.sidebar-controls input:focus,
.sidebar-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Section Styles */
.sidebar-section {
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    background: var(--bg-color);
    transition: background 0.2s;
    user-select: none;
}

.section-header:hover {
    background: #f8f9fa;
}

.section-toggle {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 12px;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
}

.section-title strong {
    color: var(--primary-color);
}

.section-content {
    max-height: 600px;
    overflow-y: auto;
}

.section-content::-webkit-scrollbar {
    width: 6px;
}

.section-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

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

/* Resizing State */
.hours-sidebar.resizing {
    user-select: none;
}

.hours-sidebar.resizing * {
    cursor: col-resize !important;
}

/* ============================================================================
   Bereich Filter - Verbessertes Dropdown (Neue UX)
   ============================================================================ */

/* Quick Actions im Dropdown */
.bereich-filter-quick-actions {
    display: flex;
    gap: 6px;
    padding: 8px;
}

.btn-filter-action {
    flex: 1;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.btn-filter-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-filter-action:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Bereich Filter Options (im Dropdown) */
.bereich-filter-option {
    position: relative;
    transition: background 0.2s;
    border-radius: 4px;
    margin: 2px 4px;
}

.bereich-filter-option:hover {
    background: var(--bg-color);
}

.bereich-filter-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.bereich-filter-option label:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* "Nur"-Button für einzelne Bereiche */
.btn-isolate-bereich {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.1s;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    z-index: 10;
}

.bereich-filter-option:hover .btn-isolate-bereich {
    opacity: 1;
}

.btn-isolate-bereich:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

.btn-isolate-bereich:active {
    transform: translateY(-50%) scale(0.95);
}

/* Checkbox Styling im Filter */
.smartshifts-bereich-option {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Color Box mit Checkmark */
.bereich-filter-option span[style*="width: 16px"] {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .btn-isolate-bereich {
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* ============================================================================
   Horizontal Week View - Bereiche als Zeilen, Tage als Spalten
   ============================================================================ */

/* Container für horizontale Wochenansicht */
.week-horizontal-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Bereich-Zeile (horizontal) */
.bereich-row-horizontal {
    background: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    min-height: 60px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.bereich-row-horizontal:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Bereich-Header in horizontaler Zeile */
.bereich-row-header {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8fafc;
    min-width: 120px;
    max-width: 140px;
    flex-shrink: 0;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.bereich-row-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* Content-Bereich mit Tages-Gruppen */
.bereich-row-content {
    flex: 1;
    min-width: 0; /* Wichtig: verhindert dass flex-item über Container hinauswächst */
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 6px;
    align-items: stretch; /* Alle Tages-Gruppen gleich hoch */
}

/* Scrollbar Styling für horizontales Scrollen */
.bereich-row-content::-webkit-scrollbar {
    height: 6px;
}

.bereich-row-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.bereich-row-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.bereich-row-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tages-Gruppe (Header + Cells) */
.day-group {
    display: flex;
    align-items: stretch; /* Header und Cells gleich hoch */
    flex-shrink: 0;
}

/* Cells Container soll sich auch strecken */
.day-group .day-cells {
    display: flex;
    align-items: stretch;
}

/* Tages-Header-Block (farbiger Separator) */
.day-header-block {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    border-radius: 4px 0 0 4px;
    box-shadow: 2px 0 4px rgba(37, 99, 235, 0.15);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Feiertag-Variante des Tages-Headers */
.day-header-block.day-header-feiertag {
    background: linear-gradient(180deg, #dc2626, #b91c1c);
    box-shadow: 2px 0 4px rgba(220, 38, 38, 0.2);
}

/* Feiertag-Badge inline im Header */
.feiertag-badge-inline {
    font-size: 8px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
    text-transform: none;
    letter-spacing: 0;
}

/* Container für die Schicht-Cells eines Tages */
.day-cells {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 4px 4px 0;
    align-items: stretch; /* Alle Cells gleich hoch */
    flex-shrink: 0;
}

/* Anpassungen für Shift-Cells im horizontalen Layout */
.week-horizontal-container .shift-cell {
    min-width: 150px;
    max-width: 180px;
    height: auto; /* Erlaubt Höhenanpassung */
    align-self: stretch; /* Streckt sich auf volle Höhe */
}

/* Week Layout Toggle Button */
#week-layout-toggle {
    transition: all 0.2s ease;
}

#week-layout-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive: Kleinere Screens */
@media (max-width: 1200px) {
    .bereich-row-header {
        min-width: 100px;
        max-width: 120px;
    }
    
    .bereich-row-header h3 {
        font-size: 13px;
    }
    
    .day-header-block {
        min-width: 24px;
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .week-horizontal-container .shift-cell {
        min-width: 140px;
        max-width: 160px;
    }
}

@media (max-width: 768px) {
    .bereich-row-horizontal {
        flex-direction: column;
    }
    
    .bereich-row-header {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .day-header-block {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        min-width: auto;
        padding: 6px 10px;
        border-radius: 4px 4px 0 0;
    }
    
    .day-group {
        flex-direction: column;
    }
    
    .day-cells {
        border-radius: 0 0 4px 4px;
        flex-direction: column;
    }
    
    .week-horizontal-container .shift-cell {
        max-width: 100%;
        min-width: 100%;
    }
}
