:root {
    /* --- VARIABLES DARK MODE (Default) --- */
    --bg-body: #121212;
    --bg-panel: rgba(30, 30, 30, 0.75);
    /* Translúcido */
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #ecf0f1;
    --text-muted: #95a5a6;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --active-bg: rgba(255, 255, 255, 0.15);

    --accent-red: #e74c3c;
    --accent-orange: #f39c12;
    --accent-green: #2ecc71;
}

/* --- VARIABLES LIGHT MODE --- */
[data-theme="light"] {
    --bg-body: #f5f6fa;
    --bg-panel: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --hover-bg: rgba(0, 0, 0, 0.05);
    --active-bg: rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

/* --- SIDEBAR --- */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    max-height: 90vh;
    z-index: 1000;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background 0.3s, border-color 0.3s;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Botón de Tema */
.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--hover-bg);
}

/* Indicadores y Etiquetas */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(231, 76, 60, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    100% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
    }
}

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

/* --- BOTONES DE FILTRO --- */
.filter-group {
    display: flex;
    gap: 10px;
}

.filter-tgl {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-tgl:hover {
    background: var(--border-color);
}

.filter-tgl.active {
    background: var(--active-bg);
    color: var(--text-main);
    border-color: var(--text-muted);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.red {
    background: var(--accent-red);
    box-shadow: 0 0 4px var(--accent-red);
}

.dot.green {
    background: var(--accent-green);
    box-shadow: 0 0 4px var(--accent-green);
}

/* --- TABLA --- */
.table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.minimal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.minimal-table th {
    text-align: left;
    padding-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.minimal-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.text-right {
    text-align: right;
}

.bold {
    font-weight: 600;
}

.red-text {
    color: var(--accent-red) !important;
}

.orange-text {
    color: var(--accent-orange) !important;
}

.green-text {
    color: var(--accent-green) !important;
}

.footer-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}