/* Sidebar Styles */

.dashboard-sidebar {
    min-height: calc(100vh - 56px); /* Subtract navbar height */
    background: #ffffff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    border-right: 1px solid #e5e7eb;
    position: relative;
    z-index: 1020;
}

/* Sidebar Links */
.sidebar-link {
    color: #6b7280;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-link:hover {
    background: #f3f4f6;
    color: #374151;
}

.sidebar-link.active {
    background: #eff6ff;
    color: #6366f1;
    border-left-color: #6366f1;
    font-weight: 600;
}

.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #6366f1;
    border-radius: 3px 0 0 3px;
}

/* Sidebar Icons */
.sidebar-link i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link.active i {
    color: #6366f1;
}

/* Sidebar Badges */
.sidebar-link .badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    min-width: 1.5rem;
    text-align: center;
}

/* Sidebar Divider */
.dashboard-sidebar hr {
    border-color: #e5e7eb;
    opacity: 1;
}

/* Sidebar Collapse */
.sidebar-collapse {
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Sidebar Header (optional) */
.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
}

/* Sidebar Footer (optional) */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
}

/* Sidebar User Info (optional) */
.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Nested Menu Items */
.sidebar-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
    background-color: #f9fafb;
}

.sidebar-submenu .sidebar-link {
    padding-left: 3.5rem;
    font-size: 0.875rem;
}

/* Mobile Sidebar */
@media (max-width: 767.98px) {
    .dashboard-sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease;
    }
    
    .dashboard-sidebar.show {
        left: 0;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }
}

/* Compact Sidebar (optional) */
.sidebar-compact .sidebar-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.sidebar-compact .sidebar-link i {
    font-size: 1rem;
    width: 1.25rem;
}

/* Dark Sidebar Theme (optional) */
.sidebar-dark {
    background-color: #1f2937;
    border-right-color: #374151;
}

.sidebar-dark .sidebar-link {
    color: #d1d5db;
}

.sidebar-dark .sidebar-link:hover {
    background-color: #374151;
    color: #f9fafb;
}

.sidebar-dark .sidebar-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.sidebar-dark hr {
    border-color: #374151;
}

/* Sidebar Animation */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.dashboard-sidebar.animate {
    animation: slideIn 0.3s ease;
}

/* Sidebar Scroll */
.dashboard-sidebar nav {
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

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

.dashboard-sidebar nav::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.dashboard-sidebar nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.dashboard-sidebar nav::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}