:root {
    --primary-color: #EE9B00;
    --primary-dark: #c27d00;
    --secondary-color: #5C4D3C;
    --body-bg: #F7F5F0;
    --card-bg: #FFFFFF;
    --text-color: #3D3D3D;
    --light-text: #7a7a7a;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #FF5252;
    --nav-height: 88px;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --grid: #e8e1d6;
    --map-empty: #f3eee6;
    --line: rgba(92, 77, 60, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(238, 155, 0, 0.12), transparent 28%),
        linear-gradient(180deg, #fcfbf8 0%, var(--body-bg) 100%);
    color: var(--text-color);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    backdrop-filter: blur(16px);
    background: rgba(247, 245, 240, 0.94);
    border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.header-inner {
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff8f0;
    box-shadow: 0 14px 28px rgba(238, 155, 0, 0.18);
    flex: 0 0 auto;
}

.logo-mark svg {
    width: 28px;
    height: 28px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-kicker,
.nav-link,
.footer-note {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.brand-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 700;
}

.brand-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    font-family: Georgia, "Times New Roman", serif;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary-color);
    border: 1px solid transparent;
    transition: 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    border-color: rgba(92, 77, 60, 0.14);
    background: rgba(255, 250, 244, 0.86);
}

.nav-link.active {
    background: var(--primary-color);
    color: #fffaf4;
    box-shadow: 0 12px 24px rgba(238, 155, 0, 0.22);
}

.dashboard-shell {
    width: min(1200px, calc(100% - 20px));
    margin: 22px auto;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.page-intro {
    padding: 25px;
    background: var(--secondary-color);
    color: var(--body-bg);
    text-align: center;
    box-shadow: var(--shadow);
    border-bottom: 5px solid var(--primary-color);
    text-align: center;
}

.intro-kicker,
.panel-kicker {
    margin: 0;
}

.intro-kicker {
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
}

.page-intro h1 {
    margin: 0;
    color: var(--body-bg);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 0.98;
    font-family: Georgia, "Times New Roman", serif;
}

.intro-copy {
    margin: 0 auto;
    max-width: 72ch;
    color: var(--light-text);
    line-height: 1.6;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 160px;
    gap: 16px;
    align-items: end;
    padding: 14px;
    background: #f3eee6;
    border-bottom: 1px solid rgba(92, 77, 60, 0.08);
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    color: var(--secondary-color);
}

.filter-group select,
.filter-actions button {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(92, 77, 60, 0.14);
    background: #fff;
    color: var(--text-color);
    font: inherit;
    border-radius: 8px;
    padding: 0 12px;
}

.filter-actions button {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--primary-color);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(238, 155, 0, 0.2);
}

.filter-actions button:hover {
    background: var(--primary-dark);
}

.hero-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    padding: 18px 14px 14px;
}

.stats-panel,
.chart-panel,
.notes-panel {
    background: transparent;
    min-width: 0;
}

.hero-metric strong,
.feature-metric strong,
.detail-metrics strong {
    display: block;
    line-height: 1;
}

.hero-metric {
    margin-bottom: 10px;
}

.hero-metric strong {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    color: var(--secondary-color);
}

.hero-metric span {
    display: block;
    margin-top: 6px;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.feature-metric {
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 12px 6px;
    margin-bottom: 4px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.feature-metric strong {
    font-size: 2rem;
    font-weight: 800;
}

.feature-metric span {
    display: block;
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 700;
}

.detail-metrics {
    background: #8d7b67;
    color: #fff;
    padding: 12px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.detail-metrics div + div {
    margin-top: 10px;
}

.detail-metrics strong {
    font-size: 1.2rem;
    font-weight: 800;
}

.detail-metrics span {
    display: block;
    margin-top: 2px;
    font-size: 0.95rem;
    font-weight: 700;
}

.panel-header {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    text-align: center;
}

.panel-kicker {
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
}

.panel-question {
    margin: 8px 0 0;
    color: var(--light-text);
    font-size: 0.94rem;
    line-height: 1.55;
}

.panel-header h2,
.notes-panel h3 {
    margin: 0;
    color: var(--secondary-color);
    font-family: Georgia, "Times New Roman", serif;
}

.panel-header h2 {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.panel-header > div {
    width: 100%;
}

.hero-grid .panel-header > div {
    margin-left: 0;
}

.legend-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--light-text);
    font-size: 0.84rem;
}

.legend-inline span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.legend-dot-bars {
    background: var(--secondary-color);
}

.legend-dot-positive {
    background: var(--primary-color);
}

.legend-dot-negative {
    background: #8e7961;
}

.legend-line {
    width: 28px;
    height: 3px;
    display: inline-block;
    background: var(--primary-color);
}

.chart-container {
    width: 100%;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chart-is-updating {
    opacity: 0.7;
    transform: translateY(4px);
}

.chart-large {
    min-height: 320px;
}

.chart-medium {
    min-height: 280px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    padding: 0 14px 18px;
}

.notes-panel {
    color: var(--secondary-color);
    font-size: 1.05rem;
    line-height: 1.5;
}

.notes-panel p {
    margin: 14px 0 0;
    color: var(--secondary-color);
    font-weight: 600;
}

.notes-panel strong {
    font-weight: 800;
}

.notes-panel h3 {
    font-size: 2rem;
    color: var(--secondary-color);
}

.axis text,
.axis-label {
    fill: var(--light-text);
    font-size: 0.8rem;
}

.axis path,
.axis line {
    stroke: #ddd4c7;
}

.grid line {
    stroke: var(--grid);
    stroke-dasharray: 1 4;
}

.grid path {
    stroke: none;
}

.tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 12px));
    min-width: 180px;
    border-radius: 10px;
    background: rgba(92, 77, 60, 0.96);
    color: #fff;
    padding: 10px 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    transition: opacity 120ms ease;
    font-size: 0.9rem;
}

.tooltip strong {
    display: block;
    margin-bottom: 6px;
}

.map-label {
    fill: #131313;
    font-size: 0.72rem;
    font-weight: 800;
    text-anchor: middle;
    pointer-events: none;
}

.empty-state {
    padding: 16px 0;
    color: var(--light-text);
}

@media (max-width: 980px) {
    .header-inner,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .hero-grid,
    .bottom-grid,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .dashboard-shell {
        width: min(100% - 24px, 1200px);
    }

    .hero-grid,
    .bottom-grid {
        gap: 16px;
    }

    .notes-panel {
        order: 3;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .footer-inner {
        width: min(100% - 28px, 1180px);
    }

    .site-nav {
        width: 100%;
        gap: 8px;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }

    .dashboard-shell {
        width: min(100% - 16px, 1200px);
        margin: 16px auto;
        border-radius: 18px;
    }

    .page-intro {
        padding: 20px 16px;
    }

    .filter-bar,
    .hero-grid,
    .bottom-grid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .filter-bar {
        gap: 12px;
    }

    .filter-group select,
    .filter-actions button {
        height: 44px;
    }

    .hero-metric strong {
        font-size: clamp(1.9rem, 10vw, 2.6rem);
    }

    .feature-metric strong {
        font-size: 1.75rem;
    }

    .chart-large {
        min-height: 260px;
    }

    .chart-medium {
        min-height: 240px;
    }
}

.site-footer {
    margin-top: 26px;
    background: var(--primary-dark);
    color: #fffaf4;
}

.footer-inner {
    padding: 24px 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-title {
    margin: 0 0 6px;
    font-size: 1.04rem;
    font-family: Georgia, "Times New Roman", serif;
}

.footer-note {
    color: rgb(255, 255, 255);
    line-height: 1.7;
}
