* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overflow: hidden;
}
#map { width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; }

.legend {
    position: absolute; bottom: 30px; right: 10px; background: white;
    padding: 15px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000; max-width: 280px;
}
.legend h4 { margin: 0 0 10px 0; font-size: 14px; font-weight: 600; }
.legend-item { 
    display: flex; align-items: center; margin: 6px 0; font-size: 12px; 
    cursor: pointer; user-select: none; transition: opacity 0.2s;
}
.legend-item:hover { background: #f3f4f6; padding: 2px 4px; margin: 4px -4px; border-radius: 4px; }
.legend-item.disabled { opacity: 0.4; }
.legend-marker { width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; flex-shrink: 0; }
.substation { background: #8b4513; }
.charging-available { background: #22c55e; }
.charging-busy { background: #eab308; }
.charging-offline { background: #6b7280; }
.count { font-weight: 600; color: #6b7280; }

.stats-section { 
    margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e7eb;
    font-size: 11px; color: #6b7280;
}
.stat-row { display: flex; justify-content: space-between; margin: 4px 0; }
.stat-label { color: #4b5563; }
.stat-value { font-weight: 600; color: #1f2937; }

.maplibregl-popup-content { min-width: 200px; }
.popup-content h3 { margin: 0 0 8px 0; font-size: 14px; color: #1f2937; }
.popup-content p { margin: 4px 0; font-size: 12px; color: #4b5563; }
.connector-status { margin: 8px 0; padding: 6px; background: #f3f4f6; border-radius: 4px; font-size: 11px; }
.status-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 10px; margin-right: 4px; }
.available { background: #dcfce7; color: #166534; }
.charging { background: #fef3c7; color: #854d0e; }
.offline { background: #f3f4f6; color: #374151; }

.ruler-control {
    position: absolute; bottom: 380px; right: 10px; background: white;
    padding: 10px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
}
.ruler-button {
    background: #3b82f6; color: white; border: none; padding: 8px 16px;
    border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
    transition: background 0.2s;
}
.ruler-button:hover { background: #2563eb; }
.ruler-button.active { background: #dc2626; }
.ruler-info { margin-top: 8px; font-size: 12px; color: #4b5563; display: none; }
.ruler-info.show { display: block; }
.ruler-distance { font-weight: 600; color: #1f2937; font-size: 14px; }

.chart-control {
    position: absolute; top: 10px; right: 10px; background: white;
    padding: 12px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000; width: 340px;
}
.chart-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.chart-header h4 { margin: 0; font-size: 13px; font-weight: 600; }
.period-selector { display: flex; gap: 5px; }
.period-btn {
    padding: 4px 12px; border: 1px solid #e5e7eb; background: white;
    border-radius: 4px; cursor: pointer; font-size: 12px;
}
.period-btn.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.period-btn:hover:not(.active) { background: #f3f4f6; }

.connector-filter-wrapper { position: relative; margin-bottom: 10px; }
.connector-filter-button {
    width: 100%; padding: 6px 10px; background: white;
    border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 11px; cursor: pointer; text-align: left;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.2s;
}
.connector-filter-button:hover { background: #f9fafb; border-color: #9ca3af; }
.connector-filter-button.active { border-color: #3b82f6; background: #eff6ff; }
.connector-filter-label { color: #374151; font-weight: 500; }
.connector-filter-arrow { color: #6b7280; transition: transform 0.2s; }
.connector-filter-arrow.open { transform: rotate(180deg); }
.connector-filter-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 2px; background: white; border: 1px solid #d1d5db;
    border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001; display: none; max-height: 180px; overflow-y: auto;
}
.connector-filter-dropdown.show { display: block; }
.connector-checkboxes {
    padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.connector-checkbox {
    display: flex; align-items: center; font-size: 10px;
    cursor: pointer; user-select: none; padding: 4px 6px;
    border-radius: 4px; transition: background 0.2s;
}
.connector-checkbox:hover { background: #f3f4f6; }
.connector-checkbox input { margin-right: 4px; cursor: pointer; width: 12px; height: 12px; }
.connector-checkbox label {
    cursor: pointer; color: #4b5563; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.connector-checkbox.full-width { grid-column: 1 / -1; }
.connector-color-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; flex-shrink: 0; }

.chart-container { position: relative; }
.chart-legend {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid #e5e7eb; font-size: 10px;
}
.chart-legend-item { display: flex; align-items: center; gap: 4px; color: #4b5563; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-legend-power {
    width: 100%; font-weight: 600; color: #1f2937; font-size: 11px;
    margin-top: 4px; padding-top: 4px; border-top: 1px dashed #e5e7eb;
}
#utilizationChart { height: 150px !important; max-height: 150px !important; }