/* --- GLOBALE STYLES (LIGHT MODE ONLY) --- */
:root {
    --bs-primary: #d6036a;
    --bs-primary-rgb: 214, 3, 106;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f6f9;
}

body.login-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* --- THEME AKZENTE --- */
.text-primary { color: #d6036a !important; }
.bg-primary { background-color: #d6036a !important; }

.btn-primary {
    background-color: #d6036a;
    border-color: #d6036a;
    color: #fff;
    transition: all 0.3s;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: #b50259 !important;
    border-color: #b50259 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(214, 3, 106, 0.4) !important;
}
.btn-outline-primary {
    color: #d6036a;
    border-color: #d6036a;
}
.btn-outline-primary:hover {
    background-color: #d6036a;
    color: white;
}
.btn-outline-primary:focus, .btn-outline-primary:active {
    box-shadow: 0 4px 12px rgba(214, 3, 106, 0.4) !important;
}

.form-control:focus, .form-select:focus {
    border-color: #d6036a !important;
    box-shadow: 0 0 0 0.25rem rgba(214, 3, 106, 0.25) !important;
}

/* --- LAYOUT & STRUKTUR --- */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #1f2328 0%, #171a1f 100%);
    color: #fff;
    padding: 0;
    box-shadow: 4px 0 18px rgba(0,0,0,0.16);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.sidebar-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.sidebar-top {
    padding: 1.35rem 1rem 0.75rem;
    flex: 0 0 auto;
}
.sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.32);
}
.sidebar-bottom {
    flex: 0 0 auto;
    padding-bottom: 0.75rem;
}
.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    margin: 0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand-logo {
    width: 22px;
    height: 22px;
    display: block;
}
.sidebar-brand:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar-heading {
    color: rgba(255,255,255,0.45) !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1rem;
}
.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    padding: 0.78rem 1rem;
    border-radius: 0.8rem;
    margin: 0.15rem 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.06);
}
.nav-link.active {
    background: linear-gradient(90deg, rgba(214,3,106,0.24), rgba(255,255,255,0.08));
}
.nav-link.active::after {
    content: "";
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    background-color: #d6036a;
    border-radius: 2px;
}

.nav-link.text-danger:hover { background: rgba(220, 53, 69, 0.1); color: #dc3545 !important; }

.main-content {
    padding: 2rem;
}

.navbar-mobile {
    background: #212529;
}

@media (max-width: 991.98px) {
    .navbar-mobile {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .navbar-mobile {
        display: none !important;
    }
}

.card {
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    background-color: #fff;
}

.card-header {
    background-color: #fff;
}

.dashboard-stat-icon {
    width: 4.25rem !important;
    height: 4.25rem !important;
    min-width: 4.25rem !important;
    min-height: 4.25rem !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    flex: 0 0 4.25rem !important;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.dashboard-stat-icon-primary {
    background-color: rgba(214, 3, 106, 0.16) !important;
    color: #d6036a !important;
}

.dashboard-stat-icon-success {
    background-color: rgba(25, 135, 84, 0.16) !important;
    color: #198754 !important;
}

.dashboard-stat-icon-info {
    background-color: rgba(13, 202, 240, 0.16) !important;
    color: #0dcaf0 !important;
}

.dashboard-stat-icon .bi {
    font-size: 1.75rem !important;
    line-height: 1;
    display: block;
}

.table th {
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
 
 /* --- MOBILE SIDEBAR IMPROVEMENTS --- */
 @media (max-width: 991.98px) {
     #sidebarMenu {
         position: fixed;
         top: 0;
         bottom: 0;
         left: 0;
         z-index: 1050;
         width: 280px;
         background: linear-gradient(180deg, #1f2328 0%, #171a1f 100%);
         transition: transform 0.3s ease, visibility 0.3s ease;
         transform: translateX(-100%);
         visibility: hidden;
         display: block !important;
         height: 100vh !important;
         overflow-y: auto;
         box-shadow: 4px 0 15px rgba(0,0,0,0.5);
     }

     #sidebarMenu .sidebar-shell {
         min-height: 100%;
     }
     
     #sidebarMenu.show {
         transform: translateX(0);
         visibility: visible;
     }
     
     /* Hauptinhalt nimmt volle Breite ein */
     .main-content {
         width: 100% !important;
         max-width: 100% !important;
         flex: 0 0 100% !important;
         margin-left: 0 !important;
         padding: 1.5rem !important;
     }
     
     /* Verstecke Sidebar-Brand auf Mobile im Menü (da oben schon Navbar) */
     .sidebar-brand {
         display: none !important;
     }

     .sidebar-top {
         padding-top: 0.75rem;
     }
 }

/* --- DESKTOP SIDEBAR FIXED WIDTH & COLLAPSIBLE --- */
@media (min-width: 992px) {
    .sidebar {
        width: 280px !important;
        flex: 0 0 280px !important;
        max-width: 280px !important;
        transition: width 0.25s ease, flex 0.25s ease, max-width 0.25s ease;
    }
    .main-content {
        width: calc(100% - 280px) !important;
        flex: 0 0 calc(100% - 280px) !important;
        max-width: calc(100% - 280px) !important;
        transition: width 0.25s ease, flex 0.25s ease, max-width 0.25s ease;
    }

    /* COLLAPSED STATE (MINI-SIDEBAR) */
    html.sidebar-collapsed .sidebar,
    body.sidebar-collapsed .sidebar {
        width: 76px !important;
        flex: 0 0 76px !important;
        max-width: 76px !important;
    }
    html.sidebar-collapsed .main-content,
    body.sidebar-collapsed .main-content {
        width: calc(100% - 76px) !important;
        flex: 0 0 calc(100% - 76px) !important;
        max-width: calc(100% - 76px) !important;
    }

    html.sidebar-collapsed .sidebar-brand-text,
    html.sidebar-collapsed .nav-link-text,
    html.sidebar-collapsed .sidebar-heading span,
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .nav-link-text,
    body.sidebar-collapsed .sidebar-heading span {
        display: none !important;
    }

    html.sidebar-collapsed .sidebar-heading,
    body.sidebar-collapsed .sidebar-heading {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        text-align: center;
    }

    html.sidebar-collapsed .sidebar-top,
    body.sidebar-collapsed .sidebar-top {
        flex-direction: column !important;
        gap: 0.5rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    html.sidebar-collapsed .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        padding: 0.6rem !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    html.sidebar-collapsed .nav-link,
    body.sidebar-collapsed .nav-link {
        justify-content: center !important;
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
        margin: 0.15rem 0.4rem !important;
    }

    html.sidebar-collapsed .nav-link i,
    body.sidebar-collapsed .nav-link i {
        font-size: 1.25rem;
    }

    html.sidebar-collapsed #sidebarDesktopToggle i,
    body.sidebar-collapsed #sidebarDesktopToggle i {
        transform: rotate(180deg);
    }
}

