:root {
    --mnv-green: #12aa5b;
    --mnv-green-dark: #078946;
    --mnv-green-soft: #eafaf1;
    --mnv-cyan: #42cbd0;
    --mnv-cyan-soft: #effcfd;
    --mnv-text: #172033;
    --mnv-muted: #8490a6;
    --mnv-line: #e8edf3;
    --mnv-sheet-bg: #f8fbfa;
    --mnv-nav-height: 70px;
    --mnv-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mnv-font-vietnamese: "Segoe UI", "Noto Sans", Roboto, Helvetica, Arial, Tahoma, sans-serif;
}

.mnv-root {
    display: none;
}

.mnv-root,
.mnv-root button,
.mnv-root a,
.mnv-root h1,
.mnv-root h2,
.mnv-root h3,
.mnv-root h4,
.mnv-root p,
.mnv-root label,
.mnv-root span {
    font-family: var(--mnv-font-vietnamese) !important;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mnv-root .mnv-card-label,
.mnv-root .mnv-tab-button > span:last-child,
.mnv-root .mnv-panel-heading h3,
.mnv-root .mnv-panel-heading p,
.mnv-root .mnv-sheet-header h2,
.mnv-root .mnv-sheet-header p,
.mnv-root .mnv-count,
.mnv-root .mnv-bottom-item > span:last-child {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    line-height: 1.45;
}

.mnv-root .mnv-card-label,
.mnv-root .mnv-tab-button > span:last-child,
.mnv-root .mnv-bottom-item > span:last-child {
    font-weight: 600;
}

.mnv-root .mnv-sheet-header h2,
.mnv-root .mnv-panel-heading h3 {
    font-weight: 700;
}

.mnv-root i,
.mnv-root i::before {
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 1180px) {
    html.mnv-enabled body {
        padding-bottom: calc(var(--mnv-nav-height) + var(--mnv-safe-bottom)) !important;
    }

    html.mnv-enabled body.mnv-open {
        overflow: hidden !important;
    }

    /* Giữ thanh logo/menu cũ, chỉ tắt danh sách xổ xuống cũ */
    .mobile-menu {
        display: block !important;
        position: relative;
        z-index: 1200;
    }

    .mobile-menu .mobile-menu-bar {
        display: flex !important;
        position: relative;
        z-index: 2;
    }

    .mobile-menu > ul,
    .mobile-menu > .border-t {
        display: none !important;
    }

    #mobile-menu-toggler {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mnv-root {
        position: fixed;
        inset: 0;
        z-index: 2147482000;
        display: block;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        pointer-events: none;
        font-family: var(--mnv-font-vietnamese);
    }

    .mnv-root .mnv-backdrop,
    .mnv-root .mnv-sheet,
    .mnv-root .mnv-bottom-bar {
        pointer-events: auto;
    }

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

    .mnv-root button,
    .mnv-root a {
        -webkit-tap-highlight-color: transparent;
    }

    .mnv-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2147482001;
        width: 100%;
        height: 100%;
        border: 0;
        padding: 0;
        background: rgba(20, 31, 42, .48);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .16s ease, visibility .16s ease;
    }

    .mnv-root.is-open .mnv-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mnv-sheet {
        position: fixed;
        left: 50%;
        bottom: calc(var(--mnv-nav-height) + var(--mnv-safe-bottom) - 1px);
        z-index: 2147482002;
        width: min(100%, 620px);
        height: min(86dvh, 760px);
        max-height: calc(100vh - var(--mnv-nav-height) - var(--mnv-safe-bottom) - 16px);
        max-height: calc(100dvh - var(--mnv-nav-height) - var(--mnv-safe-bottom) - 16px);
        border: 1px solid rgba(223, 229, 236, .92);
        border-bottom: 0;
        border-radius: 28px 28px 0 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 -20px 60px rgba(26, 42, 58, .18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, calc(100% + 24px));
        transition:
            transform .16s ease-out,
            opacity .14s ease,
            visibility .14s ease;
    }

    .mnv-sheet.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }

    .mnv-sheet-handle {
        width: 42px;
        height: 5px;
        margin: 10px auto 2px;
        border-radius: 999px;
        flex: 0 0 auto;
        background: #e6edf4;
    }

    .mnv-sheet-header {
        min-height: 76px;
        padding: 13px 16px 13px 20px;
        border-bottom: 1px solid var(--mnv-line);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex: 0 0 auto;
        background: rgba(255, 255, 255, .96);
    }

    .mnv-sheet-header h2 {
        margin: 0;
        color: var(--mnv-text);
        font-size: 17px;
        font-weight: 800;
        line-height: 1.35;
    }

    .mnv-sheet-header p {
        margin: 3px 0 0;
        color: var(--mnv-muted);
        font-size: 11px;
        font-weight: 500;
    }

    .mnv-close {
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid #e1e7ee;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        color: #7d8ca2;
        background: #fff;
        box-shadow: 0 4px 12px rgba(31, 45, 61, .10);
        cursor: pointer;
    }

    .mnv-close i {
        font-size: 16px;
    }

    .mnv-sheet-layout {
        min-height: 0;
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        overflow: hidden;
        background: linear-gradient(135deg, #ffffff 0%, #eefaf4 100%);
    }

    .mnv-tab-rail {
        min-height: 0;
        padding: 8px 7px 16px;
        border-right: 1px solid var(--mnv-line);
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow-x: hidden;
        overflow-y: auto;
        background: #f8fafc;
        scrollbar-width: none;
    }

    .mnv-tab-rail::-webkit-scrollbar {
        display: none;
    }

    .mnv-tab-button {
        width: 100%;
        min-height: 68px;
        padding: 8px 4px;
        border: 0;
        border-radius: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: #627187;
        background: transparent;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.25;
        text-align: center;
        cursor: pointer;
        transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
    }

    .mnv-tab-button.is-active {
        color: #fff;
        background: linear-gradient(145deg, #18b963, #08a653);
        box-shadow: 0 10px 22px rgba(18, 170, 91, .24);
    }

    .mnv-tab-icon {
        width: 35px;
        height: 35px;
        border: 1px solid #e2e9ef;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--mnv-green);
        background: #fff;
        box-shadow: 0 3px 10px rgba(31, 45, 61, .06);
    }

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

    .mnv-tab-button.is-active .mnv-tab-icon {
        border-color: rgba(255, 255, 255, .18);
        color: #fff;
        background: rgba(255, 255, 255, .16);
        box-shadow: none;
    }

    .mnv-sheet-content {
        min-width: 0;
        min-height: 0;
        padding: 14px 12px 28px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #cfd9e3 transparent;
    }

    .mnv-tab-panel[hidden] {
        display: none !important;
    }

    .mnv-panel-heading {
        margin-bottom: 12px;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .mnv-panel-heading h3 {
        margin: 0;
        color: var(--mnv-text);
        font-size: 14px;
        font-weight: 800;
        line-height: 1.35;
    }

    .mnv-panel-heading p {
        margin: 3px 0 0;
        color: var(--mnv-muted);
        font-size: 10px;
        font-weight: 500;
    }

    .mnv-count {
        min-width: 50px;
        min-height: 27px;
        padding: 6px 9px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--mnv-green);
        background: #eafbf1;
        font-size: 9px;
        font-weight: 800;
        white-space: nowrap;
    }

    .mnv-card-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .mnv-card {
        min-width: 0;
        min-height: 89px;
        padding: 14px 8px;
        border: 1px solid #e5eaf0;
        border-radius: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: var(--mnv-text);
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 3px 12px rgba(31, 45, 61, .04);
        text-align: center;
        cursor: pointer;
        transition:
            transform .16s ease,
            border-color .16s ease,
            box-shadow .16s ease;
    }

    .mnv-card:active {
        transform: scale(.97);
    }

    .mnv-card:hover {
        border-color: #bff1e0;
        color: var(--mnv-text);
        box-shadow:
            0 4px 0 rgba(18, 170, 91, .05),
            0 10px 20px rgba(31, 45, 61, .09);
    }

    .mnv-card.is-danger {
        color: #dc3545;
    }

    .mnv-card-icon {
        width: 42px;
        height: 42px;
        border: 1px solid #bff0f2;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #078946;
        background: #eafaf1;
    }

    .mnv-card-icon i {
        font-size: 19px;
    }

    .mnv-card.is-danger .mnv-card-icon {
        border-color: #ffd7dd;
        color: #ef5969;
        background: #fff4f5;
    }

    .mnv-card-label {
        max-width: 100%;
        overflow: hidden;
        color: inherit;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.35;
        overflow-wrap: anywhere;
        text-overflow: ellipsis;
    }

    .mnv-bottom-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2147482003;
        height: calc(var(--mnv-nav-height) + var(--mnv-safe-bottom));
        padding: 6px 10px var(--mnv-safe-bottom);
        border-top: 1px solid #e5e9ee;
        display: grid;
        grid-template-columns: 1fr 1fr 76px 1fr 1fr;
        align-items: center;
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -10px 30px rgba(31, 45, 61, .10);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mnv-bottom-item {
        min-width: 0;
        height: 56px;
        padding: 4px 2px;
        border: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #65758c;
        background: transparent;
        font-size: 11px;
        font-weight: 700;
        text-align: center;
        cursor: pointer;
    }

    .mnv-bottom-item.is-active {
        color: var(--mnv-green-dark);
    }

    .mnv-bottom-icon {
        width: 31px;
        height: 31px;
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: inherit;
    }

    .mnv-bottom-item.is-active .mnv-bottom-icon {
        color: var(--mnv-green);
        background: var(--mnv-green-soft);
    }

    .mnv-bottom-icon i {
        font-size: 17px;
    }

    .mnv-center-button {
        width: 64px;
        height: 64px;
        margin: -26px auto 0;
        padding: 0;
        border: 5px solid #fff;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        color: #fff;
        background: linear-gradient(145deg, #25c875, #0ba555);
        box-shadow:
            0 10px 28px rgba(18, 170, 91, .28),
            0 0 0 1px rgba(18, 170, 91, .12);
        cursor: pointer;
    }

    .mnv-center-button img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        background: #fff;
    }

    .mnv-center-button i {
        font-size: 24px;
    }

    @media (min-width: 600px) {
        .mnv-sheet {
            bottom: calc(var(--mnv-nav-height) + var(--mnv-safe-bottom) + 8px);
            height: min(80dvh, 760px);
            border: 1px solid rgba(223, 229, 236, .96);
            border-radius: 28px;
        }

        .mnv-sheet-layout {
            grid-template-columns: 112px minmax(0, 1fr);
        }

        .mnv-tab-rail {
            padding: 10px 9px 18px;
        }

        .mnv-tab-button {
            min-height: 76px;
            font-size: 10px;
        }

        .mnv-sheet-content {
            padding: 17px 16px 30px;
        }

        .mnv-card {
            min-height: 96px;
        }

        .mnv-bottom-bar {
            left: 50%;
            width: min(100%, 720px);
            transform: translateX(-50%);
            border: 1px solid #e5e9ee;
            border-bottom: 0;
            border-radius: 18px 18px 0 0;
        }
    }

    @media (max-width: 359px) {
        .mnv-sheet-layout {
            grid-template-columns: 82px minmax(0, 1fr);
        }

        .mnv-card-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .mnv-bottom-bar {
            grid-template-columns: 1fr 1fr 66px 1fr 1fr;
            padding-left: 4px;
            padding-right: 4px;
        }

        .mnv-center-button {
            width: 58px;
            height: 58px;
        }
    }
}

/* Dialogs and notifications must remain above the mobile navigation and API sheet. */
html.mnv-enabled .swal2-container,
html.mnv-enabled .alert-wrapper,
html.mnv-enabled .toast-container,
html.mnv-enabled #toast-container {
    z-index: 2147483500 !important;
}

@media (max-width: 1180px) {
    html.mnv-enabled .modal-backdrop {
        z-index: 2147482999 !important;
    }

    html.mnv-enabled .modal,
    html.mnv-enabled .pgb-modal,
    html.mnv-enabled .msb-approval-modal {
        z-index: 2147483000 !important;
    }
}

@media (max-width: 1180px) {
    .mnv-root.is-open {
        position: fixed;
        z-index: 2147482000;
    }

    .mnv-root.is-open ~ .mobile-menu,
    body.mnv-open .mobile-menu {
        pointer-events: none;
    }

    body.mnv-open .mobile-menu-bar {
        filter: brightness(.78);
    }
}

/*
 * iPad/tablet (<= 1180px): dùng header mobile làm điều hướng chính.
 * - Ẩn sidebar PC vì đã có bottom navigation + sheet danh mục.
 * - Ẩn logo trong navbar PC để không bị trùng 2 logo với header mobile.
 * Navbar PC vẫn giữ để hiển thị số dư, thông báo, đổi ngôn ngữ.
 */
@media (max-width: 1180px) {
    .stc-desktop-sidebar {
        display: none !important;
    }

    .stc-desktop-navbar-logo {
        display: none !important;
    }

    .mobile-menu.stc-mobile-header {
        display: block !important;
    }
}

/* Desktop (>= 1181px) chỉ dùng sidebar/navbar PC, không hiện header mobile. */
@media (min-width: 1181px) {
    .mobile-menu.stc-mobile-header {
        display: none !important;
    }

    .stc-desktop-sidebar {
        display: block;
    }

    .stc-desktop-navbar-logo {
        display: flex;
    }
}

.mnv-root .mnv-card {
    position: relative;
}

.mnv-root .mnv-card.is-current {
    border-color: #86d9b0 !important;
    background:
        linear-gradient(
            145deg,
            rgba(240, 253, 246, .98),
            rgba(220, 252, 235, .98)
        ) !important;
    box-shadow:
        0 0 0 1px rgba(18, 170, 91, .12),
        0 6px 18px rgba(7, 137, 70, .08) !important;
}

.mnv-root .mnv-card.is-current .mnv-card-icon {
    border-color: #a7e8c6 !important;
    color: #078946 !important;
    background: #dcfce7 !important;
}

.mnv-root .mnv-card.is-current .mnv-card-label {
    color: #066b39 !important;
    font-weight: 750 !important;
}

.mnv-root .mnv-card-check {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #078946;
    box-shadow: 0 4px 10px rgba(7, 137, 70, .18);
    font-size: 9px;
}

.mnv-root .mnv-card-check i {
    font-size: 9px;
}

.mnv-root .mnv-tab-button.is-active {
    position: relative;
}

.mnv-root .mnv-tab-button.is-active::after {
    position: absolute;
    top: 8px;
    right: 7px;
    width: 8px;
    height: 8px;
    border: 2px solid rgba(255, 255, 255, .92);
    border-radius: 999px;
    content: "";
    background: #fff;
}




.mnv-root [data-mnv-context-open="categories"] > * {
    pointer-events: none;
}

.mnv-root :is(a, button):focus-visible {
    outline: 3px solid #12aa5b;
    outline-offset: 3px;
}

.mnv-root .mnv-brand-icon {
    width: 56px;
    height: 48px;
    padding: 5px;
    border-color: #e8edf3 !important;
    background: #fff !important;
    overflow: hidden;
}

.mnv-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mnv-brand-icon [hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .mnv-tab-rail {
        overscroll-behavior: contain;
    }

    .mnv-tab-button {
        flex-shrink: 0;
        font-size: 11px;
    }

    .mnv-panel-heading p {
        font-size: 11px;
    }

    .mnv-card-icon {
        flex-shrink: 0;
        border-color: #d1efdf;
    }

    .mnv-bottom-item {
        transition: color .18s ease, transform .18s ease;
    }

    .mnv-bottom-item:active,
    .mnv-center-button:active {
        transform: scale(.95);
    }

    .mnv-center-button {
        transition: transform .18s ease;
    }
}

@media (min-width: 600px) and (max-width: 1180px) {
    .mnv-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .mnv-root *,
    .mnv-root *::before,
    .mnv-root *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
