/* =========================
   ADMIN SIDEBAR LAYOUT
========================= */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: #0f172a;
    /* Slate 900 */
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: hidden;
    /* Hidden by default */
    transition: transform 0.3s ease;
    z-index: 1000;
}

.admin-sidebar:hover {
    overflow-y: auto;
    /* Show on hover */
}

/* Custom Scrollbar */
.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-brand {
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav {
    padding: 20px 0;
    flex: 1;
}

/* Shared style for links and dropdown toggles */
.admin-nav a,
.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #94a3b8;
    /* Slate 400 */
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    /* Reset font size from admin-nav-group */
    text-transform: none;
    /* Reset transform */
    letter-spacing: normal;
    /* Reset spacing */
    margin: 0;
}

.admin-nav a:hover,
.admin-nav a.active,
.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--secondary);
}

.admin-nav-group {
    padding: 0 24px;
    margin-top: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Dropdown Toggle Specifics */
.dropdown-toggle {
    justify-content: space-between;
}

.dropdown-toggle .arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.dropdown-toggle .arrow.rotate {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    background: rgba(0, 0, 0, 0.2);
}

.submenu.open {
    max-height: 500px;
    /* Arbitrary large height */
}

.submenu a {
    padding-left: 40px;
    /* Indent Child Links */
    font-size: 0.9rem;
}

.admin-main {
    flex: 1;
    background-color: #f1f5f9;
    /* Light Gray */
    padding: 0;
    /* Padding inside content */
    min-width: 0;
    /* Prevent flex overflow */
}

/* Mobile Toggle Button (Admin) */
.admin-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--secondary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    z-index: 1100;
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    /* Overlay when sidebar open */
    .admin-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }

    .admin-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .admin-toggle-btn {
        display: flex;
    }
}