/* Menu hệ thống trái + thanh thành viên (sau đăng nhập) */

:root {
    --ht-cam-dam: #f37021;
    --ht-cam-nhat: #ffb380;
    --ht-cam-nen: #fd8a3a;
    --ht-menu-rong: 280px;
}

.dau-trang__trai {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.nut-ht-menu {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--ht-cam-dam), #fd6802);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.28);
}

.nut-ht-menu span,
.nut-ht-menu span::before,
.nut-ht-menu span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
}

.nut-ht-menu span::before,
.nut-ht-menu span::after {
    content: "";
    position: absolute;
    left: 0;
}

.nut-ht-menu span::before { top: -6px; }
.nut-ht-menu span::after { top: 6px; }

.nut-ht-menu[aria-expanded="true"] {
    filter: brightness(1.05);
}

/* Sidebar */
.ht-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: var(--ht-menu-rong);
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    padding: 0.85rem 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    color: #fff;
    background: linear-gradient(180deg, var(--ht-cam-dam) 0%, var(--ht-cam-nen) 48%, var(--ht-cam-nhat) 100%);
    box-shadow: 8px 0 28px rgba(180, 60, 0, 0.22);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    overflow: hidden;
}

body.ht-menu-mo .ht-menu {
    transform: translateX(0);
}

.ht-menu__dau {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
}

.ht-menu__thuong-hieu {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}

.ht-menu__logo-vong {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.ht-menu__logo-vong img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.ht-menu__ten {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.98rem;
}

.ht-menu__thu-gon {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ht-menu__thu-gon svg {
    width: 16px;
    height: 16px;
}

.ht-menu__ngu-canh {
    margin: 0;
    padding: 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.92;
}

.ht-menu__ds {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: auto;
    padding-right: 0.15rem;
    flex: 1;
}

.ht-menu__muc {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    transition: background 0.18s ease, transform 0.18s ease;
}

.ht-menu__muc:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ht-menu__muc.dang-chon {
    background: rgba(255, 255, 255, 0.36);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.ht-menu__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.95;
}

.ht-menu__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ht-menu__nhan {
    min-width: 0;
    line-height: 1.25;
}

.ht-menu__lop-an {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(40, 18, 0, 0.35);
}

body.ht-menu-mo .ht-menu__lop-an[hidden] {
    display: block;
}

@media (min-width: 999px) {
    body.co-ht-menu.ht-menu-mo .bo-cuc-cong-khai__dau,
    body.co-ht-menu.ht-menu-mo .bo-cuc-cong-khai__noi-dung,
    body.co-ht-menu.ht-menu-mo .chan-trang {
        padding-left: var(--ht-menu-rong);
        transition: padding-left 0.28s ease;
    }

    body.quan-tri.co-ht-menu.ht-menu-mo .ht-khung {
        padding-left: var(--ht-menu-rong);
        transition: padding-left 0.28s ease;
    }

    body.quan-tri.co-ht-menu.ht-menu-mo .ht-menu__lop-an {
        display: none !important;
    }
}

/* Thành viên header */
.ht-thanh-vien {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.55rem 0.3rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffe0c2 0%, #ffc896 100%);
    box-shadow: 0 2px 8px rgba(243, 112, 33, 0.18);
}

.ht-thanh-vien--qt {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 224, 194, 0.85) 100%);
}

.ht-chuong {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    border-radius: 50%;
}

.ht-chuong svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ht-chuong__dem {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.2rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 0.4rem;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ht-thanh-vien__hop {
    position: relative;
}

.ht-thanh-vien__nut {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0.15rem 0.15rem 0.15rem 0;
    color: #1568d9;
    font: inherit;
    font-weight: 700;
}

.ht-thanh-vien__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #5a6578;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d7dbe5;
    overflow: hidden;
}

.ht-thanh-vien__avatar svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ht-thanh-vien__ten {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.92rem;
}

.ht-thanh-vien__mui {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ht-thanh-vien__menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 210px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 30, 80, 0.16);
    padding: 0.4rem;
    z-index: 130;
}

.ht-thanh-vien__menu a,
.ht-thanh-vien__menu button {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: #1a1a1a;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
}

.ht-thanh-vien__menu a:hover,
.ht-thanh-vien__menu button:hover {
    background: #f3f5f9;
}

.ht-thanh-vien__xoa,
.ht-thanh-vien__menu .ht-thanh-vien__xoa {
    color: #dc2626;
}

.ht-thanh-vien__xoa svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Quản trị shell */
body.quan-tri.co-ht-menu {
    background: #f5f7fb;
}

body.quan-tri .qt-khung.ht-khung {
    display: block;
    min-height: 100vh;
    grid-template-columns: none;
}

.ht-dau-qt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, #f37021 0%, #fd8a3a 55%, #ffb380 100%);
    box-shadow: 0 2px 10px rgba(243, 112, 33, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ht-dau-qt__trai {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ht-dau-qt__ve-trang {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.ht-dau-qt__ve-trang:hover {
    text-decoration: underline;
}

@media (max-width: 667px) {
    .ht-thanh-vien__ten {
        max-width: 96px;
        font-size: 0.82rem;
    }

    .dau-trang__logo img {
        width: min(150px, 38vw);
    }
}
