
:root {
    --sidebar-width: 280px;
    --header-height: 70px;
    --primary-color: #2563eb;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --text-light: #cbd5e1;
    --border-color: #334155;
    --white: #ffffff;
    --gray: #f8fafc;
    --dark: #313237;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    overflow-x: hidden;
}

/* Modern Header */
#main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#main-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    padding: 0 2rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.navbar-toggler {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.navbar-toggler:hover {
    background: #f1f5f9;
}

/* Modern Sidebar */
#sidebarMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

#sidebarMenu.collapsed {
    transform: translateX(-100%);
}

/* Logo Section */
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-header-text h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.sidebar-header-text p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0.5rem 0;
}

/* Sidebar Group (replaces MDB accordion) */
.sidebar-group {
    margin-bottom: 2px;
}

.sidebar-group-toggle {
    background: transparent;
    color: var(--text-light);
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sidebar-group-toggle span {
    display: flex;
    align-items: center;
}

.sidebar-group-toggle span i {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-group-toggle:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-group-toggle.open {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.sidebar-group-toggle.open .sidebar-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-submenu.open {
    max-height: 500px;
}

.sidebar-submenu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem 0.75rem 3rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.sidebar-submenu li a i {
    margin-right: 0.75rem;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.sidebar-submenu li a:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-submenu li a.active {
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
}

.sidebar-submenu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
}

/* Main Content */
main {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

main.expanded {
    margin-left: 0;
}

/* Messages */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Scrollbar */
#sidebarMenu::-webkit-scrollbar {
    width: 6px;
}

#sidebarMenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#sidebarMenu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#sidebarMenu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 991px) {
    #sidebarMenu {
        transform: translateX(-100%);
    }

    #sidebarMenu:not(.collapsed) {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .overlay.show {
        display: block;
    }
}

@media (min-width: 992px) {
    .navbar-toggler {
        display: none;
    }
}

/* Animations */
.animate-bottom {
    animation: animatebottom 0.4s;
}

@keyframes animatebottom {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.bg-sidebar {
    background: var(--white) !important;
    color: var(--primary-color) !important;

}
/* End sidebar */


.bg-white {
    background: var(--white) !important;
    color: var(--primary-color) !important;
}

.bg-secondary {
    background: var(--gray) !important;
    color: var(--primary-color) !important;

}

.text-primary {
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color) !important;
    color: var(--white);
    font-weight: bold;
}

.btn-primary:hover {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    transition: 5s all;
}

.sidenav {
    height: 100vh !important;
    background: var(--white) !important;
    color: var(--dark) !important;
    padding: 32px 16px;
}

hr {
    background: var(--primary-color) !important;
}

.list-group-item a {
    color: var(--dark);
}

.list-group-item a:hover {
    color: var(--primary-color);
}

.list-group-item a.active {
    color: var(--primary-color);
    background: none;
}

.list-group-item a.activer {
    color: var(--primary-color);
    background: none;
}

.fs-16 {
    font-size: 16px !important;
    font-weight: normal;
}

.list-group-light {
    padding-left: 16px !important;
}

.nav-item {
    background: var(--gray) !important;
    text-transform: none;
}

.nav-item .nav-link.active {
    background: var(--gray) !important;
    color: var(--primary-color) !important;
}

.table-primary {
    background: var(--primary-color) !important;
    color: var(--white) !important;
}

tr[data-href] {
    cursor: pointer;
}

tr[data-href]:hover td {
    background-color: rgba(37, 99, 235, 0.06) !important;
}