html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.page-wrapper {
    /* wrap toàn bộ content */
    overflow-x: hidden;
    max-width: 100%;
    /* dùng % thay vì vw */
}

/* Global mobile overflow prevention */
@media (max-width: 767px) {

    .container,
    .container-fluid {
        overflow-x: hidden;
    }

    /* Header container must stay visible so dropdowns (language, profile) aren't clipped */
    .mobile-header .container-fluid {
        overflow: visible;
    }

    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    .footer_contact-link span,
    .footer_contact-link {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .footer_grid {
        overflow: hidden;
    }
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(3px);
    z-index: 1080;
    display: none;
}

.mobile-overlay.show {
    display: block;
}

.mobile-sidenav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 285px;
    max-width: 85%;
    background: #fff;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    border-radius: 24px 0 0 24px;
    overflow: hidden;
    box-shadow: -12px 0 48px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility .3s;
}

.mobile-sidenav.show {
    transform: translateX(0);
    visibility: visible;
}

.sidenav-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .7);
    font-size: 14px;
    z-index: 2;
}

.sidenav-close:hover {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.sidenav-profile-head {
    padding: 28px 20px 20px;
    background: linear-gradient(135deg, #0B1860, #1E2D8F 60%, #2B50D0);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sidenav-profile-head::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 16px 16px;
}

.sidenav-profile-head::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 52, 26, .2), transparent 70%);
    top: -60px;
    right: -30px;
}

.sidenav-ph-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidenav-ph-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: 2px solid rgba(255, 255, 255, .25);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidenav-ph-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidenav-ph-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.sidenav-ph-handle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 2px;
}

.sidenav-ph-email {
    font-size: 11px;
    color: rgba(255, 255, 255, .4);
}

.sidenav-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: none;
}

.sidenav-nav-body::-webkit-scrollbar {
    display: none;
}

.sidenav-nav-group {
    padding: 0 10px;
    margin-bottom: 4px;
}

.sidenav-nav-group-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94A3B8;
    padding: 12px 10px 6px;
}

.sidenav-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}

.sidenav-nav-item:hover {
    background: #EEF1FB;
}

.sidenav-nav-item:hover .sidenav-ni-icon {
    background: #DDE4F6;
}

.sidenav-nav-item:hover .sidenav-ni-icon i {
    color: #2B50D0;
}

.sidenav-nav-item:hover .sidenav-ni-label {
    color: #1E2D8F;
}

.sidenav-ni-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}

.sidenav-ni-icon i {
    font-size: 16px;
    color: #64748B;
    transition: color .15s;
}

.sidenav-ni-label {
    font-size: 13.5px;
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.sidenav-nav-div {
    height: 1px;
    background: #F1F5F9;
    margin: 6px 20px;
    flex-shrink: 0;
}

.sidenav-nav-logout {
    margin: 0 10px 12px;
    flex-shrink: 0;
}

.sidenav-logout-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    border: none;
    background: none;
    width: 100%;
    text-decoration: none;
}

.sidenav-logout-btn:hover {
    background: #FFF1EE;
}

.sidenav-logout-btn:hover .sidenav-ni-icon {
    background: #FFE2DB;
}

.sidenav-logout-btn:hover .sidenav-ni-icon i {
    color: #E8341A;
}

.sidenav-logout-btn:hover .sidenav-lb-text {
    color: #E8341A;
}

.sidenav-lb-text {
    font-size: 13.5px;
    font-weight: 500;
    color: #64748B;
}

/* Mobile avatar button */
.header-bar__avatar-mobile {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E8EAF6;
    cursor: pointer;
}

.header-bar__avatar-mobile:hover {
    border-color: #3949AB;
}

@media (min-width: 992px) {

    .mobile-sidenav,
    .mobile-overlay {
        display: none !important;
    }
}

.position-sticky {
    top: 20px;
    height: max-content;
}

.top-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.top-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s ease;
}

.top-tab i {
    font-size: 16px;
}

.top-tab:hover {
    background: #f3f4f6;
    color: #111827;
}

/* BADGE */
.tab-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}

/* ACTIVE TAB */
.top-tab.active {
    background: #eef2ff;
    color: #1d4ed8;
}

.top-tab.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -9px;
    height: 3px;
    border-radius: 999px;
    background: #2563eb;
}

.top-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.top-tab:focus {
    outline: none;
}

.top-tab:focus-visible {
    outline: 2px solid #c7d2fe;
    outline-offset: 2px;
}

/* ===== SKELETON BASE ===== */
.skeleton-img,
.skeleton-line {
    background: linear-gradient(90deg,
            #e5e7eb 25%,
            #f3f4f6 37%,
            #e5e7eb 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ===== GRID ===== */
.skeleton-img {
    height: 200px;
    border-radius: 12px;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.skeleton-line.w-50 {
    width: 50%;
}

.skeleton-line.w-60 {
    width: 60%;
}

.skeleton-line.w-75 {
    width: 75%;
}

.skeleton-line.w-90 {
    width: 90%;
}

.skeleton-line.w-100 {
    width: 100%;
}

/* ===== LIST ===== */
.skeleton-list .skeleton-img {
    height: 300px;
}

.author-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1f1f1;
}

/* ===== PAGINATION MOBILE FIX (global) ===== */
/* ===== PAGINATION — mobile fit ===== */
@media (max-width: 575px) {
    .pagination {
        font-size: 12px;
    }

    .pagination .page-link {
        padding: .25rem .5rem;
    }

    .filter-paging .row {
        flex-direction: column;
        gap: 8px;
    }
}