* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, Arial, sans-serif;
}

:root {
    --blue: #1f2937;
    --blue-light: #374151;
    --danger: #dc2626;
}

/* ================= MOBILE HEADER ================= */
.top-header {
    height: 60px;
    background: var(--blue);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1001;
}

/* ================= HAMBURGER (PERFECT X) ================= */
.hamburger {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 4px;
    transform: translateX(-50%);
    transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 17px; }
.hamburger span:nth-child(3) { top: 23px; }

.hamburger.active span:nth-child(1) {
    top: 17px;
    transform: translateX(-50%) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    top: 17px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Header title right */
.mobile-title {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* ================= LAYOUT ================= */
body {
    display: flex;
    min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 240px;
    background: var(--blue);
    color: white;
    display: flex;
    flex-direction: column;
}

/* Desktop logo */
.logo {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    border-bottom: 1px solid var(--blue-light);
}

.logo-icon {
    font-size: 28px;
}

/* Navigation */
.nav {
    flex-grow: 1;
    padding: 12px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: #e5e7eb;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.nav a:hover,
.nav a.active {
    background: var(--blue-light);
}

.nav-icon {
    font-size: 22px;
}

/* Logout */
.logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid var(--blue-light);
    cursor: pointer;
    transition: background 0.25s ease;
}

.logout:hover {
    background: var(--danger);
}

/* ================= MAIN CONTENT ================= */
.content {
    flex-grow: 1;
    padding: 0px;
}

/* ================= MOBILE (FULL SCREEN MENU + FIXED LOGOUT) ================= */
@media (max-width: 768px) {

    body {
        flex-direction: column;
    }

    /* Hide desktop-only items */
    .desktop-only {
        display: none;
    }

    /* FULL SCREEN SIDEBAR */
    .sidebar {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        padding-top: 80px;           /* space below header */
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* MENU SCROLLS */
    .nav {
        flex: 1;
        overflow-y: auto;
    }

    /* LOGOUT ALWAYS VISIBLE */
    .logout {
        margin-top: auto;
        position: sticky;
        bottom: 0;
        background: var(--blue);
    }

    .content {
        padding-top: 90px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ================= DESKTOP ================= */
@media (min-width: 769px) {

    /* hide mobile header */
    .top-header {
        display: none;
    }

    /* FIXED SIDEBAR */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 240px;
        height: 100vh;
        overflow: hidden; /* 🔥 NO SCROLL */
        z-index: 1000;
    }

    /* ONLY CONTENT SCROLLS */
    .content {
        margin-left: 240px;
        height: 100vh;
        overflow-y: auto;
        padding: 20px;
    }

    /* STOP PAGE SCROLL */
    body {
        overflow: hidden;
    }
}