:root {
    --sidebar-width: 300px;
    --brand-bg: #2c7da0;
    --brand-accent: #90e0ef;
    --text: #1f2937;
    --border: #e5e7eb;
    --bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius: 14px;
    --speed: 300ms;
    --easing: cubic-bezier(.2, .8, .2, 1);
}

html,
body {
    height: 100%;
}

body {
    color: var(--text);
}

/* --- Hamburger  --- */
.hamburger {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 1100;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 4px;
    transition: opacity 0.3s ease;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    /* white hamburger */
    border-radius: 2px;
    transition: background 0.3s ease;
}

/* Hide hamburger when sidebar is open */
body.sidebar-open .hamburger {
    opacity: 0;
    pointer-events: none;
}
.hamburger span {
    background: white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

/* Sidebar close button (X) */
.close-btn {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2);
}

/* Sidebar container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    max-width: 86vw;
    height: 100%;
    background: var(--bg);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform var(--speed) var(--easing);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

/* Open state */
body.sidebar-open .sidebar {
    transform: translateX(0);
}

/* Backdrop */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1040;
    opacity: 0;
    transition: opacity var(--speed) var(--easing);
}

body.sidebar-open .backdrop {
    opacity: 1;
}

/* Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--brand-bg);
    color: #fff;
}

.brand {
    font-weight: 700;
    letter-spacing: .5px;
}

.close-btn {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* Nav items */
.sidebar-nav {
    padding: 10px 10px 20px;
    overflow: auto;
}

.item,
.subitem {
    display: block;
    padding: 10px 12px;
    margin: 4px 0;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
}

.item:hover,
.subitem:hover {
    background: #f5f7fb;
}

.item.active {
    background: var(--brand-accent);
    color: #083344;
    font-weight: 600;
}

/* Collapsible groups */
.group {
    margin: 8px 0;
}

.group>summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.group[open]>summary {
    background: #eef7fb;
}

.group>summary::-webkit-details-marker {
    display: none;
}

.subitem {
    padding-left: 24px;
}

/* Prevent body scroll while open on small screens */
@media (max-width: 1024px) {
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Layout helper if you want a persistent sidebar on large screens */
@media (min-width: 1025px) {
    body.sidebar-persistent .sidebar {
        transform: translateX(0);
        position: sticky;
        top: 0;
    }

    body.sidebar-persistent .backdrop {
        display: none !important;
    }
}