* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
    color: #1a2332;
    background: #f0f4f8;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.header-title .subtitle {
    font-size: 0.82rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 4px;
}
.header-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.header-stats {
    display: flex;
    gap: 12px;
}
.header-stats .stat {
    background: rgba(255,255,255,0.15);
    padding: 8px 14px;
    border-radius: 8px;
    text-align: center;
    min-width: 70px;
}
.header-stats .stat-num {
    font-size: 1.3rem;
    font-weight: 800;
}
.header-stats .stat-lbl {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* Filter */
.filter-bar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.filter-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.88rem;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-group label {
    font-weight: 600;
    color: #555;
}
.filter-group select {
    padding: 6px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}
.filter-group select:focus {
    outline: 2px solid #1565c0;
    outline-offset: -1px;
}
.btn-reset {
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    font-family: inherit;
    font-size: 0.85rem;
}
.btn-reset:hover { background: #e2e8f0; }
.filter-count {
    margin-left: auto;
    font-weight: 700;
    color: #1565c0;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 6px;
}

/* Map */
#map-container {
    position: relative;
    height: calc(100vh - 190px);
    min-height: 500px;
}
#map { height: 100%; width: 100%; }

/* Legend */
.map-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: #fff;
    padding: 12px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 800;
    font-size: 0.82rem;
}
.map-legend h4 {
    margin-bottom: 8px;
    color: #1a2332;
    font-size: 0.88rem;
    font-weight: 700;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}
.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Footer */
.site-footer {
    background: #1a2332;
    color: #cbd5e1;
    text-align: center;
    padding: 16px;
    font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; }

/* Leaflet tooltip polygon */
.leaflet-tooltip.polygon-label {
    background: rgba(255,255,255,0.92);
    border: 1px solid #1565c0;
    color: #0d47a1;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Custom back-to-main button */
.back-main-btn {
    background: #1565c0;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Mobile */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .header-title h1 { font-size: 1.1rem; }
    .header-stats { width: 100%; justify-content: space-between; }
    .header-stats .stat { flex: 1; padding: 6px 8px; min-width: 0; }
    .header-stats .stat-num { font-size: 1rem; }
    .filter-inner { padding: 0 10px; gap: 8px; }
    .filter-group { flex: 1; min-width: 140px; }
    .filter-count { width: 100%; text-align: center; margin-left: 0; }
    #map-container { height: calc(100vh - 320px); min-height: 400px; }
    .map-legend { font-size: 0.75rem; padding: 8px 10px; bottom: 10px; right: 10px; }
    .map-legend h4 { font-size: 0.78rem; }
}
