:root {
    --fdm-nav: #2c3e50;
    --fdm-nav-active: #1abc9c;
    --fdm-bg: #ecf0f1;
    --fdm-panel: #ffffff;
    --fdm-border: #d5dbdb;
    --fdm-text: #2c3e50;
    --fdm-muted: #7f8c8d;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--fdm-bg);
    color: var(--fdm-text);
}

.fdm-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.fdm-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--fdm-nav);
    color: #fff;
    flex-shrink: 0;
}

.fdm-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .fdm-brand h1 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .fdm-brand small {
        opacity: 0.85;
        font-size: 0.75rem;
    }

.fdm-brand-icon {
    font-size: 1.8rem;
}

.fdm-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.fdm-tab {
    background: transparent;
    border: none;
    color: #bdc3c7;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

    .fdm-tab:hover {
        color: #fff;
    }

    .fdm-tab.active {
        color: #fff;
        border-bottom-color: var(--fdm-nav-active);
    }

.fdm-dashboard {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.fdm-sidebar {
    width: 320px;
    min-width: 280px;
    background: #dfe6e9;
    border-left: 1px solid var(--fdm-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.fdm-panel {
    background: var(--fdm-panel);
    margin: 0.75rem;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

    .fdm-panel h3, .fdm-panel h4 {
        margin: 0 0 0.75rem;
        font-size: 1rem;
        color: var(--fdm-nav);
    }

.fdm-date {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.fdm-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fdm-stat {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
}

    .fdm-stat .label {
        display: block;
        font-size: 0.75rem;
        color: var(--fdm-muted);
        margin-bottom: 0.25rem;
    }

    .fdm-stat strong {
        font-size: 1.1rem;
        color: var(--fdm-nav);
    }

.fdm-slider-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--fdm-muted);
}

.fdm-slider {
    width: 100%;
    margin-bottom: 0.25rem;
}

.fdm-slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--fdm-muted);
}

.fdm-hint {
    font-size: 0.75rem;
    color: var(--fdm-muted);
    margin: 0.75rem 0 0;
}

.fdm-chart-panel {
    flex: 1;
    min-height: 220px;
}

    .fdm-chart-panel canvas {
        max-height: 200px;
    }

.fdm-logos {
    padding: 0.75rem 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--fdm-muted);
    margin-top: auto;
}

.fdm-map-area {
    flex: 1;
    position: relative;
    min-width: 0;
}

.fdm-map-wrapper {
    position: absolute;
    inset: 0;
}

.fdm-map {
    width: 100%;
    height: 100%;
}

.fdm-layer-control {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 0.8rem;
}

    .fdm-layer-control label {
        display: block;
        margin: 0.25rem 0;
        cursor: pointer;
    }

.fdm-legends {
    position: absolute;
    right: 12px;
    bottom: 40px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fdm-legend {
    background: rgba(255,255,255,0.92);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    min-width: 100px;
}

    .fdm-legend h5 {
        margin: 0 0 0.35rem;
        font-size: 0.75rem;
    }

.fdm-legend-bar {
    height: 12px;
    border-radius: 2px;
}

    .fdm-legend-bar.smi {
        background: linear-gradient(to right, #08306b, #6baed6, #fee0d2, #cb181d);
    }

    .fdm-legend-bar.flow {
        background: linear-gradient(to right, #440154, #21918c, #fde725);
    }

.fdm-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--fdm-muted);
    margin-top: 0.2rem;
}

.fdm-feature-popup {
    position: absolute;
    left: 12px;
    bottom: 40px;
    z-index: 1000;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 0.85rem;
}

.fdm-content-page {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #fff;
    margin: 1rem;
    border-radius: 4px;
}

.fdm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

    .fdm-table th, .fdm-table td {
        border: 1px solid var(--fdm-border);
        padding: 0.5rem 0.75rem;
        text-align: right;
    }

    .fdm-table th {
        background: #f8f9fa;
    }

.fdm-map-error {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #ffeaea;
    color: #c0392b;
    border: 1px solid #e74c3c;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    max-width: 420px;
    font-size: 0.85rem;
}

background: #c0392b;
color: #fff;
bottom: 0;
display: none;
left: 0;
padding: 0.6rem 1rem;
position: fixed;
width: 100%;
z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 900px) {
    .fdm-dashboard {
        flex-direction: column;
    }

    .fdm-sidebar {
        width: 100%;
        max-height: 45vh;
    }

    .fdm-map-area {
        min-height: 50vh;
    }
}
