/* ==============================================
   AGRE Web V2 - App-style layout
   Giữ màu sắc gốc từ Content/style.css
   ============================================== */

:root {
    --v2-tabbar-h: 56px;
    --v2-tabbar-inset: 68px;
    --v2-tabbar-extra-pad: 12px;
    --v2-header-h: 52px;
    --v2-tab-inactive: #5A6B5A;
    --v2-tab-active: #1B6B2A;
    --v2-tabbar-bg: #FFFFFF;
    --v2-tabbar-border: #D4E0D4;
}

body.agre-v2 {
    scroll-padding-bottom: var(--v2-tabbar-inset);
}

body.agre-v2:not(.page-v2-map) .main-content {
    padding-bottom: 0.5rem;
}

body.agre-v2:not(.page-v2-map) .agre-v2-tabbar-spacer {
    display: block;
    flex-shrink: 0;
    width: 100%;
    height: var(--v2-tabbar-inset);
    pointer-events: none;
}

body.agre-v2.page-v2-map .agre-v2-tabbar-spacer {
    display: none !important;
    height: 0 !important;
}

body.agre-v2.page-v2-map .main-content {
    padding-bottom: 0 !important;
}

/* ===== MODAL / OFFCANVAS - không bị tab bar che (mọi trang V2) ===== */
body.agre-v2 .modal {
    padding-bottom: var(--v2-tabbar-inset) !important;
    z-index: 1400 !important;
}

body.agre-v2 .modal-backdrop {
    z-index: 1350 !important;
}

body.agre-v2 .modal-dialog:not(.modal-fullscreen) {
    max-height: calc(100dvh - var(--v2-tabbar-inset) - 1rem);
    margin-bottom: calc(var(--v2-tabbar-extra-pad) + 0.35rem);
}

body.agre-v2 .modal-dialog-centered {
    min-height: calc(100% - var(--v2-tabbar-inset) - 0.5rem);
}

body.agre-v2 .modal-dialog-scrollable .modal-content {
    max-height: calc(100dvh - var(--v2-tabbar-inset) - 1.25rem);
}

body.agre-v2 .modal-dialog-scrollable .modal-body {
    max-height: calc(100dvh - var(--v2-tabbar-inset) - 8.5rem);
    overflow-y: auto;
}

body.agre-v2 #wrapAgreMapShell .modal,
body.agre-v2 #wrapAgreMapShell .modal-backdrop {
    z-index: 2500 !important;
}

body.agre-v2 #wrapAgreMapShell .modal-backdrop {
    z-index: 2490 !important;
}

/* ===== HEADER V2 - 1 hàng app (IMG_0015) ===== */
body.agre-v2 #pwaIosHint {
    display: none !important;
}

body.agre-v2 .site-header.site-header-v2 {
    background: var(--primary, #1B6B2A);
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: none !important;
    height: var(--v2-header-h);
    min-height: var(--v2-header-h);
    max-height: var(--v2-header-h);
    overflow: hidden;
}

body.agre-v2 .site-header-v2__inner {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100%;
    max-height: 100%;
    padding: 0 0.25rem;
    max-width: 100%;
    box-sizing: border-box;
}

body.agre-v2 .site-header-v2__slot {
    flex: 0 0 3.5rem;
    width: 3.5rem;
    max-width: 3.5rem;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    height: 100%;
    z-index: 2;
}

body.agre-v2 .site-header-v2__slot--start {
    justify-content: flex-start;
    padding-left: 0.15rem;
}

body.agre-v2 .site-header-v2__slot--end {
    justify-content: flex-end;
    padding-right: 0.1rem;
}

body.agre-v2 .site-header-v2__back {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
}

body.agre-v2 .site-header-v2__back:hover {
    opacity: 0.85;
}

body.agre-v2 .site-header-v2__back[hidden] {
    display: none !important;
}

body.agre-v2 .site-header-v2__center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    z-index: 1;
}

body.agre-v2 .site-header-v2__brand {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1.2;
    max-width: 100%;
    padding: 0 0.25rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.agre-v2 .site-header-v2__brand-home {
    display: inline-flex;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    margin-right: 0.35rem;
}

body.agre-v2 .site-header-v2__brand-home:hover,
body.agre-v2 .site-header-v2__brand-home:focus {
    color: inherit;
    text-decoration: none;
}

body.agre-v2 .site-header-v2__brand-home:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
    border-radius: 8px;
}

body.agre-v2 .site-header-v2__brand .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 1.05rem;
    border-radius: 50%;
    margin-right: 0;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
    background: transparent;
    position: relative;
    perspective: 120px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

body.agre-v2 .site-header-v2__brand .brand-icon img,
body.agre-v2 .site-header-v2__brand .brand-icon .brand-icon__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transform-style: preserve-3d;
    animation: agreBrandIconSpin 2.5s linear infinite;
    will-change: transform;
}

body.agre-v2 .site-header-v2__brand .brand-icon .brand-icon__shade {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(0, 0, 0, 0.35) 100%);
}

@media (prefers-reduced-motion: reduce) {
    body.agre-v2 .site-header-v2__brand .brand-icon img,
    body.agre-v2 .site-header-v2__brand .brand-icon .brand-icon__img {
        animation: none;
    }
}

@keyframes agreBrandIconSpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

body.agre-v2 .site-header-v2__brand-name {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

body.agre-v2 .site-header-v2__brand-org {
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    min-width: 0;
    flex-shrink: 0;
}

body.agre-v2 .site-header-v2__brand-org::before {
    content: '·';
    margin: 0 0.35em;
    opacity: 0.75;
    font-weight: 400;
}

body.agre-v2 .site-header-v2__brand-tagline {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
    display: none;
}

body.agre-v2 .site-header-v2__brand-tagline::before {
    content: '·';
    margin: 0 0.35em;
    opacity: 0.75;
    font-weight: 400;
}

@media (min-width: 576px) {
    body.agre-v2 .site-header-v2__brand-name { font-size: 0.98rem; }
    body.agre-v2 .site-header-v2__brand-org { font-size: 0.86rem; }
    body.agre-v2 .site-header-v2__brand-tagline {
        display: inline;
        font-size: 0.8rem;
    }
}

/* Tagline chỉ khi đủ rộng (≥992); org luôn hiện */
@media (min-width: 576px) and (max-width: 991.98px) {
    body.agre-v2 .site-header-v2__brand-tagline {
        display: none !important;
    }
}

@media (min-width: 992px) {
    body.agre-v2 .site-header-v2__brand-name { font-size: 1.02rem; }
    body.agre-v2 .site-header-v2__brand-org { font-size: 0.88rem; }
    body.agre-v2 .site-header-v2__brand-tagline { font-size: 0.84rem; }
}

/* Tablet (Tab 8.7"…): khi brand - bỏ slot trống 2 bên, căn trái dùng hết chiều ngang */
@media (max-width: 1199.98px) {
    body.agre-v2 .site-header-v2.is-brand .site-header-v2__slot {
        flex: 0 0 0;
        width: 0;
        max-width: 0;
        min-width: 0;
        padding: 0;
        overflow: hidden;
    }

    body.agre-v2 .site-header-v2.is-brand .site-header-v2__inner {
        padding-left: 0.4rem;
        padding-right: 0.5rem;
    }

    body.agre-v2 .site-header-v2.is-brand .site-header-v2__center {
        justify-content: flex-start;
        text-align: left;
    }

    body.agre-v2 .site-header-v2.is-brand .site-header-v2__brand {
        padding: 0;
        max-width: 100%;
        justify-content: flex-start;
    }
}

/* ≤ tablet: org luôn hiện; ẩn tagline khi hẹp */
@media (max-width: 991.98px) {
    body.agre-v2 .site-header-v2.is-brand .site-header-v2__brand-tagline {
        display: none !important;
    }

    body.agre-v2 .site-header-v2__brand-name {
        font-size: 0.9rem;
    }

    body.agre-v2 .site-header-v2__brand-org {
        font-size: 0.78rem;
        display: inline !important;
        flex-shrink: 0;
        overflow: visible;
    }
}

/* Header gọn - điện thoại */
@media (max-width: 575.98px) {
    body.agre-v2 .site-header-v2__inner {
        padding-left: 0;
        padding-right: 0.15rem;
    }

    body.agre-v2 .site-header-v2__brand-home {
        margin-right: 0.2rem;
    }

    body.agre-v2 .site-header-v2__brand .brand-icon {
        width: 26px;
        height: 26px;
        font-size: 0.95rem;
    }

    body.agre-v2 .site-header-v2__brand-name {
        font-size: 0.88rem;
    }

    body.agre-v2 .site-header-v2__brand-tagline {
        display: none;
    }

    body.agre-v2 .site-header-v2__brand-org::before {
        margin: 0 0.22em;
    }

    body.agre-v2 .main-content > .container-fluid {
        padding-left: 0.35rem !important;
        padding-right: 0.5rem !important;
    }
}

body.agre-v2 .site-header-v2__title {
    margin: 0;
    padding: 0 0.25rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    max-width: 100%;
}

body.agre-v2 .site-header-v2__title.has-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    overflow: hidden;
    max-width: calc(100% - 0.5rem);
}

body.agre-v2 .site-header-v2__title-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

body.agre-v2 .site-header-v2__title-back:hover {
    opacity: 0.85;
}

body.agre-v2 .site-header-v2__title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

body.agre-v2 .site-header.site-header-v2.has-title-back .site-header-v2__slot--start,
body.agre-v2 .site-header.site-header-v2.has-title-back .site-header-v2__slot--end {
    flex: 0 0 0;
    width: 0;
    max-width: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

body.agre-v2 .site-header-v2__title[hidden],
body.agre-v2 .site-header-v2__brand[hidden] {
    display: none !important;
}

@media (min-width: 768px) {
    body.agre-v2 .site-header-v2__slot {
        flex-basis: 4.25rem;
        width: 4.25rem;
        max-width: 4.25rem;
    }
    body.agre-v2 .site-header-v2__title {
        font-size: 1.125rem;
    }
}

/* Ẩn header/nav cũ khi dùng V2 */
body.agre-v2 .site-header:not(.site-header-v2) { display: none !important; }

/* Ẩn footer HTML cũ */
body.agre-v2 .site-footer { display: none !important; }

.agre-v2-page-title-data {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* ===== BOTTOM TAB BAR - nền trắng như IMG_0015 ===== */
.agre-v2-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    box-sizing: border-box;
    min-height: 52px;
    background: var(--v2-tabbar-bg);
    border-top: 1px solid var(--v2-tabbar-border);
    box-shadow: 0 -1px 8px rgba(27, 107, 42, 0.06);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

.agre-v2-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    position: relative;
    color: var(--v2-tab-inactive);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 0.35rem 0.25rem;
    transition: color 0.18s ease, transform 0.12s ease;
    cursor: pointer;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

.agre-v2-tabbar__item::before {
    content: '';
    position: absolute;
    inset: 2px 1px;
    border-radius: 14px;
    background: transparent;
    transition: background 0.18s ease, transform 0.12s ease;
    z-index: 0;
    pointer-events: none;
}

.agre-v2-tabbar__item > * {
    position: relative;
    z-index: 1;
}

.agre-v2-tabbar__item i {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.agre-v2-tabbar__item span {
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agre-v2-tabbar__item:hover,
.agre-v2-tabbar__item:focus {
    color: var(--v2-tab-active);
    background: transparent;
}

.agre-v2-tabbar__item.is-active {
    color: var(--v2-tab-active);
    background: transparent;
    font-weight: 700;
}

.agre-v2-tabbar__item.is-active::before {
    background: rgba(27, 107, 42, 0.11);
}

.agre-v2-tabbar__item.is-active i {
    color: var(--v2-tab-active);
}

.agre-v2-tabbar__item:active {
    transform: scale(0.96);
}

.agre-v2-tabbar__item.is-loading {
    color: var(--v2-tab-active);
    pointer-events: none;
}

.agre-v2-tabbar__item.is-loading i {
    color: var(--v2-tab-active);
}

.agre-v2-tabbar__spin {
    display: inline-block;
    animation: agre-v2-tab-spin 0.7s linear infinite;
}

@keyframes agre-v2-tab-spin {
    to { transform: rotate(360deg); }
}

.agre-v2-tabbar.is-navigating .agre-v2-tabbar__item:not(.is-active) {
    opacity: 0.5;
}

body.agre-v2-tab-navigating .main-content {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.agre-v2-tabbar__item[hidden] { display: none !important; }

/* Điện thoại - icon trên, chữ dưới (Galaxy Note 10+ ~412px cần ngưỡng >400px) */
@media (max-width: 575.98px) {
    .agre-v2-tabbar {
        min-height: 64px;
        padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom, 0px));
    }

    .agre-v2-tabbar__item {
        flex-direction: column;
        gap: 0.28rem;
        font-size: 0.72rem;
        padding: 0.3rem 0.1rem 0.2rem;
    }

    .agre-v2-tabbar__item i {
        font-size: 1.55rem;
    }

    .agre-v2-tabbar__item span {
        line-height: 1.15;
        overflow: visible;
        text-overflow: clip;
        max-width: 100%;
    }
}

/* JS bật khi chữ vẫn bị cắt ở màn hình rộng hơn (zoom chữ, v.v.) */
.agre-v2-tabbar.agre-v2-tabbar--stacked {
    min-height: 64px;
    padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom, 0px));
}

.agre-v2-tabbar.agre-v2-tabbar--stacked .agre-v2-tabbar__item {
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.72rem;
    padding: 0.3rem 0.1rem 0.2rem;
}

.agre-v2-tabbar.agre-v2-tabbar--stacked .agre-v2-tabbar__item i {
    font-size: 1.55rem;
}

.agre-v2-tabbar.agre-v2-tabbar--stacked .agre-v2-tabbar__item span {
    line-height: 1.15;
    overflow: visible;
    text-overflow: clip;
    max-width: 100%;
}

/* Kiểu tab bar - chọn trong Cài đặt */
html[data-tabbar-style="floating"],
html[data-tabbar-style="brand"] {
    --v2-tabbar-extra-pad: 12px;
}

html[data-tabbar-style="floating"],
.agre-v2-tabbar.agre-v2-tabbar--floating {
    --v2-tabbar-bg: rgba(255, 255, 255, 0.94);
    --v2-tabbar-border: rgba(27, 107, 42, 0.1);
}

html[data-tabbar-style="floating"] .agre-v2-tabbar,
.agre-v2-tabbar.agre-v2-tabbar--floating {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: auto;
    border-radius: 22px;
    border: 1px solid var(--v2-tabbar-border);
    box-shadow:
        0 10px 36px rgba(27, 107, 42, 0.16),
        0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 0.42rem 0.35rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

html[data-tabbar-style="floating"] .agre-v2-tabbar__item.is-active::before,
.agre-v2-tabbar.agre-v2-tabbar--floating .agre-v2-tabbar__item.is-active::before {
    background: rgba(27, 107, 42, 0.14);
    border-radius: 16px;
}

html[data-tabbar-style="brand"],
.agre-v2-tabbar.agre-v2-tabbar--brand {
    --v2-tab-inactive: rgba(255, 255, 255, 0.72);
    --v2-tab-active: #ffffff;
    --v2-tabbar-border: transparent;
}

html[data-tabbar-style="brand"] .agre-v2-tabbar,
.agre-v2-tabbar.agre-v2-tabbar--brand {
    background: linear-gradient(180deg, #228636 0%, #1B6B2A 55%, #165a24 100%);
    border-top: none;
    box-shadow: 0 -6px 28px rgba(27, 107, 42, 0.28);
}

html[data-tabbar-style="brand"] .agre-v2-tabbar__item.is-active::before,
.agre-v2-tabbar.agre-v2-tabbar--brand .agre-v2-tabbar__item.is-active::before {
    background: rgba(255, 255, 255, 0.2);
}

html[data-tabbar-style="minimal"] .agre-v2-tabbar,
.agre-v2-tabbar.agre-v2-tabbar--minimal {
    min-height: 52px;
    padding: 0.42rem 0.15rem calc(0.42rem + env(safe-area-inset-bottom, 0px));
}

html[data-tabbar-style="minimal"] .agre-v2-tabbar__item,
.agre-v2-tabbar.agre-v2-tabbar--minimal .agre-v2-tabbar__item {
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 0.15rem;
}

html[data-tabbar-style="minimal"] .agre-v2-tabbar__item span,
.agre-v2-tabbar.agre-v2-tabbar--minimal .agre-v2-tabbar__item span {
    display: none !important;
}

html[data-tabbar-style="minimal"] .agre-v2-tabbar__item i,
.agre-v2-tabbar.agre-v2-tabbar--minimal .agre-v2-tabbar__item i {
    font-size: 1.7rem;
}

html[data-tabbar-style="minimal"] .agre-v2-tabbar__item.is-active::before,
.agre-v2-tabbar.agre-v2-tabbar--minimal .agre-v2-tabbar__item.is-active::before {
    inset: 4px 6px;
    border-radius: 12px;
}

/* Toast hướng dẫn lọc bản đồ - trên tab bar */
.agre-v2-toast-host {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--v2-tabbar-inset, 68px) + 10px);
    z-index: 1450;
    width: min(92vw, 380px);
    pointer-events: none;
}

.agre-v2-map-hint-toast {
    pointer-events: auto;
    width: 100%;
    background: linear-gradient(135deg, #1B6B2A 0%, #2d8a3e 100%);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(27, 107, 42, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.agre-v2-map-hint-toast .toast-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

.agre-v2-map-hint-toast .toast-body > .bi-funnel-fill {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    opacity: 0.95;
}

.agre-v2-map-hint-toast__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.agre-v2-map-hint-toast__text strong {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.agre-v2-map-hint-toast__text span {
    opacity: 0.95;
}

/* Banner mất mạng / đường truyền chậm */
.agre-v2-network-banner {
    position: fixed;
    top: var(--v2-header-h, 52px);
    left: 0;
    right: 0;
    z-index: 1095;
    padding: 0.45rem 0.5rem 0;
    pointer-events: none;
}

.agre-v2-network-banner__inner {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    color: #fff;
    background: linear-gradient(135deg, #8b3a12 0%, #c45c1a 100%);
}

.agre-v2-network-banner.is-offline .agre-v2-network-banner__inner {
    background: linear-gradient(135deg, #7a1f24 0%, #b83238 100%);
}

.agre-v2-network-banner.is-slow .agre-v2-network-banner__inner {
    background: linear-gradient(135deg, #7a4d08 0%, #b8740f 100%);
}

.agre-v2-network-banner__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    opacity: 0.95;
}

.agre-v2-network-banner__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.agre-v2-network-banner__text strong {
    font-size: 0.9rem;
    font-weight: 700;
}

.agre-v2-network-banner__retry {
    flex-shrink: 0;
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.agre-v2-network-banner__retry:hover {
    background: rgba(255, 255, 255, 0.24);
}

.agre-v2-network-banner__retry:disabled {
    opacity: 0.7;
    cursor: wait;
}

body.agre-v2.agre-v2-network-warning .main-content > .container-fluid {
    scroll-margin-top: calc(var(--v2-header-h, 52px) + 3.5rem);
}

@media (max-width: 575.98px) {
    .agre-v2-network-banner {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .agre-v2-network-banner__inner {
        gap: 0.5rem;
        padding: 0.65rem 0.7rem;
    }

    .agre-v2-network-banner__retry {
        align-self: flex-start;
        margin-top: 0.1rem;
    }
}

/* ===== TRANG CHỦ - 2 CỘT ===== */
body.agre-v2.page-home .main-content > .container-fluid {
    padding-top: 0.75rem;
    padding-bottom: 0;
}

.agre-v2-home {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 992px) {
    .agre-v2-home {
        flex-direction: row;
        align-items: stretch;
        min-height: calc(100dvh - var(--v2-header-h) - var(--v2-tabbar-inset) - 2rem);
    }
    .agre-v2-home__slide,
    .agre-v2-home__sectors {
        flex: 1 1 50%;
        min-width: 0;
    }
    .agre-v2-home__sectors {
        max-height: calc(100dvh - var(--v2-header-h) - var(--v2-tabbar-inset) - 3rem);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-padding-bottom: var(--v2-tabbar-extra-pad);
    }
}

/* Carousel */
.agre-v2-carousel {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #153d1f;
    position: relative;
}

.agre-v2-carousel .carousel-inner {
    border-radius: var(--radius);
}

.agre-v2-carousel .carousel-item {
    position: relative;
    min-height: 280px;
}

/* Hiệu ứng chuyển slide ngẫu nhiên */
.agre-v2-carousel--fx {
    --agre-v2-carousel-fx: 2s;
}

.agre-v2-carousel--fx .carousel-inner {
    position: relative;
    overflow: hidden;
    min-height: 280px;
    aspect-ratio: 16 / 10;
}

.agre-v2-carousel--fx .carousel-item {
    display: block !important;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    pointer-events: none;
    transition: none;
    will-change: opacity, transform, filter;
}

.agre-v2-carousel--fx .carousel-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    pointer-events: auto;
}

.agre-v2-carousel--fx .carousel-item.active.is-entering {
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

.agre-v2-carousel--fx .carousel-item.is-leaving {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.agre-v2-carousel--fx .carousel-item.is-entering {
    z-index: 3;
    opacity: 0;
    visibility: visible;
    pointer-events: none;
}

.agre-v2-carousel--fx .carousel-item.active:not(.is-entering) .agre-v2-slide-img {
    animation: agreV2KenBurns 9s ease-out forwards;
}

@keyframes agreV2KenBurns {
    from { transform: scale(1); }
    to   { transform: scale(1.07); }
}

@keyframes agreV2FxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes agreV2FxFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes agreV2FxSlideInRight {
    from { opacity: 0; transform: translateX(18%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes agreV2FxSlideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-18%); }
}

@keyframes agreV2FxSlideInLeft {
    from { opacity: 0; transform: translateX(-18%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes agreV2FxSlideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(18%); }
}

@keyframes agreV2FxZoomIn {
    from { opacity: 0; transform: scale(1.12); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes agreV2FxZoomOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.92); }
}

@keyframes agreV2FxBlurIn {
    from { opacity: 0; filter: blur(10px); transform: scale(1.03); }
    to   { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes agreV2FxBlurOut {
    from { opacity: 1; filter: blur(0); transform: scale(1); }
    to   { opacity: 0; filter: blur(8px); transform: scale(0.97); }
}

@keyframes agreV2FxSlideInUp {
    from { opacity: 0; transform: translateY(12%); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes agreV2FxSlideOutUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10%); }
}

.agre-v2-carousel--fx[data-fx="fade"] .carousel-item.is-entering {
    animation: agreV2FxFadeIn var(--agre-v2-carousel-fx) cubic-bezier(0.4, 0, 0.2, 1) both;
}

.agre-v2-carousel--fx[data-fx="fade"] .carousel-item.is-leaving {
    animation: agreV2FxFadeOut var(--agre-v2-carousel-fx) cubic-bezier(0.4, 0, 0.2, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-left"] .carousel-item.is-entering {
    animation: agreV2FxSlideInRight var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-left"] .carousel-item.is-leaving {
    animation: agreV2FxSlideOutLeft var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-right"] .carousel-item.is-entering {
    animation: agreV2FxSlideInLeft var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-right"] .carousel-item.is-leaving {
    animation: agreV2FxSlideOutRight var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agre-v2-carousel--fx[data-fx="zoom"] .carousel-item.is-entering {
    animation: agreV2FxZoomIn var(--agre-v2-carousel-fx) cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.agre-v2-carousel--fx[data-fx="zoom"] .carousel-item.is-leaving {
    animation: agreV2FxZoomOut var(--agre-v2-carousel-fx) cubic-bezier(0.4, 0, 0.2, 1) both;
}

.agre-v2-carousel--fx[data-fx="blur"] .carousel-item.is-entering {
    animation: agreV2FxBlurIn var(--agre-v2-carousel-fx) cubic-bezier(0.4, 0, 0.2, 1) both;
}

.agre-v2-carousel--fx[data-fx="blur"] .carousel-item.is-leaving {
    animation: agreV2FxBlurOut var(--agre-v2-carousel-fx) cubic-bezier(0.4, 0, 0.2, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-up"] .carousel-item.is-entering {
    animation: agreV2FxSlideInUp var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agre-v2-carousel--fx[data-fx="slide-up"] .carousel-item.is-leaving {
    animation: agreV2FxSlideOutUp var(--agre-v2-carousel-fx) cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 992px) {
    .agre-v2-carousel,
    .agre-v2-carousel .carousel-item {
        min-height: 100%;
        height: 100%;
    }
    .agre-v2-carousel .carousel-inner,
    .agre-v2-carousel .carousel-item {
        height: 100%;
    }
    .agre-v2-carousel--fx .carousel-inner {
        aspect-ratio: auto;
        min-height: 100%;
    }
}

.agre-v2-slide-img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    display: block;
}

.agre-v2-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem 1.5rem 2.5rem;
    background: linear-gradient(to top, rgba(13,74,26,0.88) 0%, rgba(13,74,26,0.35) 55%, transparent 100%);
    color: #fff;
    pointer-events: none;
}

.agre-v2-slide-overlay.is-animate {
    animation: agreV2SlideIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes agreV2SlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.agre-v2-slide-icon {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    line-height: 1;
}

.agre-v2-slide-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.agre-v2-slide-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.35rem;
}

.agre-v2-slide-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    margin: 0;
    line-height: 1.45;
}

.agre-v2-carousel .carousel-indicators {
    margin-bottom: 0.5rem;
}

.agre-v2-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: none;
}

.agre-v2-carousel .carousel-indicators .active {
    background-color: #fff;
}

.agre-v2-carousel .carousel-control-prev,
.agre-v2-carousel .carousel-control-next {
    width: 12%;
    opacity: 0.7;
}

/* Danh sách nhóm ngành - dạng list */
.agre-v2-sectors {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
    padding-bottom: calc(0.75rem + var(--v2-tabbar-extra-pad));
}

.agre-v2-sectors__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 0 1rem 0.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.agre-v2-sector-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.agre-v2-sector-item {
    border-bottom: none;
}

.agre-v2-sector-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: background 0.15s, box-shadow 0.15s, filter 0.15s;
}

.agre-v2-sector-link:hover {
    background: var(--success-bg);
    color: var(--primary-dark);
}

.agre-v2-sector-link.is-static {
    cursor: default;
    opacity: 0.55;
}

.agre-v2-sector-link.is-static:hover { background: transparent; }

.agre-v2-sector-icon {
    font-size: 1.35rem;
    width: 2rem;
    height: 2rem;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* Màu từng nhóm - đổ full dòng, chữ trắng (8 tone group-card--tone-0…7) */
.agre-v2-sector-link[class*="group-card--tone-"] {
    background: var(--card-banner-bg);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.agre-v2-sector-link[class*="group-card--tone-"]:hover {
    background: var(--card-banner-bg);
    color: #fff;
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.agre-v2-sector-link[class*="group-card--tone-"] .agre-v2-sector-name {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.agre-v2-sector-link[class*="group-card--tone-"] .agre-v2-sector-icon {
    background: rgba(255, 255, 255, 0.2);
}

.agre-v2-sector-link[class*="group-card--tone-"] .agre-v2-sector-meta {
    color: rgba(255, 255, 255, 0.88);
}

.agre-v2-sector-link[class*="group-card--tone-"] .agre-v2-sector-chevron {
    color: rgba(255, 255, 255, 0.92);
}

.agre-v2-sector-link[class*="group-card--tone-"].is-static:hover {
    background: var(--card-banner-bg);
    filter: none;
}

.agre-v2-sector-body {
    flex: 1;
    min-width: 0;
}

.agre-v2-sector-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
}

.agre-v2-sector-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.agre-v2-sector-chevron {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.agre-v2-sectors .empty-updating-section {
    margin: 0.5rem 1rem 1rem;
}

.agre-v2-sectors .empty-toggle {
    width: 100%;
    text-align: left;
}

.agre-v2-sectors .empty-grid .agre-v2-sector-list {
    padding-top: 0.25rem;
}

/* ===== MAP FULLSCREEN V2 ===== */
body.agre-v2.page-v2-map {
    overflow: hidden;
    --v2-tabbar-extra-pad: 0px;
}

body.agre-v2.page-v2-map .breadcrumb-bar { display: none !important; }

body.agre-v2.page-v2-map .main-content > .container-fluid {
    padding: 0 !important;
    max-width: 100%;
}

body.agre-v2.page-v2-map .site-header-v2 {
    display: none !important;
}

body.agre-v2.page-v2-map #wrapAgreMapShell {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1200;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
}

body.agre-v2.page-v2-map #wrapAgreMapShell #agreMap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    box-sizing: border-box;
}

body.agre-v2.page-v2-map.page-bandothongke-map-fs .agre-map-shell {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: var(--v2-tabbar-h, 56px) !important;
    inset: auto !important;
    z-index: 1200;
    border-radius: 0;
    border: none;
    margin: 0 !important;
    overflow: hidden;
}

body.agre-v2.page-v2-map.page-bandothongke-map-fs #agreMap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0;
    box-sizing: border-box;
}

body.agre-v2.page-v2-map #agreMap .leaflet-bottom {
    bottom: 8px !important;
}

body.agre-v2.page-v2-map #agreMap .leaflet-control-scale {
    margin-bottom: 4px !important;
}

body.agre-v2.page-v2-map.page-bandothongke-map-fs .agre-map-decor.agre-source {
    bottom: 8px;
}

body.agre-v2.page-v2-map.page-bandothongke-map-fs .agre-north-wrap {
    bottom: 36px;
}

body.agre-v2.page-v2-map.page-bandothongke-map-fs .site-header-v2 {
    display: none !important;
}

/* Phóng to bản đồ V2 - ẩn tab bar, map full viewport */
body.agre-v2.page-v2-map.page-v2-map-immersive {
    overflow: hidden;
}

body.agre-v2.page-v2-map.page-v2-map-immersive .agre-v2-tabbar,
body.agre-v2.page-v2-map.page-v2-map-immersive .agre-v2-tabbar-spacer,
body.page-v2-map.page-v2-map-immersive .agre-v2-tabbar,
body.page-v2-map.page-v2-map-immersive .agre-v2-tabbar-spacer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.agre-v2.page-v2-map.page-v2-map-immersive .site-header-v2 {
    display: none !important;
}

body.agre-v2.page-v2-map.page-v2-map-immersive #wrapAgreMapShell,
body.page-v2-map.page-v2-map-immersive #wrapAgreMapShell {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    z-index: 1400 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
}

body.agre-v2.page-v2-map.page-v2-map-immersive .main-content,
body.agre-v2.page-v2-map.page-v2-map-immersive .main-content > .container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.agre-v2.page-v2-map.page-v2-map-immersive #agreMap {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body.agre-v2.page-v2-map .agre-map-fabs {
    top: auto;
    left: 12px;
    bottom: 16px;
    transform: none;
    z-index: 1250;
}

body.agre-v2.page-v2-map .agre-map-top-tools--left .agre-map-fs-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #1B6B2A;
    font-size: 1.2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

body.agre-v2.page-v2-map .agre-map-top-tools--left .agre-map-fs-btn:hover {
    background: #f0f7f1;
    transform: scale(1.05);
}

body.agre-v2.page-v2-map .agre-map-top-tools--left .agre-map-fs-btn:active {
    transform: scale(0.98);
}

body.agre-v2.page-v2-map #agreMap .leaflet-top.leaflet-left {
    top: 52px;
}

/* Các trang khác - main content bình thường */
body.agre-v2:not(.page-home):not(.page-v2-map) .main-content > .container-fluid {
    padding-bottom: 0;
}

@media (max-width: 991.98px) {
    .agre-v2-home__sectors {
        max-height: none;
        overflow-y: visible;
    }

    .agre-v2-home__slide {
        min-height: 0;
    }

    .agre-v2-carousel .carousel-inner {
        position: relative;
        aspect-ratio: 16 / 10;
        min-height: 220px;
        height: auto;
    }

    .agre-v2-carousel .carousel-item {
        min-height: 100%;
        height: 100%;
    }

    .agre-v2-carousel--fx .carousel-item {
        position: absolute;
        inset: 0;
        min-height: 0;
    }

    .agre-v2-slide-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }
}

@media (min-width: 992px) {
    .agre-v2-home__sectors {
        padding-bottom: 0.25rem;
    }
}

/* ===== TRANG CÀI ĐẶT (nội dung footer cũ) ===== */
.agre-v2-settings {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 640px;
    margin: 0 auto;
}

.agre-v2-settings__card {
    background: var(--bg-card, #fff);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(27,107,42,0.1));
    padding: 1rem 1.1rem;
}

.agre-v2-settings__brand {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.agre-v2-settings__brand > i {
    font-size: 1.75rem;
    color: var(--primary, #1B6B2A);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.agre-v2-settings__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark, #0D4A1A);
    margin: 0 0 0.35rem;
}

.agre-v2-settings__desc {
    font-size: 0.85rem;
    color: var(--text-muted, #5A6B5A);
    line-height: 1.5;
}

.agre-v2-settings__section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-dark, #0D4A1A);
    margin: 0 0 0.65rem;
}

.agre-v2-settings__ios-guide {
    background: linear-gradient(135deg, rgba(27, 107, 42, 0.08) 0%, rgba(46, 125, 50, 0.12) 100%);
    border: 1px solid rgba(27, 107, 42, 0.2);
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
}

.agre-v2-settings__ios-head {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark, #0D4A1A);
    margin: 0;
}

.agre-v2-settings__ios-steps {
    padding-left: 1.15rem;
    color: var(--text, #2C3E2C);
    line-height: 1.5;
}

.agre-v2-settings__ios-steps li + li {
    margin-top: 0.35rem;
}

.agre-v2-settings__ios-note {
    line-height: 1.45;
}

.agre-v2-settings__android-hint {
    background: rgba(27, 107, 42, 0.05);
    border: 1px solid rgba(27, 107, 42, 0.15);
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
}

.agre-v2-settings__pwa-done {
    background: rgba(27, 107, 42, 0.06);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.86rem;
    color: var(--text-muted, #5A6B5A);
}

.agre-v2-settings__card--admin {
    border-color: rgba(27, 107, 42, 0.22);
}

.agre-v2-settings__admin-user {
    line-height: 1.4;
}

.agre-v2-settings__admin-group {
    margin-top: 0.85rem;
}

.agre-v2-settings__admin-group--tail {
    margin-top: 1rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border, #D4E0D4);
}

.agre-v2-settings__admin-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #5A6B5A);
    margin: 0 0 0.35rem;
}

.agre-v2-settings__links li {
    border-bottom: 1px solid var(--border, #D4E0D4);
}

.agre-v2-settings__links li:last-child {
    border-bottom: none;
}

.agre-v2-settings__links a {
    display: flex;
    align-items: center;
    padding: 0.65rem 0;
    color: var(--text-main, #1A2E1A);
    text-decoration: none;
    font-size: 0.88rem;
}

.agre-v2-settings__links a:hover {
    color: var(--primary, #1B6B2A);
}

.agre-v2-settings__copy {
    padding: 0.5rem 0 0.25rem;
}

/* Cỡ chữ - trang Cài đặt */
.agre-v2-settings__font-scale {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.agre-v2-settings__font-btn {
    flex: 1 1 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 4rem;
    padding: 0.65rem 1rem !important;
    font-weight: 700 !important;
    color: var(--primary-dark, #0D4A1A) !important;
    background: var(--success-bg, #E8F5E9) !important;
    border: 1px solid var(--border, #D4E0D4) !important;
    border-radius: var(--radius-sm, 8px) !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.agre-v2-settings__font-btn:hover:not(:disabled) {
    background: #fff !important;
    border-color: var(--primary, #1B6B2A) !important;
    color: var(--primary, #1B6B2A) !important;
}

.agre-v2-settings__font-btn--default {
    background: #fff !important;
    border-style: dashed !important;
}

.agre-v2-settings__font-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.agre-v2-settings__font-label {
    font-size: 1.25rem;
    line-height: 1;
}

.agre-v2-settings__font-hint {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
}

/* Thanh tab - trang Cài đặt */
.agre-v2-settings__tabbar-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.agre-v2-settings__tabbar-opt {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.55rem 0.55rem 0.6rem;
    border: 2px solid var(--border, #D4E0D4);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    margin: 0;
}

.agre-v2-settings__tabbar-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.agre-v2-settings__tabbar-opt:hover {
    border-color: rgba(27, 107, 42, 0.45);
    background: rgba(27, 107, 42, 0.03);
}

.agre-v2-settings__tabbar-opt:has(.agre-v2-settings__tabbar-radio:checked),
.agre-v2-settings__tabbar-opt.is-selected {
    border-color: var(--primary, #1B6B2A) !important;
    background: rgba(27, 107, 42, 0.08) !important;
    box-shadow: 0 0 0 1px rgba(27, 107, 42, 0.18) !important;
}

.agre-v2-settings__tabbar-opt:has(.agre-v2-settings__tabbar-radio:checked):hover,
.agre-v2-settings__tabbar-opt.is-selected:hover {
    border-color: var(--primary, #1B6B2A) !important;
    background: rgba(27, 107, 42, 0.1) !important;
}

.agre-v2-settings__tabbar-opt-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-dark, #0D4A1A);
}

.agre-v2-settings__tabbar-preview {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.35rem 0.25rem 0.15rem;
    border-radius: 8px;
    background: #f4f7f4;
}

.agre-v2-settings__tabbar-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.15rem;
    width: 100%;
    max-width: 7.5rem;
    padding: 0.28rem 0.35rem;
    border-radius: 10px;
    font-size: 0.72rem;
    line-height: 1;
}

.agre-v2-settings__tabbar-preview-bar i {
    opacity: 0.45;
}

.agre-v2-settings__tabbar-preview-bar i:first-child {
    opacity: 1;
    color: #1B6B2A;
}

.agre-v2-settings__tabbar-preview--default .agre-v2-settings__tabbar-preview-bar {
    background: #fff;
    border: 1px solid #D4E0D4;
    box-shadow: 0 -1px 4px rgba(27, 107, 42, 0.06);
}

.agre-v2-settings__tabbar-preview--floating .agre-v2-settings__tabbar-preview-bar {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(27, 107, 42, 0.12);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(27, 107, 42, 0.14);
}

.agre-v2-settings__tabbar-preview--brand .agre-v2-settings__tabbar-preview-bar {
    background: linear-gradient(180deg, #228636, #1B6B2A);
    border: none;
    box-shadow: 0 2px 10px rgba(27, 107, 42, 0.25);
}

.agre-v2-settings__tabbar-preview--brand .agre-v2-settings__tabbar-preview-bar i {
    color: rgba(255, 255, 255, 0.65);
}

.agre-v2-settings__tabbar-preview--brand .agre-v2-settings__tabbar-preview-bar i:first-child {
    color: #fff;
}

.agre-v2-settings__tabbar-preview--minimal .agre-v2-settings__tabbar-preview-bar {
    background: #fff;
    border: 1px solid #D4E0D4;
}

.agre-v2-settings__tabbar-preview--minimal .agre-v2-settings__tabbar-preview-bar i {
    font-size: 0.95rem;
}

@media (min-width: 480px) {
    .agre-v2-settings__tabbar-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ===== TRANG TÌM KIẾM - ô nhập + nút trên mobile ===== */
body.agre-v2 .search-box {
    padding: 1rem;
}

body.agre-v2 .search-input-wrapper input[type="submit"].search-btn {
    display: inline-block;
    line-height: 1.25;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}
