@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ===== Main Sidebar Container ===== */
.main-sidebar {
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid #e5e7eb !important;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.main-sidebar.elevation-2 {
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02) !important;
}

.sidebar {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: transparent !important;
    padding-top: 0 !important;
}

/* ===== Brand/Logo Section ===== */
.sidebar .user-panel {
    display: flex !important;
    align-items: center !important;
    padding: 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    background: #fafbfc;
    border-radius: 0 !important;
}

.sidebar .user-panel .image {
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar .user-panel .image img {
    max-width: 160px !important;
    max-height: 45px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 6px !important;
    border: none !important;
    object-fit: contain;
}

.sidebar .user-panel .info {
    margin-left: 12px !important;
    padding: 0 !important;
    flex: 1;
    min-width: 0;
}

.sidebar .user-panel .info a {
    color: #111827 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    line-height: 1.3;
    display: block !important;
    padding: 0 !important;
}

.sidebar .user-panel .info small,
.sidebar .user-panel .info .admin-subtitle {
    color: #9ca3af !important;
    font-size: 11px !important;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

/* ===== Scrollable Menu Container ===== */
.sidebar-menu-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 80px);
    padding: 8px;
}

.sidebar-menu-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* ===== Navigation Reset ===== */
.sidebar .nav-sidebar {
    padding: 0;
}

.sidebar .nav-item {
    margin: 0 !important;
}

/* ===== Main Nav Links ===== */
.sidebar .nav-sidebar > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 1px 0;
    border-radius: 8px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background: #f3f4f6;
    color: #475569;
}

/* ===== Nav Icons ===== */
.sidebar .nav-link .nav-icon {
    width: 18px !important;
    font-size: 14px !important;
    margin-right: 10px !important;
    color: #9ca3af;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.sidebar .nav-link:hover .nav-icon,
.sidebar .nav-sidebar > .nav-item > .nav-link.active .nav-icon,
.sidebar .menu-open > .nav-link .nav-icon {
    color: #475569;
}

/* ===== Nav Link Text ===== */
.sidebar .nav-link p {
    margin: 0 !important;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    flex: 1;
    line-height: 1.4;
}

[class*="sidebar-light-"] .sidebar a {
    color: #4b5563;
}

/* ===== Arrow/Chevron Icon ===== */
.sidebar .nav-link .right,
.sidebar .nav-link .fa-angle-left {
    font-size: 10px !important;
    color: #d1d5db;
    margin-left: auto;
    transition:
        transform 0.2s ease,
        color 0.15s ease;
}

.sidebar .menu-open > .nav-link .right,
.sidebar .menu-open > .nav-link .fa-angle-left {
    transform: rotate(-90deg);
    color: #475569;
}

/* ===== Active State ===== */
.sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    color: #475569 !important;
}

/* ===== Menu Open State ===== */
.sidebar .menu-open > .nav-link {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    color: #475569 !important;
}

.sidebar .menu-open > .nav-link p {
    color: #475569 !important;
    font-weight: 600;
}

/* ===== Submenu/Treeview ===== */
.sidebar .nav-treeview {
    background: transparent;
    padding: 2px 0 2px 28px;
    margin: 0;
}

.sidebar .nav-treeview .nav-item {
    margin: 0 !important;
}

.sidebar .nav-treeview .nav-link {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    color: #6b7280 !important;
    border-radius: 6px;
    margin: 1px 0 !important;
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar .nav-treeview .nav-link::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 5px;
    height: 5px;
    background: #d1d5db;
    border-radius: 50%;
    transform: translateY(-50%);
    transition: background 0.15s ease;
}

.sidebar .nav-treeview .nav-link:hover {
    background: #f9fafb;
    color: #475569 !important;
}

.sidebar .nav-treeview .nav-link:hover::before {
    background: #475569;
}

.sidebar .nav-treeview .nav-link.active {
    background: #f3f4f6;
    color: #475569 !important;
    font-weight: 600;
}

.sidebar .nav-treeview .nav-link.active::before {
    background: #475569;
}

/* Hide default submenu bullet icons */
.sidebar .nav-treeview .nav-icon {
    display: none !important;
}

/* ===== Nav Header/Section Labels ===== */
.nav-header {
    color: #9ca3af !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 12px 6px 12px !important;
}

/* ===== Modern sidebar container ===== */
.modern-sidebar {
    border-right: 1px solid #e5e7eb !important;
}

/* ===== Dark Mode Support ===== */
.dark-mode .main-sidebar {
    background: #1e293b;
    border-right-color: #334155 !important;
}

.dark-mode .sidebar .user-panel {
    background: #1a2332;
    border-bottom-color: #334155 !important;
}

.dark-mode .sidebar .user-panel .info a {
    color: #f1f5f9 !important;
}

.dark-mode .sidebar .user-panel .info small {
    color: #64748b !important;
}

.dark-mode [class*="sidebar-light-"] .sidebar a,
.dark-mode .sidebar .nav-link p {
    color: #cbd5e1;
}

.dark-mode .sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background: #334155;
}

.dark-mode .sidebar .nav-sidebar > .nav-item > .nav-link.active,
.dark-mode .sidebar .menu-open > .nav-link {
    background: linear-gradient(
        135deg,
        rgba(71, 85, 105, 0.2),
        rgba(100, 116, 139, 0.15)
    ) !important;
}

.dark-mode .sidebar .nav-treeview .nav-link {
    color: #94a3b8 !important;
}

.dark-mode .sidebar .nav-treeview .nav-link::before {
    background: #475569;
}

.dark-mode .sidebar .nav-treeview .nav-link:hover {
    background: #334155;
    color: #94a3b8 !important;
}

.dark-mode .sidebar .nav-treeview .nav-link:hover::before,
.dark-mode .sidebar .nav-treeview .nav-link.active::before {
    background: #94a3b8;
}

.dark-mode .sidebar .nav-treeview .nav-link.active {
    background: rgba(71, 85, 105, 0.15);
    color: #94a3b8 !important;
}

.dark-mode .sidebar-menu-scroll::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark-mode .nav-header {
    color: #64748b !important;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    input#userSearch {
        width: 80% !important;
    }
}
