:root {
    --vnpt-blue: #0e4fa3;
    --vnpt-blue-dark: #0a3f85;
    --vnpt-border: #9ec0e8;
    --vnpt-bg: #eef3fa;
    --vnpt-text: #17395f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--vnpt-bg);
    color: var(--vnpt-text);
}

.dashboard-shell {
    background: var(--vnpt-bg);
}

.dashboard-frame {
    max-width: 1280px;
    --frame-pad: 8px;
    border: 2px solid #2e67ad;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
    padding: var(--frame-pad);
    box-shadow: 0 2px 8px rgba(13, 64, 126, 0.1);
}

.vnpt-header {
    border-radius: 8px;
    border: 1px solid #2f6db5;
    background: linear-gradient(180deg, #1b67be 0%, #0f519f 100%);
    color: #fff;
    margin-top: calc(var(--frame-pad) * -1);
    margin-left: calc(var(--frame-pad) * -1);
    margin-right: calc(var(--frame-pad) * -1);
    margin-bottom: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Logo VNPT: nền trong suốt trên thanh header xanh, kích thước lớn hơn */
.logo-badge {
    padding: 6px 10px 4px;
    border-radius: 0;
    background: transparent;
    color: inherit;
    align-self: center;
    margin-left: 8px;
}

/* Logo xanh → trắng trên header xanh (PNG nền trong suốt cho kết quả đẹp nhất) */
.vnpt-logo-img {
    width: auto;
    height: auto;
    max-height: 76px;
    max-width: min(168px, 26vw);
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
    vertical-align: middle;
    line-height: 1;
}

.avatar-symbol {
    font-size: 70px;
}

.mini-symbol {
    font-size: 18px;
}

.vnpt-header h1 {
    font-size: clamp(20px, 2.1vw, 34px);
    font-weight: 800;
    letter-spacing: 0.2px;
}

.vnpt-header h1 .title-line-1,
.vnpt-header h1 .title-line-2 {
    display: inline;
}

.vnpt-header h1 .title-sep-mobile {
    display: inline;
}

.vnpt-header p {
    font-size: clamp(12px, 1vw, 18px);
    font-weight: 700;
}

/* Header — mobile: gọn, tiêu đề full width hàng 2 */
@media (max-width: 767.98px) {
    .vnpt-header {
        padding-bottom: 6px;
    }

    .vnpt-header__main {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px !important;
        padding: 6px 8px 4px;
    }

    .vnpt-header__main .logo-badge {
        order: 1;
        margin-left: 0;
        padding: 4px 6px 2px;
        align-self: center;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .vnpt-header__main .update-badge {
        display: none;
    }

    .vnpt-header__main .text-center.flex-grow-1 {
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 92px);
        padding: 2px 2px 0;
        text-align: center !important;
    }

    .vnpt-header .vnpt-logo-img {
        max-height: 52px;
        max-width: 108px;
        filter: brightness(0) invert(1);
    }

    .vnpt-header h1 {
        font-size: 13px;
        line-height: 1.22;
        letter-spacing: 0.01em;
        margin-bottom: 1px !important;
    }

    .vnpt-header h1 .title-line-1,
    .vnpt-header h1 .title-line-2 {
        display: block;
        white-space: nowrap;
    }

    .vnpt-header h1 .title-sep-mobile {
        display: none;
    }

    .vnpt-header p {
        font-size: 10.5px;
        line-height: 1.28;
        font-weight: 600;
        margin-top: 1px;
        opacity: 0.95;
    }

    .vnpt-header .update-badge strong {
        font-size: 14px;
    }
}

/* Màn nhỏ: tránh cắt chữ tiêu đề (ví dụ "BÀN") */
@media (max-width: 420px) {
    .vnpt-header__main .text-center.flex-grow-1 {
        max-width: calc(100% - 86px);
    }

    .vnpt-header .vnpt-logo-img {
        max-height: 48px;
        max-width: 98px;
    }

    .vnpt-header h1 {
        font-size: 12px;
        line-height: 1.2;
        letter-spacing: 0;
    }

    .vnpt-header p {
        font-size: 10px;
    }
}

.update-badge {
    border: 1px solid #9bc2eb;
    border-radius: 10px;
    min-width: 118px;
    background: rgba(7, 43, 94, 0.42);
    font-size: 11px;
    line-height: 1.12;
    padding: 6px 10px 5px !important;
    margin-right: 10px;
    align-self: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.update-badge strong {
    display: block;
    font-size: 18px;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.panel {
    border: 1px solid var(--vnpt-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 74, 152, 0.1);
}

.panel-title {
    background: linear-gradient(180deg, #1366c8 0%, #0d4b97 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    padding: 7px 10px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.panel-title small {
    font-size: 12px;
    font-weight: 600;
}

.panel-body {
    background: #fff;
}

/* Block 6 + 7: cùng chiều cao (stretch theo hàng Bootstrap) */
.section6-panel,
.section7-panel {
    min-height: 0;
}

.section6-panel .section67-panel-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.section6-panel .section6-subrow {
    margin-top: auto;
}

.section7-panel .section67-panel-body.coord-list {
    flex: 1 1 auto;
}

/* Cùng padding nội dung cho block 6 & 7 */
.section67-panel-body {
    padding: 12px 14px 14px;
}

/* Block 7 — gọn dọc hơn block 6 */
.section7-panel .section67-panel-body {
    padding: 7px 12px 9px;
}

.section7-panel .coord-item {
    gap: 10px;
    padding: 7px 0;
}

.section7-panel .coord-content {
    padding-top: 1px;
}

.section7-panel .coord-value {
    margin-top: 4px;
}

.avatar-box {
    min-height: 160px;
    border: 1px solid #9abde4;
    border-radius: 10px;
    color: #1f6cc6;
    background: linear-gradient(180deg, #b9dcff 0%, #7eb5ef 100%);
    font-size: 66px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Thông tin cá nhân — avatar vuông vừa phải, không kéo theo chiều cao cả khối */
.profile-card .avatar-box.avatar-box--profile {
    min-height: 0;
    padding: 4px;
    aspect-ratio: 1;
}

.profile-card .avatar-box.avatar-box--profile .profile-avatar {
    width: 100%;
    height: 100%;
    max-height: 168px;
    min-height: 0;
    object-fit: cover;
    border-radius: 8px;
}

.profile-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.35;
    color: #17395f;
}

.profile-line-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #0c4fa3;
}

.profile-line-body {
    flex: 1;
    min-width: 0;
}

.profile-line-label {
    font-weight: 700;
    margin-right: 4px;
}

.profile-line-value {
    word-break: break-word;
    overflow-wrap: break-word;
}

.profile-line i {
    color: #0c4fa3;
    margin-right: 6px;
}

/* Thông tin cá nhân — mobile: avatar trái gọn, chữ phải; nhãn + giá trị cùng dòng */
@media (max-width: 767.98px) {
    .profile-card .panel-body {
        padding: 0.5rem 0.45rem !important;
    }

    .profile-card .avatar-box.avatar-box--profile {
        max-height: none;
        aspect-ratio: 1;
        padding: 3px;
    }

    .profile-card .avatar-box.avatar-box--profile .profile-avatar {
        max-height: 118px;
    }

    .profile-card .profile-line {
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 0.45rem;
        padding-bottom: 0.3rem;
        border-bottom: 1px dashed #d6e4f5;
        line-height: 1.42;
    }

    .profile-card .profile-line:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .profile-card .profile-line-icon {
        margin-top: 2px;
    }

    .profile-card .profile-line-body {
        display: inline;
        line-height: 1.38;
    }

    .profile-card .profile-line-label {
        display: inline;
        margin-right: 4px;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.02em;
        color: #3d5c80;
        text-transform: uppercase;
    }

    .profile-card .profile-line-value {
        display: inline;
        font-size: 12.5px;
        font-weight: 600;
        color: #17395f;
    }
}

.map-canvas {
    min-height: 520px;
    position: relative;
    border: 1px solid #9fc2e7;
    border-radius: 10px;
    background:
        linear-gradient(0deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
        repeating-linear-gradient(140deg, #dfe9f7 0 14px, #f6f9ff 14px 28px);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(16, 87, 172, 0.08);
}

.map-canvas::before {
    content: "";
    position: absolute;
    inset: 20px 30px;
    border: 4px solid #2a74bd;
    border-radius: 24% 18% 25% 28%;
    transform: rotate(-7deg);
}

.map-canvas--google::before {
    content: none;
}

.google-map-view {
    width: 100%;
    min-height: 520px;
    border: 0;
    display: block;
    background: #e9f2ff;
}

.google-embed-frame {
    width: 100%;
    min-height: 520px;
    border: 0;
    display: block;
    background: #e9f2ff;
}

.google-map-status {
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    color: #124f99;
    font-weight: 700;
    background: linear-gradient(180deg, #f6fbff 0%, #e8f2ff 100%);
}

.leaflet-tooltip.station-label {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
}

.leaflet-tooltip.station-label::before {
    border-top-color: rgba(20, 20, 20, 0.9);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(24, 108, 201, 0.22);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: #1f75d7;
    color: #fff;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.google-earth-open-link {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 4px 10px;
    border: 1px solid #2a6cb2;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #124f99;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.google-earth-open-link:hover {
    background: #ffffff;
    color: #0a3f85;
}

.map-marker {
    position: absolute;
    font-size: 22px;
    transform: translate(-50%, -50%);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.map-marker-img {
    position: absolute;
    width: 28px;
    height: 28px;
    object-fit: contain;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.8));
}

.marker-bts { color: #2a69bf; }
.marker-station { color: #59a43d; }
.marker-shelter { color: #7f57c8; }
.marker-line { color: #5f6f84; }
.marker-kcn { color: #f2b232; }
.marker-kdc { color: #8bcf6b; }
.marker-danger { color: #df443c; }

.legend-box {
    border: 1px solid #a5c5e7;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(16, 87, 172, 0.06);
}

.legend-box h6 {
    color: var(--vnpt-blue-dark);
    font-weight: 700;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 7px;
}

.legend-row i {
    width: 16px;
    text-align: center;
}

.legend-row .mini-symbol {
    width: 22px;
    text-align: center;
    font-size: 20px;
}

.legend-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 22px;
}

.stats-grid-row {
    border-top: 1px solid #d6e4f5;
}

/* Block 2: 6 ô hàng 1 + 4 ô hàng 2 — full width (6×2 + 4×3 = 12 cột) */
.power-source-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.power-source-grid > .stat-cell {
    grid-column: span 2;
    min-width: 0;
}

@media (max-width: 575px) {
    .power-source-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .power-source-grid > .stat-cell,
    .power-source-grid > .stat-cell:nth-child(n + 7) {
        grid-column: span 1;
    }
}

/* Block 2 + 3: hai cột cùng chiều cao — tránh flex-basis:0 + min-height:0 làm khối co mất */
.row-block2-block3 > [class*='col-'] {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.panel-block2,
.panel-block3 {
    flex: 1 1 auto;
    width: 100%;
    min-height: min-content;
}

/* Hàng 2 block 2: span 3 + tách hàng + gom nội dung */
.power-source-grid > .stat-cell:nth-child(n + 7) {
    grid-column: span 3;
    border-top: 2px solid #e3edf7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.power-source-grid > .stat-cell:nth-child(n + 7) .stat-stack {
    max-width: 15rem;
    margin-left: auto;
    margin-right: auto;
}

.power-source-grid--stretch {
    flex: 1 1 auto;
    grid-auto-rows: auto;
}

.power-source-grid--stretch > .stat-cell {
    display: flex;
    flex-direction: column;
}

.block3-panel-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Phần 2G–5G: chỉ cao theo nội dung — tránh khoảng trắng do căn giữa dọc */
.panel-block3 .block3-services {
    flex: 0 0 auto;
}

.panel-block3 .block3-sub {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 8px 6px;
    margin-top: 2px;
    border: 1px solid #c5d9f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.panel-block3 .block3-sub-grid {
    flex: 0 0 auto;
}

.panel-block3 .block3-sub-grid .stat-label {
    font-size: 11px;
    min-height: 0;
    margin-bottom: 2px;
}

.panel-block3 .block3-sub-grid .stat-value.small {
    font-size: 26px;
}

.panel-block3 .block3-sub-grid .stat-cell > div {
    padding: 0.4rem 0.35rem !important;
}

/* Thẻ dịch vụ — màu theo hình gốc */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card-inner {
    position: relative;
    z-index: 1;
}

.panel-block3 .service-card-inner {
    padding: 16px 10px 18px;
    justify-content: flex-start;
    gap: 12px;
}

/* Icon 2G–5G (SVG trong public/images/devices/services/) */
.service-tech-icon {
    width: 100%;
    max-width: 5.25rem;
    height: auto;
    aspect-ratio: 88 / 40;
    margin: 0 auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.07));
}

/* Khoảng cách dọc: flex gap trên .service-card-inner; tắt margin .service-label chung */
.panel-block3 .service-card .service-label {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.15;
}

.service-card--2g {
    background: linear-gradient(180deg, rgba(46, 125, 50, 0.14) 0%, #ffffff 52%);
}

.service-card--3g {
    background: linear-gradient(180deg, rgba(25, 118, 210, 0.14) 0%, #ffffff 52%);
}

.service-card--4g {
    background: linear-gradient(180deg, rgba(106, 27, 154, 0.12) 0%, #ffffff 52%);
}

.service-card--5g {
    background: linear-gradient(180deg, rgba(230, 81, 0, 0.12) 0%, #ffffff 52%);
}

.service-card--2g .service-label {
    color: #1b5e20;
}

.service-card--2g .service-value {
    color: #2e7d32;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.service-card--3g .service-label {
    color: #0d47a1;
}

.service-card--3g .service-value {
    color: #1565c0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.service-card--4g .service-label {
    color: #4a148c;
}

.service-card--4g .service-value {
    color: #6a1b9a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.service-card--5g .service-label {
    color: #bf360c;
}

.service-card--5g .service-value {
    color: #e65100;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.service-card .service-unit {
    color: #37474f;
    font-weight: 600;
    font-size: 12px;
    margin-top: 0;
}

.stat-cell {
    border-right: 1px solid #d6e4f5;
    border-bottom: 1px solid #d6e4f5;
    background: #fff;
    transition: background-color 0.2s ease;
}

.stat-cell:hover {
    background: #f5faff;
}

.stat-icon {
    font-size: 30px;
    color: #2a64b8;
    margin-bottom: 6px;
}

.device-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: inline-block;
    margin: 0 auto 8px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Nhãn thiết bị / chỉ tiêu: in hoa nhẹ, giãn cách dễ đọc, cân dòng khi xuống 2 dòng */
.stat-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #123e6d;
    min-height: 32px;
    line-height: 1.36;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    text-align: center;
    padding: 0 6px;
    text-wrap: balance;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    color: #0f58b0;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.stat-value.small {
    font-size: 30px;
}

.stat-unit {
    font-size: 12px;
    color: #4a6582;
    font-weight: 600;
}

.type-list {
    font-size: 24px;
    font-weight: 800;
    color: #1256a7;
    line-height: 1.25;
    margin-top: 6px;
}

/* Hình gốc: nhãn trên → icon giữa → số liệu dưới */
.stat-stack > .stat-label {
    min-height: 28px;
    margin-bottom: 6px;
    max-width: min(100%, 14rem);
    margin-left: auto;
    margin-right: auto;
}

.stat-stack > .device-icon {
    margin-top: 2px;
    margin-bottom: 10px;
}

.stat-stack > .stat-icon {
    margin-top: 2px;
    margin-bottom: 10px;
}

.stat-stack > .type-list {
    margin-top: 2px;
}

.stat-stack > .star-line {
    margin-top: 6px;
}

/* Block 4 + 5: truyền dẫn & backup — ô giãn theo chiều cao, dòng cách nhau, đơn vị bám đáy */
.panel-block4,
.panel-block5 {
    min-height: 0;
}

/* Block 4: chia đều N thiết bị theo chiều ngang (tránh cột trống như lưới 6×col-2) */
.panel-block4 .block4-devices-grid {
    display: grid;
    grid-template-columns: repeat(var(--block4-cols, 5), minmax(0, 1fr));
    width: 100%;
    align-items: stretch;
}

@media (max-width: 575px) {
    .panel-block4 .block4-devices-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
    }
}

.panel-block4 .stats-grid-row,
.panel-block5 .stats-grid-row {
    flex: 1 1 auto;
    min-height: 0;
}

.panel-block4 .stat-cell,
.panel-block5 .stat-cell {
    min-height: 0;
}

.stat-stack--block45 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 10px 16px;
    min-height: 100%;
}

.stat-stack--block45 > .stat-label {
    min-height: 0;
    margin-bottom: 0;
    max-width: 100%;
    line-height: 1.35;
}

.stat-stack--block45 > .device-icon,
.stat-stack--block45 > .stat-icon {
    margin-top: 0;
    margin-bottom: 0;
    flex-shrink: 0;
}

.stat-stack--block45 > .stat-value {
    line-height: 1.05;
    flex-shrink: 0;
}

.stat-stack--block45 > .stat-unit {
    margin-top: auto;
    padding-top: 4px;
    flex-shrink: 0;
}

/* Block 5 — backup nguồn: nhóm nhãn + số + đơn vị gọn, căn giữa dọc, không tách “trạm” xuống đáy */
.stat-stack--block5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 8px 14px;
    min-height: 100%;
}

.stat-stack--block5 > .stat-label {
    min-height: 3.35rem;
    margin: 0;
    max-width: 100%;
    line-height: 1.28;
    letter-spacing: 0.045em;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-wrap: balance;
    padding: 0 4px;
    color: #143a5a;
}

.stat-stack--block5 > .stat-value {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.stat-stack--block5 > .stat-unit {
    margin-top: 0;
    padding-top: 0;
    font-size: 11px;
    font-weight: 600;
    color: #5a7190;
    letter-spacing: 0.03em;
}

/* Block 5 — máy nắn nguồn */
.block5-station-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
}

.block5-station-card {
    border: 1px solid #c8dcf3;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    padding: 10px 10px 8px;
}

.block5-station-title {
    font-size: 13px;
    font-weight: 800;
    color: #0e4fa3;
    margin-bottom: 8px;
    text-transform: uppercase;
    line-height: 1.25;
}

.block5-machine + .block5-machine {
    margin-top: 8px;
}

.block5-machine-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #17395f;
    line-height: 1.3;
}

.block5-machine-spec {
    font-size: 12px;
    color: #1f446b;
    line-height: 1.35;
}

.section-compact .stat-stack > .stat-label {
    min-height: 22px;
    margin-bottom: 2px;
}

/* Compact tune for block 1 only */
.section-compact .panel-title {
    padding: 5px 8px;
    font-size: 14px;
}

.section-compact .compact-cell .p-2 {
    padding: 0.55rem 0.45rem !important;
}

.section-compact .device-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 5px;
}

.section-compact .stat-icon {
    font-size: 26px;
    margin-bottom: 5px;
}

.section-compact .stat-label {
    font-size: 11.5px;
    letter-spacing: 0.02em;
    max-width: 100%;
    min-height: 24px;
    line-height: 1.34;
}

.section-compact .stat-value {
    font-size: 30px;
}

.section-compact .stat-unit {
    font-size: 11px;
}

.section-compact .type-list {
    font-size: 18px;
    margin-top: 2px;
}

.section-compact .type-list--bts {
    width: 100%;
    max-width: 150px;
    margin: 4px auto 0;
    padding: 7px 10px 6px;
    border: 1px solid #c8dbf2;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #0f4f9b;
}

.service-label {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    color: #2e8c57;
    margin-bottom: 6px;
}

.service-value {
    font-size: 36px;
    line-height: 1;
    color: #1256a7;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.service-card .service-value {
    font-size: 38px;
    margin-top: 0;
    line-height: 1;
}

.sub-box-title {
    text-align: center;
    border: 1px solid #b9d1ec;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #315a86;
    background: #f7fbff;
}

/* Tiêu đề khối PE (block 3) — viên pill, không dùng chung .sub-box-title */
.block3-pe-title {
    text-align: center;
    border: 1px solid #9bbce0;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #0d4b97;
    background: linear-gradient(180deg, #f0f7ff 0%, #e3eef9 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin: 0 auto 6px;
    max-width: 96%;
}

.note-box {
    border: 1px dashed #acc7e6;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.note-box ul {
    padding-left: 18px;
    margin-top: 4px;
}

/* Block 6 — KCN/KDC: icon trái, nhãn + số + đơn vị bên phải */
.section6-cell .stat-label--section6-side {
    text-align: left;
    font-size: 12px;
    line-height: 1.28;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.stat-value--section6-side {
    font-size: 32px;
    text-align: left;
}

.stat-unit--section6-side {
    font-size: 12px;
    text-align: left;
    margin-top: 3px;
}

/* Cột lưu lượng: một icon trái + tiêu đề & list phải (không lặp icon) */
.traffic-side-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 100%;
}

.traffic-side-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-icon--traffic-side {
    width: 56px;
    height: 56px;
    margin-bottom: 0;
}

.stat-icon--traffic-side {
    font-size: 36px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #2a64b8;
}

.traffic-side-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Cột lưu lượng — giống hình gốc: tiêu đề + list, icon nhỏ góc dưới phải */
.traffic-cell-original {
    position: relative;
    min-height: 100%;
}

.traffic-cell-body {
    text-align: left;
    padding-right: 58px;
    padding-bottom: 2px;
}

.section6-cell .stat-label.stat-label--traffic-original {
    min-height: auto;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.hotspot-list--traffic {
    font-size: 13px;
    line-height: 1.32;
}

.traffic-corner-icon {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.traffic-corner-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.traffic-corner-symbol {
    font-size: 34px;
    color: #c85a1b;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hotspot-list {
    margin: 0;
    padding-left: 18px;
    text-align: left;
    font-size: 13px;
    color: #1f456d;
    line-height: 1.35;
    font-weight: 600;
}

.note-icon-tile {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.section6-cell .stat-label {
    min-height: 28px;
}

.section6-cell .stat-label.stat-label--section6-side {
    min-height: auto;
}

.section6-subrow {
    border-top: 1px solid #cfe0f4;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 12px);
}

.mini-note-box {
    border: 1px dashed #9bbce0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    background: #fbfdff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.mini-note-head {
    font-weight: 800;
    font-size: 13px;
    color: #0f58b0;
    margin-bottom: 8px;
    line-height: 1.2;
    letter-spacing: 0.12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e3eef9;
}

.mini-note-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}

.note-icon-tile img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.mini-note-content ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.35;
    color: #1a3f66;
    font-size: 12px;
    font-weight: 600;
}

/* Hai ô dưới block 6 — hình gốc: icon trái, tiêu đề + list phải */
.mini-note-box--side {
    padding: 10px 12px;
}

.mini-note-side-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.note-icon-tile--block6 {
    width: 56px;
    height: 56px;
}

.note-icon-tile--block6 img {
    width: 48px;
    height: 48px;
}

.mini-note-side-text {
    flex: 1;
    min-width: 0;
}

.mini-note-title {
    font-weight: 800;
    font-size: 12px;
    line-height: 1.3;
    color: #153a5c;
    margin-bottom: 7px;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    text-wrap: balance;
}

.mini-note-list {
    margin: 0;
    padding-left: 16px;
    font-size: 13px;
    line-height: 1.38;
    color: #1a3f66;
    font-weight: 600;
}

/* Block 6 — mobile: xếp dọc, chữ đọc được, không ép 3 cột */
@media (max-width: 767.98px) {
    .block5-station-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
    }

    .section6-top-row > .stat-cell {
        border-right: none;
    }

    .section6-top-row > .stat-cell:not(:last-child) {
        border-bottom: 1px solid #d6e4f5;
    }

    .section6-cell.section6-stat-col .traffic-side-layout {
        align-items: flex-start;
        gap: 12px;
        padding: 4px 0;
    }

    .section6-cell .stat-label--section6-side {
        font-size: 11px;
        line-height: 1.35;
        text-wrap: balance;
    }

    .stat-value--section6-side {
        font-size: 28px;
    }

    .section6-traffic-col .traffic-cell-body {
        padding-right: 0;
        padding-bottom: 48px;
    }

    .section6-cell .stat-label.stat-label--traffic-original {
        font-size: 11px;
        line-height: 1.35;
        text-wrap: balance;
    }

    .hotspot-list--traffic {
        font-size: 12px;
        line-height: 1.45;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .traffic-corner-icon {
        right: 8px;
        bottom: 8px;
        width: 40px;
        height: 40px;
    }

    .traffic-corner-img {
        width: 40px;
        height: 40px;
    }

    .traffic-corner-symbol {
        font-size: 28px;
    }

    .section6-subrow > .stat-cell:first-child {
        border-bottom: 1px solid #d6e4f5;
    }

    .section6-subrow > .stat-cell {
        border-right: none;
    }

    .mini-note-box--side {
        padding: 12px 12px 10px;
    }

    .mini-note-side-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .mini-note-title {
        font-size: 11px;
        letter-spacing: 0.03em;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .mini-note-list {
        font-size: 12px;
        line-height: 1.45;
        padding-left: 18px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .note-icon-tile--block6 {
        width: 48px;
        height: 48px;
    }

    .note-icon-tile--block6 img {
        width: 40px;
        height: 40px;
    }
}

.coord-list {
    font-size: 15px;
    color: #163c66;
    padding: 0;
}

.coord-item {
    display: flex;
    gap: 14px;
    border-bottom: 1px dashed #d2e2f4;
    padding: 14px 2px;
    align-items: flex-start;
}

.coord-item:last-child {
    border-bottom: none;
}

.coord-item i {
    color: #175aa8;
}

.coord-item .mini-symbol {
    flex-shrink: 0;
    color: #175aa8;
    font-size: 34px;
    width: 42px;
    height: auto;
    min-width: 42px;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.coord-content {
    flex: 1;
    min-width: 0;
    padding-top: 3px;
}

.coord-content strong {
    display: block;
    color: #17395f;
    line-height: 1.4;
    font-size: 15px;
    font-weight: 700;
}

.coord-value {
    margin-top: 6px;
    color: #17395f;
    line-height: 1.48;
    font-size: 14px;
    font-weight: 600;
}

.star-line {
    color: #f2c62e;
    font-size: 20px;
    letter-spacing: 1px;
    margin-top: 4px;
    text-shadow: 0 1px 0 rgba(115, 88, 0, 0.12);
}

.score-cell {
    background: linear-gradient(180deg, #f4f9ff 0%, #e9f2ff 100%);
    box-shadow: inset 0 0 0 1px #c5dcf5;
}

.score-cell-inner {
    padding-top: 10px !important;
    padding-bottom: 8px !important;
}

.score-cell .score-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 12px;
    margin: 0 auto 10px;
    border-radius: 999px;
    border: 1px solid #7aa9df;
    background: linear-gradient(180deg, #e8f3ff 0%, #d6eaff 100%);
    color: #114779;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.score-value {
    color: #1256a7;
    font-size: 36px;
    line-height: 1;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .vnpt-header h1 {
        font-size: 24px;
    }

    .vnpt-header p {
        font-size: 14px;
    }

    .panel-title {
        font-size: 14px;
    }

    .stat-value {
        font-size: 28px;
    }

    .service-label {
        font-size: 22px;
    }

    .service-value {
        font-size: 30px;
    }
}

@page {
    size: A4 landscape;
    margin: 6mm;
}

@media print {
    html,
    body {
        width: 100%;
        height: auto;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .dashboard-shell {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    .dashboard-frame {
        max-width: 100% !important;
        --frame-pad: 4px;
        border: 1px solid #2f6cb8;
        border-radius: 8px;
        box-shadow: none;
        padding: var(--frame-pad);
        margin: 0 !important;
    }

    .row.g-2,
    .row.g-0 {
        --bs-gutter-x: 0.3rem;
        --bs-gutter-y: 0.3rem;
    }

    .vnpt-header {
        margin-bottom: 4px;
    }

    .vnpt-logo-img {
        max-height: 52px;
        max-width: min(120px, 32vw);
        filter: brightness(0) invert(1);
    }

    .logo-badge {
        padding: 4px 6px 3px;
        margin-left: 4px;
    }

    .update-badge {
        min-width: 96px;
        font-size: 9px;
        padding: 4px 7px 4px !important;
        margin-right: 6px;
    }

    .update-badge strong {
        font-size: 15px;
    }

    .vnpt-header h1 {
        font-size: 22px;
    }

    .vnpt-header p {
        font-size: 12px;
    }

    .panel-title {
        font-size: 12px;
        padding: 4px 6px;
    }

    .avatar-box {
        min-height: 104px;
    }

    .profile-card .avatar-box.avatar-box--profile {
        min-height: 104px;
    }

    .profile-card .avatar-box.avatar-box--profile .profile-avatar {
        min-height: 0;
    }

    .avatar-symbol {
        font-size: 44px;
    }

    .profile-line {
        font-size: 11px;
        line-height: 1.25;
        margin-bottom: 2px !important;
    }

    .map-canvas {
        min-height: 250px;
    }

    .map-marker {
        font-size: 16px;
    }

    .map-marker-img {
        width: 20px;
        height: 20px;
    }

    .legend-row {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .legend-icon-img {
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
    }

    .mini-symbol {
        font-size: 14px;
    }

    .coord-item .mini-symbol {
        font-size: 22px;
        min-width: 28px;
        width: 28px;
    }

    .device-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 4px;
    }

    .device-icon--traffic-side,
    .stat-icon--traffic-side {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .traffic-corner-icon {
        width: 40px;
        height: 40px;
    }

    .traffic-corner-img {
        width: 40px;
        height: 40px;
    }

    .traffic-corner-symbol {
        font-size: 28px;
    }

    .traffic-cell-body {
        padding-right: 44px;
    }

    .note-icon-tile--block6 {
        width: 40px;
        height: 40px;
    }

    .note-icon-tile--block6 img {
        width: 36px;
        height: 36px;
    }

    .stat-icon {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 10px;
        min-height: 22px;
        line-height: 1.15;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-value.small {
        font-size: 20px;
    }

    .service-label {
        font-size: 18px;
    }

    .service-value {
        font-size: 24px;
    }

    .stat-unit {
        font-size: 10px;
    }

    .type-list {
        font-size: 16px;
        margin-top: 2px;
    }

    .sub-box-title {
        font-size: 10px;
        padding: 4px;
    }

    .note-box {
        font-size: 10px;
        padding: 6px 8px;
    }

    .section67-panel-body {
        padding: 6px 8px 8px;
    }

    .coord-list {
        font-size: 10px;
    }

    .coord-content strong {
        font-size: 11px;
    }

    .coord-value {
        font-size: 10px;
    }

    .coord-item {
        padding: 4px 0;
    }

    .section7-panel .coord-item {
        padding: 3px 0;
    }

    .section7-panel .section67-panel-body {
        padding: 5px 6px 6px;
    }

    .star-line {
        font-size: 14px;
        margin-top: 2px;
    }

    .score-value {
        font-size: 26px;
    }

    .panel,
    .stat-cell,
    .coord-item,
    .note-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
