@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: #f5f6f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.banner-section {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-bottom: 4px solid #1a3a7a;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 18px 80px;
    gap: 24px;
    flex-wrap: wrap;
}

.logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logos img {
    height: clamp(50px, 5vw, 70px);
}

.titles {
    flex: 1;
    text-align: center;
    min-width: 300px;
}

.titles h1 {
    color: #0d2c60;
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.titles h2 {
    color: #cc292b;
    font-size: clamp(16px, 1.6vw, 22px);
    font-weight: 600;
    margin-top: 4px;
}

.dashboard {
    flex: 1;
    width: 100%;
    padding: 0 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blue-banner-section {
    background:
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.03) 30px,
            rgba(255,255,255,0.03) 60px
        ),
        radial-gradient(ellipse at 20% 50%, rgba(30,80,180,0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(20,60,140,0.3) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(100,180,255,0.08) 0%, transparent 40%),
        linear-gradient(160deg, #0b2a5e 0%, #15417d 30%, #1a4f9a 60%, #0d3468 100%);
    border-radius: 0;
    padding: 35px 80px 40px 80px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.3),
        inset 0 -2px 0 rgba(255,255,255,0.05);
}

.blue-banner-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.blue-banner-section::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 30%;
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(100,180,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.blue-banner-headers { display: none; }

.blue-content-wrapper {
    display: flex;
    gap: 30px;
    position: relative;
    padding-left: 330px;
    z-index: 2;
}

.mascot-absolute {
    position: absolute;
    left: 50px;
    bottom: -5px;
    height: 115%;
    max-height: 420px;
    z-index: 10;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
}

.mascot-absolute:hover {
    transform: scale(1.03);
}

.measure-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.measure-title {
    color: #fff;
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.15);
    letter-spacing: 0.5px;
}

.measure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr; 
    gap: 14px;
    flex: 1; 
}

.stat-box {
    background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    padding: 16px 14px;
    display: flex;
    align-items: center;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255,255,255,0.3);
    height: 100%;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.stat-icon-col {
    width: 140px; 
    border-right: 2px solid #eef2f7;
    padding-right: 12px;
    margin-right: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
}

.stat-icon-col .title {
    font-size: 16px;
    font-weight: 700;
    color: #1a3a7a;
    line-height: 1.3;
    margin-bottom: 8px;
}

.stat-icon-col img {
    width: 100%;
    max-width: 65px;
    height: auto;
    border-radius: 6px;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.stat-info .label {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
    line-height: 1.4;
    margin-bottom: 4px;
}

.value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.stat-info .value {
    font-size: clamp(32px, 3.5vw, 46px);
    font-weight: 900;
    color: #cc292b;
    line-height: 1;
}

.stat-info .unit {
    font-size: 20px;
    color: #cc292b;
    font-weight: 700;
}

.bottom-section {
    flex: 1;
    display: flex;
    gap: 30px;
    background: #fff;
    border-radius: 0;
    padding: 30px 80px;
    flex-wrap: nowrap;
    align-items: stretch;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table-area {
    flex: 1.2;
    min-width: 0;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf2;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-height: 500px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    color: #2d3748;
}

.data-table th {
    background: linear-gradient(135deg, #1a4080 0%, #0d2c60 100%);
    color: #fff;
    padding: 16px 20px;
    text-align: left;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table th:last-child {
    text-align: right;
    width: 160px;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #edf0f5;
}

.data-table tr td:first-child {
    max-width: none;
    white-space: normal;
    font-weight: 500;
    line-height: 1.6;
    color: #2d3748;
}

.data-table tr td:last-child {
    text-align: right;
    font-weight: 800;
    white-space: nowrap;
    font-size: 20px;
    color: #cc292b;
}

.data-table tr:nth-child(even) {
    background-color: #f8fafd;
}

.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background-color: #eef4ff !important;
}

.clickable-row:hover td:first-child {
    color: #1a5bc4;
}

.clickable-row:active {
    background-color: #dbe8ff !important;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.pct-text {
    font-size: 16px;
    color: #888;
    font-weight: 500;
    margin-left: 6px;
}

.pie-area {
    flex: 1.5;
    min-width: 500px;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf2;
}

.pie-summary-title {
    font-size: 28px;
    font-weight: 800;
    color: #0d2c60;
    margin-bottom: 12px;
}

.pie-total-box {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 15px;
}

.pie-total-box .total-val {
    font-size: 46px;
    font-weight: 900;
    color: #cc292b;
    line-height: 1;
}

.pie-total-box .total-lbl {
    font-size: 22px;
    font-weight: 700;
    color: #0d2c60;
}

.pie-chart {
    width: 100%;
    flex: 1;
    min-height: 400px;
}

.tlp-tag, .indicator-circles, .gauge-icon, .gauge-needle,
.doc-icon, .docs-placeholder-container, .doc-mockup,
.screenshot-placeholder, .amber-box, .hands-icon,
.table-wrapper { display: none; }

.finance-section {
    display: flex;
    gap: 20px;
    padding: 0 40px 20px 40px;
    margin-top: 20px;
    align-items: stretch;
}

.split-stat-box {
    display: flex;
    gap: 10px;
}

.split-col {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.split-stat-box .stat-icon-col {
    width: clamp(60px, 8vw, 100px) !important;
    margin-right: 8px !important;
}

.split-stat-box .stat-icon-col .title {
    font-size: clamp(11px, 1.2vw, 14px);
    margin-bottom: 4px;
}

.split-stat-box .stat-info .value {
    font-size: clamp(20px, 2.5vw, 32px);
}

.split-stat-box .stat-info .label {
    font-size: clamp(12px, 1.5vw, 15px);
    white-space: normal;
    line-height: 1.2;
    word-break: break-word;
}

.split-left {
    border-right: 2px solid #eef2f7;
    padding-right: 15px;
}

.split-right {
    padding-left: 5px;
}

@media (max-width: 1200px) {
    .blue-content-wrapper {
        padding-left: 240px;
        gap: 20px;
    }

    .mascot-absolute {
        max-height: 360px;
    }

    .measure-grid {
        grid-template-columns: 1fr;
    }

    .bottom-section {
        flex-direction: column;
    }

    .pie-area {
        flex: none;
        width: 100%;
        min-width: 0;
        position: static;
    }

    .pie-chart {
        height: 450px;
    }

    .finance-section {
        padding: 0 20px 20px 20px;
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .blue-content-wrapper {
        flex-direction: column;
        padding-left: 0;
        padding-top: 20px;
    }

    .mascot-absolute {
        position: relative;
        bottom: 0;
        left: 0;
        margin: 0 auto 15px auto;
        display: block;
        height: auto;
        max-height: 250px;
    }

    .blue-banner-section {
        padding: 25px 20px 30px 20px;
    }

    header {
        padding: 15px 20px;
        justify-content: center;
    }

    .split-stat-box {
        flex-direction: column;
        gap: 10px;
    }

    .split-left {
        border-right: none;
        border-bottom: 2px solid #eef2f7;
        padding-right: 0;
        padding-bottom: 10px;
        width: 100%;
    }

    .split-right {
        padding-left: 0;
        width: 100%;
    }

    .stat-box[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    .finance-section {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .table-area {
        max-height: none;
        overflow: visible;
        height: auto;
    }
    .titles h1 { font-size: 20px; }
    .titles h2 { font-size: 13px; }

    .dashboard {
        padding: 0 10px 30px 10px;
    }

    .blue-banner-section {
        padding: 20px 15px 25px 15px;
        border-radius: 0 0 14px 14px;
    }

    .bottom-section {
        padding: 15px;
        border-radius: 0 0 14px 14px;
    }

    .stat-box {
        padding: 12px 10px;
    }

    .stat-info .value {
        font-size: 22px;
    }

    .pie-area {
        padding: 15px;
        min-width: 0;
    }

    .pie-chart {
        height: 380px;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th {
        font-size: 14px;
        padding: 10px;
    }

    .data-table th:last-child {
        width: 120px;
    }

    .data-table td {
        padding: 10px;
    }

    .data-table tr td:last-child {
        font-size: 15px;
    }
}

@media (min-width: 1920px) {
    body {
        height: 100vh;
        overflow: hidden; 
    }
    header {
        padding: 12px 80px;
    }
    .logos img {
        height: 55px;
    }
    .titles h1 {
        font-size: 32px;
    }
    .titles h2 {
        font-size: 18px;
    }
    .blue-banner-section {
        padding: 20px 80px 25px 80px;
    }
    .mascot-absolute {
        max-height: 340px;
    }
    .measure-title {
        font-size: 24px;
        padding-bottom: 4px;
    }
    .stat-box {
        padding: 10px 14px;
    }
    .stat-info .value {
        font-size: 34px;
    }
    .stat-info .label {
        font-size: 16px;
    }
    .stat-icon-col img {
        max-width: 50px;
    }
    .finance-section {
        padding: 0 80px 15px 80px;
        margin-top: 15px;
    }
    .dashboard, .bottom-section {
        min-height: 0; 
    }
    .bottom-section {
        padding: 15px 80px;
    }
    .table-area {
        height: 100%;
        min-height: 0;
        max-height: none;
    }
    .pie-area {
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 15px;
    }
    .pie-summary-title {
        font-size: 24px;
        margin-bottom: 8px;
    }
    .pie-total-box .total-val {
        font-size: 38px;
    }
    .pie-total-box .total-lbl {
        font-size: 18px;
    }
    .pie-chart {
        flex: 1;
        min-height: 0;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: #cc292b;
}

#modalAgencyName {
    color: #0d2c60;
    margin-bottom: 20px;
    padding-right: 30px;
    font-size: 24px;
    font-weight: 700;
}

.modal-table-area {
    overflow-y: auto;
    flex: 1;
    border: 1px solid #e8ecf2;
    border-radius: 8px;
    box-shadow: none;
}
