/*
 * ====================================================================
 * Professional Admin Panel Stylesheet (Final Version)
 * ====================================================================
 */

/* --- Core Layout & Variables --- */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #212529;
    --sidebar-link-color: rgba(255, 255, 255, 0.65);
    --sidebar-link-hover-color: #ffffff;
    --sidebar-link-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-link-active-bg: var(--bs-primary);
}
body { background-color: var(--bs-dark-bg-subtle); }
main { padding-top: 1.5rem; }
@media (min-width: 768px) {
    main { padding-left: var(--sidebar-width); }
}

/* --- Top Navigation Bar --- */
.navbar.sticky-top { border-bottom: 1px solid var(--bs-border-color-translucent); }
.navbar-brand img { max-height: 35px; }

/* --- Admin Sidebar --- */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--bs-border-color-translucent);
}

/*
 * --- THE MOBILE SCROLLING FIX ---
 * This crucial rule makes the body of the offcanvas sidebar scrollable
 * vertically if its content is taller than the screen.
 */
.admin-sidebar .offcanvas-body {
    overflow-y: auto;
}

.admin-sidebar .nav-link {
    display: flex; align-items: center; color: var(--sidebar-link-color);
    padding: 0.75rem 1.25rem; font-size: 0.95rem; font-weight: 500;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    border-radius: 0.375rem; margin: 0.1rem 0;
}
.admin-sidebar .nav-link:hover {
    background-color: var(--sidebar-link-hover-bg); color: var(--sidebar-link-hover-color);
}
.admin-sidebar .nav-link.active {
    background-color: var(--sidebar-link-active-bg); color: #ffffff;
}
.admin-sidebar .nav-link.parent-active {
     color: var(--sidebar-link-hover-color); background-color: var(--sidebar-link-hover-bg);
}
.admin-sidebar .nav-link .bi { width: 1.5rem; font-size: 1rem; }
.admin-sidebar .nav-link .bi-chevron-down { margin-left: auto; transition: transform 0.2s ease-in-out; }
.admin-sidebar .nav-link:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }

/* --- Sidebar Submenu --- */
.sidebar-submenu .nav-link {
    font-size: 0.875rem; padding-left: 3.25rem; color: var(--bs-tertiary-color); background-color: transparent;
}
.sidebar-submenu .nav-link.active {
    color: var(--bs-primary-text-emphasis); background-color: transparent !important; font-weight: bold;
}
.sidebar-submenu .nav-link:hover {
    color: var(--sidebar-link-hover-color); background-color: var(--sidebar-link-hover-bg);
}
