:root {
    --main-bg: #f5f6fa;
    /* màu nền chung (background) */
    --main-cl: #2d2d44;
    --main-rd: #e6e6f0;
    --topbar-bg: #ffffff;
    --topbar-cl: #2d2d44;
    --topbar-rd: #e6e6f0;
    --sidebar-bg: #f8f9fc;
    --sidebar-cl: #3a3a50;
    --sidebar-rd: #e6e6f0;
    --button-bg: #4a6cf7;
    --button-cl: #ffffff;
    --button-rd: #3a5ce6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--main-bg);
    color: var(--main-cl);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* ==================== OVERLAY (lớp mờ) ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    color: #2d2d44;
    padding: 20px 0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.logo h2 {
    color: #2d2d44;
    font-size: 24px;
    font-weight: 700;
}

.menu {
    list-style: none;
}

.menu-item a,
.submenu-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #2d2d44;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
}

.menu-item a i,
.submenu-item a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.menu-item a:hover,
.submenu-item a:hover,
.menu-item.active>a {
    background: rgba(255, 255, 255, 0.15);
    color: #2d2d44;
    border-left: 4px solid #00d4ff;
    padding-left: 24px;
}

.group-title {
    font-weight: 600;
    color: #2d2d44 !important;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    margin-top: 15px;
}

/* Mục con (submenu-item) */
.submenu-item a {
    padding-left: 52px;
    font-size: 14px;
    color: #2d2d44;
}

.submenu-item a:hover {
    color: #2d2d44;
    background: #e6e6f0;
    padding-left: 56px;
}


.sidebar.active {
    left: 0;
    /* trượt vào */
}


/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .hamburger-btn {
        display: block;
    }

    /* Sidebar luôn ẩn ban đầu trên mobile */
    .sidebar {
        left: -300px;
    }

    .main-content,
    .topbar {
        margin-left: 6px;
        margin-right: 6px;
    }
}

@media (min-width: 993px) {
    .sidebar {
        left: 0;
        /* luôn hiện trên PC */
    }

    .hamburger-btn,
    .overlay {
        display: none;
    }

    .main-content,
    .topbar {
        margin-left: 350px;
        margin-right: 80px;
    }
}

/* ==================== TOPBAR ==================== */
.topbar {
    height: 60px;
    background: var(--topbar-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    margin-bottom: 40px;
    margin-top: 50px;
    /* margin-right: 100px; */
    color: var(--topbar-cl);
    border-radius: 1pc;
}

.topbar-end {
    height: 60px;
    background: var(--card);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hamburger-btn {
    /* font-size: 22px; */
    background: none;
    border: none;
    color: var(--topbar-cl);
    cursor: pointer;
    margin-right: 20px;
}

.hamburger-btn:hover {
    background: #34495e;
    transform: scale(1.05);
}

.topbar .brand {
    font-weight: bold;
    /* font-size:18px; */
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .user-info .balance {
    font-weight: 600;
    color: var(--topbar-cl);
}

.topbar .user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%
}

.topbar .user-info button {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 0;
    background: var(--button-bg);
    color: var(--button-cl);
    font-weight: 700;
    cursor: pointer
}

/* .main-content {
    margin-bottom: 40px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
} */
@media (max-width: 768px) {

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        height: auto;
        text-align: center;
        margin-top: 5px;
    }
    .topbar .user-info img {
        width: 10px;
        height: 10px;
        border-radius: 50%
    }
    .hamburger-btn {
        justify-self: start;
    }

    .user-info {
        justify-content: center;
    }
}