/* Desktop icon rail; pinning alone changes the content width. */
#gPageContent.sidebar-shell {
    --sidebar-rail: 64px;
    --sidebar-open: 272px;
    padding-left: var(--sidebar-rail);
    transition: padding-left .2s ease;
}
#gPageContent.sidebar-pinned { padding-left: var(--sidebar-open); }
#gPageContent.sidebar-shell .sidebar-menu {
    left: 0;
    width: var(--sidebar-rail);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #151e2b;
    border-right: 1px solid #2b3543;
    transition: width .2s ease;
}
#gPageContent.sidebar-expanded .sidebar-menu {
    width: var(--sidebar-open);
    box-shadow: 8px 0 24px rgb(15 23 42 / 12%);
}
.sidebar-rail-brand {
    height: 72px;
    flex-shrink: 0;
    color: #6ee7b7;
    font-size: 23px;
}
#gPageContent.sidebar-shell .sidebar-header {
    display: none;
    height: 72px;
    flex-shrink: 0;
    padding: 12px;
    background: transparent;
    border-color: #2b3543;
}
#gPageContent.sidebar-expanded .sidebar-header { display: block; }
#gPageContent.sidebar-expanded .sidebar-rail-brand { display: none; }
#gPageContent.sidebar-shell .logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    overflow: hidden;
    font-size: 13px;
    color: #e2e8f0;
}
#gPageContent.sidebar-shell .logo img { max-width: 90px; max-height: 40px; object-fit: contain; }
#gPageContent.sidebar-shell .main-menu { flex: 1; min-height: 0; height: auto; padding: 8px; }
#gPageContent.sidebar-shell .menu-inner { height: 100%; }
#gPageContent.sidebar-shell .menu-inner .scrollbar-track-y {
    width: 4px;
    background: transparent;
}
#gPageContent.sidebar-shell .menu-inner .scrollbar-thumb-y {
    width: 4px;
    border-radius: 999px;
    background: rgb(148 163 184 / 35%);
}
#gPageContent.sidebar-shell .menu-inner .scrollbar-track-y:hover .scrollbar-thumb-y {
    background: rgb(148 163 184 / 60%);
}
#gPageContent.sidebar-shell #sideMenu { margin: 0; padding: 0; }
#gPageContent.sidebar-shell #sideMenu > li,
#gPageContent.sidebar-shell #recent { margin: 4px 0; border: 0; }
#gPageContent.sidebar-shell #sideMenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px !important;
    border-radius: 7px;
    font-size: 13px;
    color: #cbd5e1;
    background: transparent;
}
#gPageContent.sidebar-shell #sideMenu a > i { flex: 0 0 20px; text-align: center; font-size: 17px; }
#gPageContent.sidebar-shell #sideMenu a > span { margin: 0; line-height: 1.5; }
#gPageContent.sidebar-shell #sideMenu a:not(:only-child) { padding-right: 28px !important; }
#gPageContent.sidebar-shell #sideMenu a:after {
    content: '';
    top: calc(50% - 3px);
    right: 13px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}
#gPageContent.sidebar-shell #sideMenu li.mm-active > a:after { transform: rotate(45deg); }
#gPageContent.sidebar-shell #sideMenu a:only-child:after { display: none; }
#gPageContent.sidebar-shell #sideMenu > li > a,
#gPageContent.sidebar-shell #recent > a {
    background: transparent;
    color: #cbd5e1;
}
#gPageContent.sidebar-shell #sideMenu > li.mm-active > a {
    background: #273341;
    color: #f1f5f9;
}
#gPageContent.sidebar-shell #sideMenu > li > a:hover,
#gPageContent.sidebar-shell #recent > a:hover { background: rgb(255 255 255 / 8%); color: #f8fafc; }
#gPageContent.sidebar-shell #sideMenu a > i { color: #94a3b8; }
#gPageContent.sidebar-shell #sideMenu > li.mm-active > a > i,
#gPageContent.sidebar-shell #sideMenu a:hover > i { color: #e2e8f0; }
#gPageContent.sidebar-shell #sideMenu a:after { color: #8d9bab; }
#gPageContent.sidebar-shell #recent > a {
    background: #198754;
    color: white;
}
#gPageContent.sidebar-shell #recent > a:hover { background: #157347; }
#gPageContent.sidebar-shell #recent > a > i,
#gPageContent.sidebar-shell #recent > a:after { color: white; }
#gPageContent.sidebar-shell #sideMenu li.selected { background: transparent !important; }
#gPageContent.sidebar-shell #sideMenu li.selected > a {
    color: #d1f2e5 !important;
    background: #234139 !important;
    box-shadow: inset 2px 0 #75c6a4;
}
#gPageContent.sidebar-shell #sideMenu li.selected > a > i { color: #9ad9c6; }
#gPageContent.sidebar-shell #sideMenu ul {
    background: #1b2638;
    border-radius: 8px; 
    padding-left: 0.5rem;
}
#gPageContent.sidebar-shell #sideMenu > li:not(#recent) > ul {
    background: #192431;
    border-radius: 0;
    border-left: 1px solid rgb(255 255 255 / 18%);
    margin-left: 1rem;
}
#gPageContent.sidebar-shell #sideMenu ul a {
    font-size: 12px;
    color: #a8b4c5;
}
#gPageContent.sidebar-shell #sideMenu ul a.sec_menu {
    background: transparent;
    color: #c5cedb;
}
#gPageContent.sidebar-shell #sideMenu ul li.mm-active > a.sec_menu {
    background: #22303e;
    color: #e2e8f0;
}
#gPageContent.sidebar-shell #sideMenu ul ul { background: #16212d; }
#gPageContent.sidebar-shell #sideMenu ul a:hover,
#gPageContent.sidebar-shell #recent ul a:hover {
    background: rgb(255 255 255 / 7%) !important;
    color: #f1f5f9;
}
#gPageContent.sidebar-shell #sideMenu li.selected > a:hover { background: #2a4b40 !important; }
#gPageContent.sidebar-shell:not(.sidebar-expanded) #sideMenu > li > ul,
#gPageContent.sidebar-shell:not(.sidebar-expanded) #recent > ul,
#gPageContent.sidebar-shell:not(.sidebar-expanded) #sideMenu a > span,
#gPageContent.sidebar-shell:not(.sidebar-expanded) #sideMenu a:after,
#gPageContent.sidebar-shell:not(.sidebar-expanded) .sideFooter { display: none !important; }
#gPageContent.sidebar-shell:not(.sidebar-expanded) #sideMenu > li > a,
#gPageContent.sidebar-shell:not(.sidebar-expanded) #recent > a { padding: 10px 12px !important; }
#gPageContent.sidebar-shell .sideFooter {
    position: static;
    flex-shrink: 0;
    padding: 16px 8px;
    color: #94a3b8;
    border-top: 1px solid #2b3543;
    font-size: 10px;
}
#gPageContent.sidebar-shell .nav-btn {
    margin-top: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
}


#gPageContent.sidebar-pinned .nav-btn { background: #d1fae5; border-color: #6ee7b7; color: #047857; }
#gPageContent.sidebar-shell a:focus-visible,
#gPageContent.sidebar-shell .nav-btn:focus-visible { outline: 2px solid #34d399; outline-offset: -2px; }
#gPageContent.sidebar-shell .menu-drawer-mask { display: none; }
@media (max-width: 767px) {
    #gPageContent.sidebar-shell { padding-left: 0; }
    #gPageContent.sidebar-shell .sidebar-menu {
        width: min(var(--sidebar-open), calc(100vw - 40px));
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .2s ease, visibility .2s;
    }
    #gPageContent.sidebar-expanded .sidebar-menu { transform: translateX(0); visibility: visible; }
    #gPageContent.sidebar-expanded .menu-drawer-mask { display: block; background: rgb(15 23 42 / 45%); z-index: 99; }
}
@media (prefers-reduced-motion: reduce) {
    #gPageContent.sidebar-shell,
    #gPageContent.sidebar-shell .sidebar-menu { transition: none; }
}
