* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0b1120;
    color: #e2e8f0;
    min-height: 100vh;
}

/* Header */
header {
    background: #111827;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.accent {
    color: #38bdf8;
    font-weight: 400;
}

.badge {
    font-size: 0.65rem;
    font-weight: 600;
    background: #1e3a5f;
    color: #38bdf8;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#status-bar {
    font-size: 0.8rem;
    color: #64748b;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* Upload */
.upload-zone {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.upload-box {
    background: #111827;
    border: 1.5px dashed #1e293b;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: #38bdf8;
    background: #0c1a30;
}

.upload-box.loaded {
    border-color: #22c55e;
    border-style: solid;
    background: #0c1f17;
}

.upload-icon {
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.upload-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.upload-hint {
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 0.75rem;
}

.btn {
    display: inline-block;
    background: #1e40af;
    color: white;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn:hover {
    background: #2563eb;
}

.filename {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 500;
}

/* Dashboard */
.dashboard {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.stat-card {
    background: #111827;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #1e293b;
}

.stat-card .label {
    font-size: 0.65rem;
    font-weight: 500;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.stat-card .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-card .sub {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 0.1rem;
}

.stat-card.highlight {
    border-color: #1e3a5f;
    background: #0c1a30;
}

.stat-card.highlight .value {
    color: #38bdf8;
}

/* Map */
.map-panel {
    background: #111827;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #1e293b;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.map-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
}

.map-controls {
    display: flex;
    gap: 0.75rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 14px;
    height: 14px;
}

#map {
    height: 480px;
    border-radius: 6px;
    z-index: 1;
}

.map-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #1e293b;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: #64748b;
}

.legend-line {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.chart-panel {
    background: #111827;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #1e293b;
}

.chart-panel h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.6rem;
}

.chart-panel canvas {
    width: 100% !important;
    height: 220px !important;
}

/* Anchor markers on map */
.anchor-marker div {
    transition: transform 0.15s;
}
.anchor-marker div:hover {
    transform: scale(1.2);
}

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-export {
    background: #065f46;
    color: #6ee7b7;
    border: 1px solid #047857;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-export:hover {
    background: #047857;
    color: #fff;
}

/* Conclusion panel */
.conclusion-panel {
    display: flex;
    flex-direction: column;
}

#conclusion-text {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1;
}

#conclusion-text .metric {
    font-weight: 700;
    color: #f1f5f9;
}

#conclusion-text .good {
    color: #22c55e;
}

#conclusion-text .warn {
    color: #eab308;
}

#conclusion-text .bad {
    color: #ef4444;
}

/* Diff chart threshold line */
.diff-threshold-line {
    border-top: 1px dashed #ef4444;
}

/* Responsive */
@media (max-width: 900px) {
    .upload-zone {
        grid-template-columns: 1fr;
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    #map {
        height: 350px;
    }
    .map-controls {
        flex-wrap: wrap;
    }
}
