/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR STYLES
   ═══════════════════════════════════════════════════════════════════════ */

.sidebar {
    background-color: #212529;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    width: clamp(220px, 20vw, 250px);
}

.sidebar-header {
    position: sticky;
    top: 0;
    background-color: #1a1d20;
    z-index: 10;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    background-color: #1a1d20;
    z-index: 10;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 1rem;
}

.sidebar .nav-link span {
    flex: 1;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-primary);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(var(--color-primary-rgb), 0.2);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

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

.sidebar-divider {
    margin: 1rem 0 0.5rem 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-divider small {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Toggle button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1060;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        width: clamp(250px, 80vw, 300px);
        height: 100vh;
        max-height: 100vh;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

@media (max-width: 575px) {
    .sidebar {
        width: 100vw;
    }

    .sidebar .nav-link {
        padding: 0.875rem 1rem;
    }

    .sidebar .nav-link span {
        font-size: 0.95rem;
    }
}

@media (min-width: 1920px) {
    .sidebar {
        width: 280px;
    }

    .sidebar .nav-link {
        padding: 0.875rem 1.75rem;
    }
}
