:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
    --primary-color: #232659;
    --hover-color: rgb(79, 81, 122);
    --active-color: rgb(79, 81, 122);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Make header full width */
#common-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    /* z-index: 1001 !important; */
    margin: 0 !important;
}

/* Push main content to the right when sidebar is present */
body.g-sidenav-show {
    padding-top: var(--header-height);
    transition: margin-left 0.3s ease;
}

body.g-sidenav-show .main-content {
    margin-left: var(--sidebar-width) !important;
    transition: margin-left 0.3s ease;
}

body.g-sidenav-show.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width) !important;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #1e2a5a 100%);
    transition: all 0.3s ease;
    /* z-index: 999; */
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    min-height: 80px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.brand-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flag-logo{
    width: 32px;
    height: 32px;
}
.brand-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Navigation */
.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.nav-dropdown {
    background: rgba(255, 255, 255, 0.05);
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.nav-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-left: auto;
}

.sidebar.collapsed .dropdown-arrow {
    opacity: 0;
}

.nav-dropdown.collapsed .dropdown-arrow {
    transform: rotate(-90deg);
}

/* Submenu */
.nav-submenu {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-dropdown.collapsed + .nav-submenu {
    max-height: 0;
}

.sidebar.collapsed .nav-submenu {
    display: none;
}

.nav-subitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 56px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-subitem:hover {
    background: rgb(79, 81, 122);
    color: var(--text-primary);
}

.nav-subitem.active {
    background: var(--active-color);
    color: var(--text-primary);
    font-weight: 500;
}

/* Badges */
.badge-new,
.badge-beta {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.badge-new {
    background: #ff6b35;
    color: white;
}

.badge-beta {
    background: #ff6b35;
    color: white;
}

.sidebar.collapsed .badge-new,
.sidebar.collapsed .badge-beta {
    opacity: 0;
}

/* Responsive */
@media (max-width: 1199px) {
    body.g-sidenav-show .main-content {
        margin-left: var(--sidebar-collapsed-width) !important;
    }
    
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar:hover {
        width: var(--sidebar-width);
    }
    
    .sidebar:hover ~ .main-content,
    body.g-sidenav-show .sidebar:hover ~ .main-content {
        margin-left: var(--sidebar-width) !important;
    }
}

@media (max-width: 768px) {
    body.g-sidenav-show {
        padding-top: var(--header-height);
    }
    
    body.g-sidenav-show .main-content {
        margin-left: 0 !important;
    }
    
    #common-header {
        position: fixed !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        top: var(--header-height);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.show ~ .main-content {
        margin-left: 0 !important;
    }
}