/* sidebar.css — Dark navy glass sidebar (260px) + global helpers */
:root {
    --nav-dark: #0f2743;
    --nav-mid: #162f4f;
    --accent: #2b7edc;
    --glass: rgba(255, 255, 255, 0.04);
    --muted: #9fb3d1;
    --white-85: rgba(255, 255, 255, 0.92);
    --sidebar-w: 260px;
    --radius: 12px;
    --focus: rgba(43, 126, 220, 0.18);
    --shadow-lg: 0 14px 50px rgba(8, 18, 36, 0.32);
    --shadow-sm: 0 6px 18px rgba(8, 18, 36, 0.18);
    --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

/* reset & base */
* {
    box-sizing: border-box
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font);
    color: #092035;
    /* Background handled in styles.css */
}

a {
    color: inherit
}

/* Header (replace current header with this or merge) */
/* Header styles moved to styles.css */
/*
#page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    background: linear-gradient(180deg, var(--nav-dark), var(--nav-mid));
    color: var(--white-85);
    z-index: 1400;
    box-shadow: var(--shadow-sm)
}
*/

#hamburger {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 0;
    color: var(--white-85);
    cursor: pointer;
    width: auto;
    height: 44px;
}

.hamburger-inner {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px
}

.hamburger-inner span {
    display: block;
    width: 20px;
    height: 3px;
    background: var(--white-85);
    border-radius: 3px;
    transition: all .22s
}

#hamburger.open .hamburger-inner span:nth-child(1) {
    transform: translateY(7px) rotate(45deg)
}

#hamburger.open .hamburger-inner span:nth-child(2) {
    opacity: 0
}

#hamburger.open .hamburger-inner span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg)
}

.menu-label {
    font-size: 0.68rem;
    letter-spacing: 1px;
    opacity: 0.95
}

/* Header-left */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo-img {
    height: 44px;
    width: 44px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 6px 20px rgba(12, 32, 60, 0.25)
}

.brand-title {
    font-weight: 800;
    font-size: 1.02rem;
    color: var(--white-85)
}

/* overlay */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 14, 30, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
    z-index: 1090;
    /* Below Sidebar (1100) but above content */
}

#overlay.show {
    opacity: 1;
    pointer-events: auto
}

/* SIDEBAR */
#sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    /* Below Header */
    bottom: 0;
    width: var(--sidebar-w);
    padding: 12px 12px 20px;
    background: linear-gradient(180deg, rgba(10, 20, 36, 0.96), rgba(14, 28, 48, 0.98));
    color: var(--white-85);
    transform: translateX(-110%);
    transition: transform .32s cubic-bezier(.22, .95, .28, 1);
    z-index: 1100;
    /* Below Header (1200) */
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    /* Explicit vertical scroll */
    padding-bottom: 50px;
    /* Space for scrolling */
    -webkit-overflow-scrolling: touch;
    /* smooth scroll ios */
    backdrop-filter: blur(6px);
}

#sidebar.show {
    transform: translateX(0)
}

/* sidebar top */
.sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03)
}

.sidebar-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: inset 0 -6px 14px rgba(0, 0, 0, 0.16)
}

.sb-name {
    font-weight: 800;
    font-size: 1rem
}

.sb-tag {
    font-size: 0.72rem;
    color: var(--muted)
}

/* nav items */
#sidebar-nav {
    margin-top: 10px;
    padding-bottom: 36px
}

#sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0
}

#sidebar-nav li {
    border-bottom: none;
    margin-bottom: 8px;
    /* Separate items */
}

#sidebar-nav a,
#sidebar-nav button.menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    color: var(--white-85);
    text-decoration: none;
    font-weight: 700;
    border-left: 6px solid transparent;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 8px;
}

#sidebar-nav a .fa-fw,
#sidebar-nav button .fa-fw {
    width: 26px;
    text-align: center;
    opacity: 0.98
}

#sidebar-nav a:hover,
#sidebar-nav button.menu-btn:hover {
    background: rgba(255, 255, 255, 0.02);
    border-left-color: var(--accent);
    color: #fff
}

#sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-left-color: var(--accent);
    color: #fff
}

/* caret - chevron style */
.menu-caret {
    margin-left: auto;
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    transition: transform .22s;
    opacity: 0.95
}

.menu-caret svg {
    width: 12px;
    height: 12px;
    transform: rotate(0deg);
    transition: transform .22s;
    stroke: var(--white-85);
}

/* submenu */
.submenu {
    display: none;
    flex-direction: column;
    background: transparent;
    padding-left: 0;
    margin: 0
}

.submenu.show {
    display: flex
}

.submenu a {
    padding: 10px 20px 10px 26px;
    font-weight: 600;
    color: var(--muted);
    border-left: 8px solid transparent
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.02);
    border-left-color: rgba(255, 255, 255, 0.04);
    color: #fff
}

/* content area helpers: expected structure on pages */
#content {
    padding: 92px 40px 40px 40px;
    min-height: calc(100vh - 92px);
    padding-bottom: 64px;
    /* Removed padding-left transition to prevent layout shift */
}

/* 
   REMOVED: body.sidebar-open #content { padding-left: ... } 
   Switching to Overlay Mode to fix "pushing down" issue.
*/

/* Clean sidebar.css: remove conflicting layout rules */
html,
body,
#page-footer {
    /* Layout handled by styles.css */
}

/* ...sidebar styles remain... */

/* accessibility focus */
a:focus,
button:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 8px
}

/* responsive */
@media (max-width:920px) {
    #sidebar {
        width: 86vw
    }

    /* REMOVED content padding shift for mobile too */

    .sidebar-logo {
        width: 48px;
        height: 48px
    }
}

@media (max-width:720px) {
    #page-header {
        padding: 0 10px
    }

    .brand-title {
        display: none
    }

    .logo-img {
        display: block
    }
}

/* Remove unwanted X inside menu */
#sidebar .menu-btn .fa-times,
#sidebar .fa-times:not(#sidebar-close i) {
    display: none !important;
}

/* caret fix */
.menu-caret svg {
    transform: rotate(0deg);
    transition: transform .22s;
}

button[aria-expanded="true"] .menu-caret svg {
    transform: rotate(180deg);
}