:root {
    --bg: #f2f5f9;
    --ink: #0f1b2e;
    --muted: #6b7789;
}

body {
    background:
        radial-gradient(circle at 10% 20%, rgba(13, 85, 153, 0.10), transparent 35%),
        radial-gradient(circle at 90% 10%, rgba(9, 130, 110, 0.08), transparent 35%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
    color: var(--ink);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.card-soft {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(10, 40, 80, 0.08);
}

.kpi .kpi-label {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi .kpi-value {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
}

.history-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

.raw-pre {
    max-width: 55vw;
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    padding: 0.5rem;
    border-radius: 10px;
}

.table td, .table th {
    vertical-align: middle;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 300px;
    min-height: 220px;
    max-height: 340px;
}

.chart-box.chart-box-sm {
    height: 260px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    display: block;
}

.score-groups {
    min-width: 190px;
}

.score-pill {
    display: inline-block;
    margin: 0.1rem 0.15rem 0.1rem 0;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.score-pill-high {
    background: #d9f2e4;
    color: #11623a;
}

.score-pill-mid {
    background: #fff2c2;
    color: #725100;
}

.score-pill-low {
    background: #eef2f7;
    color: #526173;
}

.country-impact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 680px;
}

.country-impact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.45rem;
    border: 1px solid #d7e0ea;
    border-radius: 999px;
    color: var(--ink);
    background: #ffffff;
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
}

.country-impact-chip span {
    color: var(--muted);
    font-weight: 700;
}

.heatmap-wrap {
    max-height: 70vh;
}

.heatmap-table {
    min-width: 980px;
    table-layout: fixed;
}

.heatmap-table th,
.heatmap-table td {
    width: 8rem;
}

.heatmap-table th:first-child,
.heatmap-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 7rem;
    background: #fff;
}

.heat-cell {
    display: block;
    width: 100%;
    min-height: 2rem;
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
    background: rgba(17, 98, 58, var(--heat-alpha));
    color: #0f1b2e;
    font-weight: 700;
    text-align: center;
}

.dashboard-heatmap-wrap {
    max-height: 260px;
}

.dashboard-heatmap-table {
    min-width: 720px;
}

.dashboard-heatmap-table th,
.dashboard-heatmap-table td {
    width: 5.8rem;
}

.dashboard-heatmap-table th:first-child,
.dashboard-heatmap-table td:first-child {
    width: 6.5rem;
}

@media (max-width: 768px) {
    .chart-box {
        height: 240px;
    }
}
