@charset "UTF-8";

/* ============================
   GLOBALINV Sidebar - ChainScope Style
   Dark charcoal sidebar with green accents
   ============================ */

/* --- 1. Variables --- */
:root {
    --sidebar-bg: #000000;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --sidebar-accent: #4db6ac;
    --sidebar-active-bg: #2d7a4a;
    --sidebar-text: rgba(255, 255, 255, 0.6);
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-section-text: rgba(255, 255, 255, 0.3);
}

/* --- 2. Sidebar Shell --- */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg) !important;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', 'Poppins', sans-serif;
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

/* --- 3. Header --- */
.main-sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: #fff;
    height: 100%;
    flex-grow: 1;
}

.header-logo .desktop-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.logo-icon-wrap {
    width: 36px;
    height: 36px;
    background: rgba(77, 182, 172, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-wrap i {
    font-size: 22px;
    color: var(--sidebar-accent);
}

.header-logo .logo-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.header-logo .logo-icon i {
    font-size: 26px;
    color: var(--sidebar-accent);
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #fff !important;
    letter-spacing: 0.5px;
    line-height: 1;
}

.logo-text span {
    color: var(--sidebar-accent);
    position: relative;
}

/* Explicitly hide any theme-injected pseudo icons */
.logo-text:before,
.logo-text:after,
.logo-text span:before,
.logo-text span:after {
    display: none !important;
}

.header-logo .logo-icon {
    display: none !important;
}

/* --- Toggle Button --- */
.app-sidebar__toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
    flex-shrink: 0;
}

.app-sidebar__toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.header-icon {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5) !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle icon swap logic */
.app-sidebar__toggle .close-toggle {
    display: block;
}

.app-sidebar__toggle .open-toggle {
    display: none;
}

.app.sidenav-toggled .app-sidebar__toggle .close-toggle {
    display: none;
}

.app.sidenav-toggled .app-sidebar__toggle .open-toggle {
    display: block;
}

/* Fix Icon sizes in collapsed */
.app.sidenav-toggled .header-logo .logo-icon i {
    font-size: 24px;
}

/* --- 4. Menu Area --- */
.main-sidemenu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Section Labels */
.side-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sidebar-section-text);
    padding: 20px 20px 8px 20px;
}

.side-menu {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

/* Menu Items */
.side-menu__item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 9px 14px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--sidebar-text) !important;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.side-menu__icon {
    font-size: 20px;
    margin-right: 12px;
    color: var(--sidebar-text) !important;
    transition: color 0.2s ease;
    min-width: 20px;
    text-align: center;
    opacity: 0.8;
}

.side-menu__label {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

/* Hover State */
.side-menu__item:hover {
    background: var(--sidebar-hover-bg);
    color: rgba(255, 255, 255, 0.85) !important;
}

.side-menu__item:hover .side-menu__icon {
    color: rgba(255, 255, 255, 0.85) !important;
    opacity: 1;
}

/* Active State - Solid green like ChainScope */
.slide.active .side-menu__item {
    background: var(--sidebar-active-bg) !important;
    color: #fff !important;
    font-weight: 600;
}

.slide.active .side-menu__icon {
    color: #fff !important;
    opacity: 1;
}

/* --- 5. Sidebar Profile (bottom) --- */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin: auto 10px 10px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-profile-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-profile-email {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(248, 81, 73, 0.1);
    color: #f85149 !important;
    text-decoration: none !important;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-logout-btn i {
    font-size: 18px;
}

.sidebar-logout-btn:hover {
    background: rgba(248, 81, 73, 0.2);
    transform: scale(1.05);
}

/* --- 6. Collapsed State --- */
.app.sidenav-toggled .app-sidebar {
    width: var(--sidebar-collapsed-width);
}

.app.sidenav-toggled .app-content {
    margin-left: var(--sidebar-collapsed-width);
}

.app.sidenav-toggled .main-sidebar-header {
    padding: 0;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    height: auto;
    min-height: 56px;
}

.app.sidenav-toggled .header-logo .desktop-logo {
    display: none;
}

.app.sidenav-toggled .header-logo .logo-icon {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.app.sidenav-toggled .app-sidebar__toggle {
    position: static;
    margin: 0;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* Hide section labels */
.app.sidenav-toggled .side-section-label {
    display: none;
}

/* Collapsed menu items */
.app.sidenav-toggled .side-menu {
    padding: 4px 0;
}

.app.sidenav-toggled .main-sidemenu {
    padding: 0;
}

.app.sidenav-toggled .side-menu__item {
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 40px;
    margin: 0 auto 2px auto;
    border-radius: 10px;
}

.app.sidenav-toggled .side-menu__icon {
    margin-right: 0;
    font-size: 20px;
}

.app.sidenav-toggled .side-menu__label {
    display: none;
}

/* Collapsed profile */
.app.sidenav-toggled .sidebar-profile {
    flex-direction: column;
    gap: 6px;
    padding: 10px 6px;
    margin: auto 6px 6px 6px;
}

.app.sidenav-toggled .sidebar-profile-info {
    display: none;
}

.app.sidenav-toggled .sidebar-profile-img {
    width: 32px;
    height: 32px;
}

.app.sidenav-toggled .sidebar-logout-btn {
    width: 28px;
    height: 28px;
}

.app.sidenav-toggled .sidebar-logout-btn i {
    font-size: 16px;
}

/* --- 7. Scrollbar --- */
.main-sidemenu::-webkit-scrollbar {
    width: 4px;
}

.main-sidemenu::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidemenu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.main-sidemenu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- 8. Mobile & Tablet (Half Screen) --- */
@media (max-width: 991px) {
    .app-sidebar {
        left: -100% !important;
        width: 280px !important;
        max-width: 280px !important;
        z-index: 2000 !important;
        /* Extremely high to stay on top */
        pointer-events: auto !important;
    }

    .side-menu__item {
        pointer-events: auto !important;
    }

    .app-content,
    .main-header {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .app.sidenav-toggled .app-sidebar {
        left: 0 !important;
    }

    .app.sidenav-toggled .app-content {
        margin-left: 0 !important;
    }

    .app.sidenav-toggled .app-sidebar__overlay {
        visibility: visible;
        opacity: 1;
        z-index: 1040;
    }

    .app-sidebar__toggle {
        display: flex !important;
    }

    /* In mobile, show full sidebar (not collapsed) */
    .app.sidenav-toggled .side-section-label {
        display: block;
    }

    .app.sidenav-toggled .side-menu {
        padding: 0 10px;
    }

    .app.sidenav-toggled .side-menu__item {
        justify-content: flex-start;
        padding: 9px 14px;
        width: auto;
        height: auto;
        margin: 0 0 2px 0;
    }

    .app.sidenav-toggled .side-menu__icon {
        margin-right: 12px;
    }

    .app.sidenav-toggled .side-menu__label {
        display: inline;
    }

    .app.sidenav-toggled .header-logo .desktop-logo {
        display: flex;
    }

    .app.sidenav-toggled .header-logo .logo-icon {
        display: none;
    }

    .app.sidenav-toggled .main-sidebar-header {
        flex-direction: row;
        padding: 0 20px;
        height: 64px;
        min-height: unset;
        gap: 0;
    }

    .app.sidenav-toggled .sidebar-profile {
        flex-direction: row;
        margin: auto 10px 10px 10px;
        padding: 14px 16px;
    }

    .app.sidenav-toggled .sidebar-profile-info {
        display: flex;
    }
}

/* --- 9. Overlay --- */
.app-sidebar__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Slightly lighter overlay */
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}

/* --- 10. Override color.css & style-dark.css --- */
/* These files try to set .app-sidebar bg to #5066e0 (blue). Override them. */
.app-sidebar,
.dark-theme .app-sidebar,
.dark-theme .main-sidebar-header,
.leftmenu-color .app-sidebar,
.leftmenu-dark .app-sidebar,
aside.app-sidebar {
    background: #000000 !important;
    box-shadow: none !important;
    z-index: 2000 !important;
    pointer-events: auto !important;
}

.app-sidebar .slide .side-menu__item,
.leftmenu-color .app-sidebar .slide .side-menu__item,
.leftmenu-dark .app-sidebar .slide .side-menu__item {
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: auto !important;
}

.app-sidebar .slide .side-menu__item.active,
.dark-theme .app-sidebar .slide.active .side-menu__item {
    background: var(--sidebar-active-bg) !important;
}

/* Reset color.css overrides on sidebar items */
.side-menu__item.active,
.side-menu__item:focus,
.side-menu__item:hover {
    color: #fff !important;
}

.app-sidefooter,
.leftmenu-color .app-sidebar .app-sidefooter,
.leftmenu-dark .app-sidebar .app-sidefooter,
.dark-theme .app-sidefooter,
.slide.is-expanded {
    background: transparent !important;
}

.main-sidebar-header,
.dark-theme .main-sidebar-header {
    background: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}