* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f1f5f9;
}

/* Split Screen Layout */
.dashboard-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 380px; /* Slightly wider to fit the chart nicely */
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    background-color: #0f172a;
    color: white;
    padding: 20px;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Sync Status Widget */
.sync-status-card {
    margin-top: 15px;
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 6px;
}
.sync-title { font-size: 0.75rem; color: #cbd5e1; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.sync-stats { font-size: 1.2rem; font-weight: bold; color: #fff; margin-bottom: 8px;}
.sync-progress { width: 100%; height: 6px; background: rgba(0,0,0,0.3); border-radius: 3px; overflow: hidden; margin-bottom: 5px;}
.sync-progress-bar { height: 100%; background: #3b82f6; transition: width 0.5s ease; }
.sync-time { font-size: 0.75rem; color: #94a3b8; }

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
}

.filter-section h3, .info-section h3, .chart-section h3 {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #475569;
    font-weight: 600;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}

.filter-group select:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
}

/* Toggle Group Styling */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
}
.toggle-control input {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #0284c7;
}

/* Chart Container */
.chart-section {
    margin-top: 25px;
}
.chart-container {
    height: 180px;
    width: 100%;
    position: relative;
}

/* Buttons */
button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0284c7;
    color: white;
}

.btn-primary:hover {
    background-color: #0369a1;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

/* Legend Styling */
.info-section {
    margin-top: 25px;
}

.legend-list {
    list-style: none;
    font-size: 0.9rem;
    color: #475569;
}

.legend-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.2);
}

.help-text {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 10px;
    font-style: italic;
}

/* Map Container */
.map-container {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
}

/* Loading Overlay */
#loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #0f172a;
    font-weight: bold;
}

#loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}