html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
canvas {
    max-width: 100%;
    height: auto;
}

body {
    background: #f8f9fb;
    color: #1f2937;
}

/* BUTTONS */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #111827;
    padding: 8px;
}

.sidebar-close {
    display: none;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 24px 16px;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo-link {
    text-decoration: none;
}

.logo {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #2563eb;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #374151;
    font-size: 18px;
}

    .nav-item:hover {
        background: #f3f4f6;
    }

    .nav-item.active {
        background: #eef2ff;
        color: #2563eb;
        font-weight: 600;
    }

/* LAYOUT */
.page-wrapper {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-right {
    display: flex;
    gap: 12px;
}

.topbar-link {
    text-decoration: none;
    color: #111827;
    padding: 10px 14px;
    border-radius: 10px;
}

    .topbar-link:hover {
        background: #f3f4f6;
    }

.main-content {
    flex: 1;
    padding: 32px 24px;
}

/* OVERLAY */
.sidebar-overlay {
    display: none;
}

/* MOBILE */
@media (max-width: 768px) {
    .logo {
        margin-top: 40px;
        font-size: 28px;
    }

    .menu-toggle {
        display: block;
        margin-right: auto;
    }

    .sidebar {
        left: -280px;
        z-index: 2000;
        transition: left 0.3s ease;
    }

        .sidebar.open {
            left: 0;
        }

    .sidebar-close {
        display: none;
    }

    @media (max-width: 768px) {
        .sidebar-close {
            display: block;
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            line-height: 1;
            z-index: 2100;
        }

        .logo {
            margin-top: 40px;
        }
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1500;
    }

        .sidebar-overlay.open {
            display: block;
        }

    .page-wrapper {
        margin-left: 0;
    }

    .topbar {
        justify-content: space-between;
        padding: 12px 16px;
    }

    .main-content {
        padding: 16px;
    }
}
