/* Layout Struktur fixieren */
.app-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar - Solide & Modern */
.sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem;
    color: white;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar h4 {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.nav-link {
    color: #adb5bd !important;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background-color: var(--accent-color) !important;
    color: #fff !important;
}

.nav-section {
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    color: #6c757d;
    margin: 1.5rem 0 0.5rem 1rem;
    font-weight: 700;
}

/* Main Content Bereich */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-card {
    background-color: var(--content-bg);
    border-radius: 1rem;
    padding: 2rem;
    min-height: calc(100vh - 4rem);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid #e9ecef;
}

hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.btn-logout {
    margin-top: auto;
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #dc3545;
    border-radius: 0.5rem;
    padding: 0.6rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc3545;
    color: white;
}

.btn-admin {
    text-decoration: none;
    margin-top: auto;
    background: transparent;
    border: 1px solid rgb(112, 0, 255);
    color: #6b00ff;
    border-radius: 0.5rem;
    padding: 0.6rem;
    transition: all 0.2s;
}

.btn-admin:hover {
    background: #6b00ff;
    color: white;
}

/* Der aktive Zustand bekommt einen Akzent-Strich links */
.nav-link {
    position: relative;
    border-left: 4px solid transparent; /* Platzhalter für den Strich */
    margin-left: -1.25rem; /* Gleicht das Padding der Sidebar aus */
    padding-left: 1.25rem !important;
    border-radius: 0 0.5rem 0.5rem 0 !important; /* Nur rechts abrunden */
}

.nav-link.active {
    background-color: rgba(13, 110, 253, 0.15) !important; /* Dezentes Blau im Hintergrund */
    color: #0d6efd !important; /* Text wird blau */
    border-left: 4px solid #0d6efd; /* Der blaue Indikator-Strich */
    font-weight: 600;
}

/* Hover-Effekt etwas sanfter */
.nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.nav-sub {
    margin-left: 1.0rem; /* Einrückung nach rechts */
    font-size: 0.9rem; /* Etwas kleinere Schrift für die Hierarchie */
    border-left: 1px solid rgba(255, 255, 255, 0.1); /* Eine feine vertikale Linie */
    padding-left: 0;
}

.nav-sub .nav-link {
    padding: 0.5rem 0 !important; /* Etwas flacher als die Hauptlinks */
    border-left: none !important; /* Unterpunkte brauchen keinen dicken Strich links */
    border-radius: 0.5rem !important;
    margin-left: 0 !important; /* Reset für die Einrückung */
}

/* Aktiver Unterpunkt */
.nav-sub .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    font-weight: 500;
}

/* Mobiler Header (nur sichtbar auf kleinen Screens) */
.mobile-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--sidebar-bg);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* Sidebar Mobile Logik */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px; /* Versteckt */
        z-index: 1040;
        transition: transform 0.3s ease-in-out;
        box-shadow: 10px 0 20px rgba(0,0,0,0.2);
    }

    .sidebar.show {
        transform: translateX(280px); /* Schiebt sie rein */
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .app-wrapper {
        flex-direction: column;
    }

    .main-content {
        padding: 1rem;
    }

    .content-card {
        padding: 1.25rem;
        border-radius: 0.5rem;
    }
}