.agre-map-shell {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: visible;
    background: #1a2e1a;
}
#agreMap {
    height: calc(100dvh - 112px);
    min-height: 480px;
    width: 100%;
    z-index: 1;
    background: #1a2e1a;
    border-radius: inherit;
    overflow: hidden;
}
#agreMap.agre-basemap-osm {
    background: #b8d4e8;
}
body.page-bandothongke .main-content > .container-fluid {
    padding-bottom: 0.5rem;
}
/* Nút nổi trái - giống app tham khảo */
.agre-map-fabs {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.agre-map-fab {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 28, 20, 0.72);
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.agre-map-fab:hover { background: rgba(27, 107, 42, 0.92); transform: scale(1.05); }
.agre-map-fab.active { background: var(--primary, #1B6B2A); }
.agre-map-fab.is-busy { opacity: 0.55; pointer-events: none; cursor: wait; }
a.agre-map-fab { text-decoration: none; color: #fff; }
a.agre-map-fab:hover { color: #fff; }
/* Satellite Hybrid - chỉ tên quốc gia (không thủ đô) */
.agre-hybrid-label {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.agre-hybrid-label span {
    display: inline-block;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(255,255,255,.95), 0 0 8px rgba(255,255,255,.75), 0 1px 3px rgba(0,0,0,.9);
    letter-spacing: 0.02em;
}
.agre-hybrid-label--country span {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    text-transform: uppercase;
}
.agre-hybrid-label--capital span {
    font-size: 11px;
    font-weight: 600;
    color: #fde68a;
}
/* Nhãn tên nước ngoài (cấp quốc gia) - mọi chế độ nền */
.agre-map-country-label {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.agre-map-country-label span {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
    pointer-events: none;
    letter-spacing: 0.02em;
}
#agreMap.agre-basemap-osm .agre-map-country-label span {
    color: #1a2a1a;
    text-shadow: 0 0 4px #fff, 0 0 8px #fff;
}
#agreMap.agre-basemap-satellite .agre-map-country-label span {
    color: #f8fafc;
    text-transform: uppercase;
    text-shadow: 0 0 4px rgba(255,255,255,.95), 0 0 8px rgba(255,255,255,.75), 0 1px 3px rgba(0,0,0,.9);
}
/* Nhãn tỉnh VN - trên lớp dữ liệu */
.agre-prov-label {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.agre-prov-label span,
.agre-prov-label--xa span {
    display: inline-block;
    white-space: nowrap;
    font-weight: 700;
    color: #0a2e12;
    text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 0 12px #fff,
        1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
        0 2px 4px rgba(0,0,0,.45);
    pointer-events: none;
}
.agre-prov-label--xa-focus span {
    font-weight: 700 !important;
    color: #0a2e12;
}
.agre-prov-label--xa-muted span {
    font-weight: 400 !important;
    color: #4a6350;
    opacity: 0.92;
    text-shadow: 0 0 3px #fff, 0 0 6px #fff,
        1px 1px 0 #fff, -1px -1px 0 #fff,
        0 1px 2px rgba(0,0,0,.25);
}
.agre-prov-label--tinh-link,
.agre-prov-label--tinh-link span {
    pointer-events: auto !important;
    cursor: pointer;
}
.agre-prov-label--tinh-link.agre-prov-label--xa-muted span:hover {
    color: #1B6B2A;
}
#agreMap .leaflet-control-scale {
    margin-left: 10px !important;
    margin-bottom: 6px !important;
}
#agreMap .leaflet-control-scale-line {
    border: 2px solid #111 !important;
    border-top: none !important;
    color: #111 !important;
    font-size: 0.62rem !important;
    font-weight: 600;
    background: rgba(255,255,255,.55) !important;
    padding: 1px 4px 0 !important;
}
/* Góc phải trên bản đồ: phóng to + bảng thông tin */
.agre-map-top-tools {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 560; /* trên wrapMapInfo (520) để btnMapFullscreen luôn bấm được */
    display: flex;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}
.agre-map-top-tools > * {
    pointer-events: auto;
}
.agre-map-top-tools--left {
    left: 12px;
    right: auto;
}
.agre-map-top-tools .agre-map-fs-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(18, 24, 18, 0.88);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    transition: background .15s, transform .15s;
}
.agre-map-top-tools .agre-map-fs-btn:hover {
    background: rgba(27, 107, 42, 0.92);
    transform: scale(1.04);
}
/* Panel thông tin - kéo/resize, lưu vị trí */
.agre-map-info-wrap {
    position: absolute;
    top: 12px;
    right: 54px;
    z-index: 520;
    display: flex;
    align-items: flex-start;
    gap: 0;
    pointer-events: auto;
    box-sizing: border-box;
    min-width: 220px;
    width: min(340px, calc(100% - 24px));
    max-width: min(520px, calc(100% - 24px));
    height: auto;
    max-height: none;
}
.agre-map-info-wrap.is-positioned {
    right: auto;
    bottom: auto;
    height: auto !important;
}
.agre-map-info-wrap.is-collapsed {
    min-width: 0;
    width: auto !important;
    height: auto !important;
    max-width: none;
    /* Dock cạnh nút fullscreen - không dùng left đã kéo khi đang thu gọn */
    left: auto !important;
    right: 54px !important;
    top: 12px !important;
    z-index: 565; /* trên btnMapFullscreen để luôn bấm được */
}
.agre-map-info-wrap.is-collapsed .agre-map-info,
.agre-map-info-wrap.is-collapsed .agre-map-info-resize {
    display: none;
}
.agre-map-info-toggle {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    align-self: flex-start;
    border: none;
    border-radius: 8px 0 0 8px;
    background: rgba(18, 24, 18, 0.88);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    cursor: pointer;
    transition: background .15s, border-radius .2s;
}
.agre-map-info-toggle:hover { background: rgba(27, 107, 42, 0.92); }
.agre-map-info-wrap.is-collapsed .agre-map-info-toggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}
.agre-map-info {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    overflow: visible;
    background: rgba(18, 24, 18, 0.82);
    color: #f5f5f5;
    border-radius: 0 10px 10px 0;
    padding: 0 14px 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    box-sizing: border-box;
}
.agre-map-info-drag {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 -14px 8px;
    padding: 7px 14px 6px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.agre-map-info-drag-grip {
    opacity: .45;
    font-size: 0.78rem;
    letter-spacing: -1px;
    line-height: 1;
}
.agre-map-info-drag-hint {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #a8c4ac;
    opacity: .9;
}
.agre-map-info-resize {
    position: absolute;
    top: 34px;
    right: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    touch-action: none;
    z-index: 2;
    background: transparent;
}
.agre-map-info-resize::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 2px;
    width: 3px;
    height: 28px;
    margin-top: -14px;
    border-radius: 2px;
    background: rgba(200, 239, 204, .45);
}
.agre-map-info-wrap.is-dragging,
.agre-map-info-wrap.is-resizing {
    user-select: none;
}
.agre-map-info-wrap.is-dragging .agre-map-info,
.agre-map-info-wrap.is-resizing .agre-map-info {
    pointer-events: none;
}
.agre-map-info h6 {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
    line-height: 1.35;
    padding-right: 8px;
}
.agre-map-info-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
}
.agre-map-info-nav[hidden] { display: none !important; }
.agre-map-back-overview {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 4px 10px 4px 8px;
    border: 1px solid rgba(168, 212, 174, 0.45);
    border-radius: 999px;
    background: rgba(124, 179, 66, 0.16);
    color: #c8efcc;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.agre-map-back-overview:hover,
.agre-map-back-overview:focus-visible {
    background: rgba(124, 179, 66, 0.28);
    border-color: rgba(200, 239, 204, 0.65);
    color: #e8ffe9;
    outline: none;
}
.agre-map-back-overview[hidden] { display: none !important; }
/* Nút về danh sách lớp - nổi hơn nút back địa lý (tránh nhầm FAB góc trên) */
.agre-map-back-overview--layers {
    padding: 5px 12px 5px 10px;
    border-color: rgba(174, 234, 152, 0.75);
    background: linear-gradient(180deg, rgba(124, 179, 66, 0.42), rgba(85, 139, 47, 0.38));
    color: #f3fff1;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 1px rgba(200, 239, 204, 0.22), 0 2px 8px rgba(46, 125, 50, 0.28);
}
.agre-map-back-overview--layers .agre-map-back-overview__arrow {
    font-size: 0.95em;
    display: inline-block;
    will-change: opacity, color;
}
.agre-map-back-overview--layers:hover,
.agre-map-back-overview--layers:focus-visible {
    background: linear-gradient(180deg, rgba(139, 195, 74, 0.55), rgba(104, 159, 56, 0.48));
    border-color: #e8ffe9;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(232, 255, 233, 0.35), 0 3px 12px rgba(46, 125, 50, 0.4);
}
/* Mũi tên nhấp nháy 1 lần/giây - luôn bật (cố ý gây chú ý, không tắt theo reduce-motion) */
#btnBackGroupOverview.agre-map-back-overview--layers .agre-map-back-overview__arrow,
#btnBackGroupOverview.agre-map-back-overview--layers .agre-map-back-overview__arrow::before {
    animation: agreLayersArrowBlink 1s steps(1, end) infinite !important;
}
@keyframes agreLayersArrowBlink {
    0%, 49% {
        opacity: 1;
        color: #fff59d;
    }
    50%, 100% {
        opacity: 0.05;
        color: #f3fff1;
    }
}
.agre-map-info .meta { opacity: .85; font-size: 0.78rem; margin-bottom: 8px; }
.agre-map-info .meta:empty { display: none; margin: 0; }
.agre-map-info .meta strong { color: #fff; font-weight: 600; }
.agre-map-info .ov-line {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    margin-bottom: 5px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.agre-map-info .ov-line:last-child { border-bottom: 0; }
.agre-map-info .ov-pick-hint {
    font-size: 0.72rem;
    color: #a8d4ae;
    margin: 0 0 8px;
    line-height: 1.35;
    padding: 5px 7px;
    border-radius: 4px;
    background: rgba(124, 179, 66, 0.14);
    border: 1px solid rgba(124, 179, 66, 0.22);
}
.agre-map-info .ov-line.ov-line--pick {
    cursor: pointer;
    border-radius: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding: 4px 4px 5px;
    transition: background .15s ease, box-shadow .15s ease;
}
.agre-map-info .ov-line.ov-line--pick:hover,
.agre-map-info .ov-line.ov-line--pick:focus-visible {
    background: rgba(124, 179, 66, 0.2);
    box-shadow: inset 0 0 0 1px rgba(168, 212, 174, 0.35);
    outline: none;
}
.agre-map-info .ov-line.ov-line--pick .ov-label {
    color: #c8efcc;
}
.agre-map-info .ov-line.ov-line--pick:hover .ov-label,
.agre-map-info .ov-line.ov-line--pick:focus-visible .ov-label {
    color: #e8ffe9;
}
.agre-map-info .ov-line.ov-line--pick .ov-pick-icon {
    font-size: 0.68rem;
    opacity: 0.75;
    vertical-align: baseline;
}
.agre-map-info .ov-line.ov-line--pick:hover .ov-pick-icon,
.agre-map-info .ov-line.ov-line--pick:focus-visible .ov-pick-icon {
    opacity: 1;
}
.agre-map-info .ov-label { flex: 1; opacity: .92; color: #e8ece8; }
.agre-map-info .ov-val {
    font-weight: 700; white-space: nowrap; color: #f8faf8;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.agre-map-info .ov-val .ov-unit { font-weight: 600; color: #b8d4bc; font-size: 0.92em; }
.agre-map-info .ov-no-data {
    color: #ffb74d;
    font-weight: 600;
    font-style: italic;
}
.agre-map-info .ov-val .ov-no-data { color: #ffb74d; }
.agre-map-info .ov-note { font-size: 0.72rem; color: #a8b8a8; font-weight: 400; }
#wrapLocLop .agre-loc-year-col .form-select,
#wrapDonViLoc .agre-loc-year-col .form-select { min-width: 5.75rem; }
.agre-loc-year-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.agre-loc-year-inline > .form-label {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-bottom: 0;
}
.agre-loc-year-inline > .form-select,
.agre-loc-year-inline > .ts-wrapper {
    flex: 0 0 auto;
    min-width: 5.75rem;
    width: auto;
}
.agre-map-info .stat-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.agre-map-info .swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 2px;
}
.agre-map-info .bar {
    height: 8px;
    border-radius: 4px;
    margin-top: 8px;
}
.agre-map-info .loading { opacity: .7; font-style: italic; }
.agre-map-info .chu-thich {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: 0.76rem;
    line-height: 1.45;
    opacity: .92;
}
.agre-map-info .chu-thich p { margin: 0 0 6px; }
/* Panel nổi trên bản đồ - xuất PNG + hiển thị giống BanDoMau */
.agre-float {
    position: absolute;
    z-index: 750;
    background: rgba(255,255,255,.93);
    border: 1px solid #999;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    pointer-events: auto;
    max-width: min(380px, calc(100% - 24px));
}
.agre-float-handle {
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    padding: 5px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #111;
    background: rgba(240,240,240,.95);
    border-bottom: 1px solid #bbb;
    line-height: 1.3;
}
.agre-float-handle::before {
    content: '⋮⋮ ';
    opacity: .45;
    font-weight: 400;
}
.agre-float-body {
    padding: 8px 10px;
    font-size: 0.72rem;
    line-height: 1.35;
    max-height: min(320px, 45vh);
    overflow-y: auto;
    color: #111;
}
.agre-float-legend {
    left: 64px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    max-width: min(320px, calc(100% - 24px));
}
.agre-float-legend.is-dragged { transform: none; }
.agre-float-legend.is-panel-hidden { display: none !important; }
.agre-float-legend .agre-float-handle {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}
.agre-float-legend .agre-float-body {
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
}
.agre-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    width: max-content;
    max-width: 100%;
}
.agre-legend-row > span:last-child {
    white-space: nowrap;
}
.agre-legend-swatch {
    width: 22px;
    height: 14px;
    border: 1px solid #888;
    flex-shrink: 0;
}
.agre-map-decor {
    position: absolute;
    z-index: 720;
    pointer-events: none;
}
.agre-north-wrap {
    left: 12px;
    bottom: 36px;
    text-align: center;
    color: #111;
}
.agre-north-wrap .n-letter {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1px;
}
.agre-north-wrap .n-arrow {
    display: block;
    width: 0;
    height: 0;
    margin: 0 auto;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 18px solid #111;
}
.agre-north-wrap .n-stem {
    display: block;
    width: 2px;
    height: 6px;
    background: #111;
    margin: 0 auto;
}
.agre-source {
    right: 8px;
    bottom: 4px;
    font-size: 0.58rem;
    color: #333;
    text-align: right;
    line-height: 1.35;
    max-width: 55%;
}
.agre-source .src-main { font-style: italic; }
.agre-source .src-attr { opacity: .88; font-size: 0.52rem; }
.leaflet-control-attribution {
    display: none !important;
}
/* Điểm cháy Firepoints */
/* Marker điểm - chỉ emoji/SVG, không vòng tròn nền */
.agre-point-marker-wrap,
.agre-fire-marker-wrap,
.leaflet-div-icon.agre-point-marker-wrap,
.leaflet-div-icon.agre-fire-marker-wrap,
.leaflet-marker-icon.agre-point-marker-wrap,
.leaflet-marker-icon.agre-fire-marker-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.agre-point-marker,
.agre-fire-marker {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    cursor: pointer;
    box-sizing: border-box;
    user-select: none;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.15s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.agre-point-marker__glyph,
.agre-fire-marker .agre-point-marker__glyph {
    display: block;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.agre-point-marker__pin {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.agre-point-marker:hover,
.agre-fire-marker:hover {
    transform: scale(1.12);
}
.leaflet-popup.agre-fire-popup .leaflet-popup-content {
    margin: 10px 12px;
    min-width: 210px;
    max-width: 320px;
    max-height: min(420px, calc(100vh - 160px));
    overflow-y: auto;
    overflow-x: hidden;
}
.leaflet-popup.agre-fire-popup {
    transition: none !important;
}
/* Popup điểm cháy - overlay ngoài #agreMap để không bị overflow:hidden cắt */
.agre-fire-popup-host {
    position: absolute;
    inset: 0;
    z-index: 760;
    pointer-events: none;
    overflow: visible;
}
.agre-fire-popup-host.is-hidden {
    display: none;
}
.agre-fire-popup-card {
    position: absolute;
    pointer-events: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
    max-width: 320px;
    min-width: 210px;
    box-sizing: border-box;
}
.agre-fire-popup-card.is-resizing {
    user-select: none;
}
.agre-fire-popup-card.is-free {
    transform: none;
}
.agre-fire-popup-card.is-free::after {
    display: none;
}
.agre-fire-popup-card.is-dragging {
    user-select: none;
    cursor: grabbing;
    opacity: 0.96;
}
.agre-fire-popup-card .agre-fire-popup__title {
    cursor: grab;
    touch-action: none;
}
.agre-fire-popup-card.is-dragging .agre-fire-popup__title {
    cursor: grabbing;
}
.agre-fire-popup-card.is-above {
    transform: translate(-50%, calc(-100% - 12px));
}
.agre-fire-popup-card.is-below {
    transform: translate(-50%, 12px);
}
.agre-fire-popup-card__body {
    padding: 10px 28px 12px 12px;
    max-height: min(420px, calc(100vh - 140px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.agre-fire-popup-card__resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 2;
    touch-action: none;
    background:
        linear-gradient(135deg, transparent 0 55%, #9aa89a 55% 62%, transparent 62% 70%, #9aa89a 70% 77%, transparent 77% 85%, #9aa89a 85% 92%, transparent 92%);
    border-radius: 0 0 10px 0;
    opacity: 0.85;
}
.agre-fire-popup-card__resize:hover {
    opacity: 1;
}
.agre-fire-popup-card__close {
    position: absolute;
    top: 4px;
    right: 6px;
    z-index: 1;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
}
.agre-fire-popup-card__close:hover { color: #111; }
.agre-fire-popup-card.is-above::after,
.agre-fire-popup-card.is-below::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
}
.agre-fire-popup-card.is-above::after {
    bottom: -15px;
    border-top-color: #fff;
}
.agre-fire-popup-card.is-below::after {
    top: -15px;
    border-bottom-color: #fff;
}
.agre-fire-popup__title {
    font-weight: 700;
    color: #B71C1C;
    margin-bottom: 8px;
    font-size: 0.92rem;
}
.agre-fire-popup__table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}
.agre-fire-popup__table th {
    text-align: left;
    font-weight: 600;
    color: #555;
    padding: 2px 8px 2px 0;
    vertical-align: top;
    white-space: nowrap;
}
.agre-fire-popup__table td {
    padding: 2px 0;
    color: #222;
}
.agre-rain-popup .agre-fire-popup__table {
    table-layout: fixed;
}
.agre-rain-popup .agre-fire-popup__table th {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    width: 42%;
}
.agre-rain-popup .agre-fire-popup__table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.agre-rain-popup__chart {
    max-width: 100%;
}
.agre-fire-popup__desc {
    margin-top: 8px;
    line-height: 1.45;
    font-size: 0.8rem;
    color: #333;
    white-space: normal;
    word-break: break-word;
}
.agre-fire-popup__desc p { margin: 0 0 0.5em; }
.agre-fire-popup__desc p:last-child { margin-bottom: 0; }
.agre-rain-chart-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}
.agre-rain-chart-svg {
    display: block;
    max-width: 100%;
    height: auto;
}
.agre-rain-chart-tip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    min-width: 88px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(13, 71, 161, 0.94);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.25;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    white-space: nowrap;
}
.agre-rain-chart-tip strong {
    display: block;
    font-weight: 700;
    margin-bottom: 1px;
}
.agre-rain-chart-tip span {
    opacity: 0.95;
}
.leaflet-tooltip.agre-map-tip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}
.leaflet-tooltip.agre-map-tip--focused {
    font-size: 0.74rem;
    padding: 5px 10px;
}
/* Modal lọc */
#modalLocBanDo .modal-header {
    background: var(--primary-dark, #0D4A1A);
    color: #fff;
    border: 0;
}
#modalLocBanDo .modal-header .btn-close { filter: invert(1); }
#modalLocBanDo .loc-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.agre-loc-lop-head {
    --bs-gutter-x: 0.5rem;
}
.agre-loc-lop-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0 12px 0 10px;
    border: 1px solid rgba(13, 74, 26, 0.22);
    border-radius: 999px;
    background: rgba(13, 74, 26, 0.06);
    color: var(--primary-dark, #0D4A1A);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.agre-loc-lop-toggle:hover,
.agre-loc-lop-toggle:focus-visible {
    background: rgba(13, 74, 26, 0.12);
    border-color: rgba(13, 74, 26, 0.4);
    outline: none;
}
.agre-loc-lop-toggle[aria-expanded="true"] {
    background: rgba(13, 74, 26, 0.14);
    border-color: rgba(13, 74, 26, 0.45);
}
.agre-loc-lop-toggle .bi {
    font-size: 1rem;
}
.agre-loc-lop-body[hidden] {
    display: none !important;
}
.agre-loc-lop-body:not([hidden]) {
    margin-top: 10px;
}
#modalLocBanDo .form-select,
#modalLocBanDo .form-control { font-size: 0.9rem; }
#modalLocBanDo #wrapLocLop .agre-loc-year-col .form-select,
#modalLocBanDo #wrapDonViLoc .form-select {
    padding-right: 2.75rem;
    background-position: right 0.65rem center;
    background-size: 14px 11px;
}
#modalLocBanDo #ddlXa.form-select {
    padding-right: 3.25rem;
    background-position: right 0.75rem center;
}
#modalLocBanDo select.form-select option.agre-nhom-parent,
#modalLocBanDo select.form-select option:disabled {
    color: #94a3b8;
    font-weight: 400;
}
#modalLocBanDo select.form-select option.agre-nhom-leaf {
    color: #1a2e1a;
    font-weight: 600;
}
.agre-loc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.agre-loc-pill {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
}
.agre-loc-pill.active {
    background: var(--primary-dark, #0D4A1A);
    color: #fff;
    border-color: var(--primary-dark, #0D4A1A);
}
.agre-loc-actions { display: flex; gap: 10px; margin-top: 8px; }
.agre-loc-actions .btn { flex: 1; font-weight: 600; }
.agre-loc-preview {
    background: #f4faf4;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.45;
}
.agre-loc-preview .loc-preview-title { font-weight: 700; color: var(--primary-dark, #0D4A1A); margin-bottom: 4px; }
.agre-loc-preview .loc-preview-hint { color: var(--text-muted, #64748b); font-size: 0.82rem; margin-top: 6px; margin-bottom: 0; }
.btn-loc-apply {
    background: #8BC34A;
    border-color: #7CB342;
    color: #1a2e1a;
}
.btn-loc-apply:hover { background: #9CCC65; color: #0d4a1a; }
/* Modal chi tiết đơn vị - hẹp 1/2, kéo bằng header */
#modalChiTiet .modal-dialog.agre-modal-chitiet {
    max-width: 250px;
    width: calc(100% - 1rem);
    margin: 1.75rem auto;
}
#modalChiTiet .modal-dialog.agre-modal-chitiet.is-dragged {
    margin: 0 !important;
}
#modalChiTiet .modal-dialog.agre-modal-chitiet.is-positioning {
    opacity: 0 !important;
    transition: none !important;
    transform: none !important;
}
#modalChiTiet .modal-header {
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    padding: 0.65rem 0.85rem;
}
#modalChiTiet .modal-header .btn-close { cursor: pointer; }
#modalChiTiet .modal-body {
    font-size: 0.88rem;
    padding: 0.75rem 0.85rem;
    line-height: 1.45;
}
#modalChiTiet .modal-body p { margin-bottom: 0.45rem; }
#modalChiTiet .modal-title { font-size: 0.95rem; }
#modalChiTiet .modal-footer { padding: 0.5rem 0.85rem 0.75rem; }
@media (max-width: 575.98px) {
    #agreMap { height: calc(100vh - 96px); min-height: 360px; }
    /* Chừa chỗ cho btnMapFullscreen (right 8 + 34 + gap) */
    .agre-map-info-wrap { right: 50px; width: min(340px, calc(100% - 62px)); max-width: calc(100% - 62px); }
    .agre-map-info-wrap.is-collapsed {
        right: 50px !important;
        top: 8px !important;
    }
    .agre-map-info { font-size: 0.76rem; }
    .agre-map-top-tools { right: 8px; top: 8px; }
    .agre-map-top-tools--left { left: 8px; top: 8px; }
    .agre-map-fabs { left: 8px; }
}
body.page-bandothongke-map-fs { overflow: hidden; }
body.page-bandothongke-map-fs .agre-map-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    border-radius: 0;
    border: none;
    margin: 0 !important;
}
body.page-bandothongke-map-fs #agreMap {
    height: 100% !important;
    min-height: 0;
}
body.page-bandothongke-map-fs .site-header {
    display: none !important;
}
.agre-map-shell:fullscreen,
.agre-map-shell:-webkit-full-screen {
    border-radius: 0;
    border: none;
    background: #1a2e1a;
}
.agre-map-shell:fullscreen #agreMap,
.agre-map-shell:-webkit-full-screen #agreMap {
    height: 100% !important;
    min-height: 0;
}
/* Modal lọc/chi tiết - nằm trong khung bản đồ, luôn trên lớp map */
#wrapAgreMapShell .modal {
    z-index: 2500 !important;
}
#wrapAgreMapShell .modal-backdrop {
    z-index: 2490 !important;
}
body.page-bandothongke-map-fs #wrapAgreMapShell .modal {
    z-index: 2500 !important;
}
body.page-bandothongke-map-fs #wrapAgreMapShell .modal-backdrop {
    z-index: 2490 !important;
}
