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

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

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

.berichte-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 - Compact version */
.toggle-switch {
    position: relative;
    width: 34px;
    height: 18px;
    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: 18px;
}

.toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 2px 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(16px);
}

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