/* Grundgerüst */
html, body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

.page {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- SIDEBAR BASIS --- */
.sidebar {
    background-color: #0f172a;
    width: 260px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

    .sidebar.collapsed {
        width: 72px;
    }

    .sidebar .top-row {
        height: 4.5rem;
        border-bottom: 1px solid #1e293b;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        overflow: hidden;
    }

    .sidebar.collapsed .top-row {
        padding: 0;
        justify-content: center;
    }

    .sidebar .navbar-brand {
        font-size: 1.35rem;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .sidebar.collapsed .navbar-brand {
        display: none;
    }

.toggle-btn {
    color: #94a3b8;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

    .toggle-btn:hover {
        background-color: #1e293b;
        color: #f8fafc;
    }

/* --- NAVIGATION CONTAINER --- */
.nav-scrollable {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 1.5rem;
}

.nav-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.custom-link {
    color: #94a3b8 !important;
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 12px 8px 12px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    font-size: 1.05rem;
    white-space: nowrap;
    background-color: transparent !important;
}

    .custom-link:hover {
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    .custom-link.active {
        background-color: #ef4444 !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

.icon-fixed-width {
    font-size: 1.3rem;
    width: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
}

.sidebar.collapsed .custom-link {
    padding: 0;
    margin: 0 12px 12px 12px;
    justify-content: center;
    height: 48px;
    width: 48px;
    border-radius: 12px;
}

.sidebar.collapsed .icon-fixed-width {
    margin-right: 0;
    width: auto;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.mt-auto {
    margin-top: auto;
}

.logout-link:hover {
    color: #f87171 !important;
}

    .logout-link:hover .icon-fixed-width {
        color: #f87171 !important;
    }

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f8fafc;
}

    main .top-row {
        background-color: #ffffff;
        height: 4.5rem;
        border-bottom: 1px solid #e2e8f0;
    }

.modern-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    background-color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-select, .form-control {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

    .form-select:focus, .form-control:focus {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
        border-color: #ef4444 !important;
    }

.btn-qty {
    border-color: #cbd5e1;
    color: #475569;
    background-color: #f8fafc;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-qty:hover {
        background-color: #e2e8f0;
        color: #0f172a;
    }

.auto-save-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
        position: fixed;
        height: 100vh;
    }

        .sidebar:not(.collapsed) {
            width: 260px;
            z-index: 1050;
        }

    main {
        margin-left: 72px;
    }

    .auto-save-toast {
        bottom: 20px;
        right: 20px;
    }
}

/* --- KALENDER & TOUCH OPTIMIERUNG --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.calendar-header {
    text-align: center;
    padding-bottom: 8px;
    font-size: 0.85rem;
}

.calendar-cell {
    aspect-ratio: 1;
    border-radius: 14px;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.4rem;
    color: #334155;
    transition: transform 0.1s ease, background-color 0.2s ease;
    user-select: none;
    touch-action: manipulation;
}

    .calendar-cell.empty {
        background-color: transparent;
        border-color: transparent;
        cursor: default;
    }

    .calendar-cell:active:not(.empty) {
        transform: scale(0.92);
    }

.shift-1 {
    background-color: #3b82f6;
    border-color: #2563eb;
    color: white;
}

.shift-2 {
    background-color: #ef4444;
    border-color: #dc2626;
    color: white;
}

.shift-3 {
    background: linear-gradient(135deg, #3b82f6 50%, #ef4444 50%);
    border-color: #1e293b;
    color: white;
}

.legend-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* --- ÜBERSTUNDEN --- */
.ot-item {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

    .ot-item:hover {
        border-color: #cbd5e1;
    }
/* ... dein bisheriger CSS Code ... */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animation-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Optimierung für die Schnellauswahl Buttons */
.btn-white {
    background-color: #ffffff;
    color: #334155;
}

    .btn-white:hover {
        background-color: #f1f5f9;
    }