/* style.css - Diseño Premium y Responsive para la Plataforma de Arce Rojo */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Variables de Temas (Claro por defecto) */
    --bg-primary: #f5f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1a1d;
    --text-primary: #1e1f22;
    --text-secondary: #606266;
    --text-sidebar: #a0a5b0;
    --accent-red: #D32F2F; /* Rojo Arce Rojo */
    --accent-red-hover: #B71C1C;
    --accent-red-light: rgba(211, 47, 47, 0.1);
    --border-color: #e4e7ed;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    --transition-speed: 0.3s;
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
    /* Variables Tema Oscuro */
    --bg-primary: #0a0a0c;
    --bg-card: #141416;
    --bg-sidebar: #0e0e10;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-sidebar: #8892b0;
    --accent-red: #ef5350; /* Rojo más vibrante en fondo oscuro */
    --accent-red-hover: #f44336;
    --accent-red-light: rgba(239, 83, 80, 0.15);
    --border-color: #26262b;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(20, 20, 22, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Pantalla de Login */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-primary), rgba(211, 47, 47, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity var(--transition-speed) ease-in-out, transform var(--transition-speed) ease-in-out;
}

.login-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.app-container.hidden,
.update-banner.hidden,
.modal-overlay.hidden,
.auto-update-modal.hidden {
    display: none !important;
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background-color var(--transition-speed), border var(--transition-speed);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background-color: var(--accent-red);
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: var(--accent-red-light);
    color: var(--accent-red);
    border-radius: 16px;
    margin-bottom: 24px;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background-color: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px var(--accent-red-light);
}

/* Soporte completo de temas para listas desplegables (select y option) */
select.form-control,
select {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] select,
[data-theme="dark"] select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-theme="light"] select,
[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--accent-red);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: var(--accent-red-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.login-error {
    color: var(--accent-red);
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    display: none;
}

/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Barra Lateral Izquierda */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-b: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--accent-red);
    color: #ffffff;
    border-radius: 10px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    list-style: none;
}

/* Acordeón de Categorías del Menú */
.sidebar-category {
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
}

.category-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    text-align: left;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    border-radius: 10px;
}

.category-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title-wrapper i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.category-arrow {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-speed) ease;
}

/* Contenido de la Categoría (Colapsable) */
.category-content {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.2s ease;
}

.sidebar-category.expanded .category-content {
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.3s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.3s ease;
}

.sidebar-category.expanded .category-arrow {
    transform: rotate(180deg);
}

.sidebar-category.expanded .category-header {
    color: #ffffff;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.sidebar-item.active .sidebar-link {
    background-color: var(--accent-red);
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #607d8b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-sidebar);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contenido Principal */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* Barra Superior */
.topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color var(--transition-speed), border var(--transition-speed);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Verificador de Estado de BD */
.db-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: border var(--transition-speed), background var(--transition-speed);
}

.db-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #64748b; /* Desconectado por defecto */
}

.db-status.connected .db-status-dot {
    background-color: #10b981; /* Verde */
    box-shadow: 0 0 8px #10b981;
    animation: pulse 1.5s infinite;
}

.db-status.disconnected .db-status-dot {
    background-color: #ef4444; /* Rojo */
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed), border var(--transition-speed);
}

.topbar-btn:hover {
    background-color: var(--bg-primary);
}

/* Panel de Contenido */
.content-body {
    flex: 1;
    padding: 8px 32px 32px 32px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}

/* Alertas y Banners de Actualización */
.update-banner {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-hover));
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.2);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: slideDown 0.4s ease-out;
}

.update-banner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-banner-title {
    font-weight: 700;
    font-size: 15px;
}

.update-banner-desc {
    font-size: 13px;
    opacity: 0.9;
}

.btn-update {
    background-color: #ffffff;
    color: var(--accent-red);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-update:hover {
    background-color: #f5f5f5;
}

/* Sección de Cristal / Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    transition: background-color var(--transition-speed), border var(--transition-speed);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Pestañas de Vista */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 40px;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilo específico para Novedades */
.timeline {
    position: relative;
    padding-left: 32px;
    margin-top: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-red);
    border: 4px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-version {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-badge {
    background-color: var(--accent-red-light);
    color: var(--accent-red);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-content {
    font-size: 14px;
    line-height: 1.6;
}

.timeline-content ul {
    margin-left: 20px;
    margin-top: 8px;
}

/* Borradores de Formularios */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.draft-saved-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.draft-saved-indicator.show {
    opacity: 1;
}

/* Modal de Simulación */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-secondary {
    padding: 12px 24px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Notificación Flotante de Actualización Automática */
.auto-update-modal {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-red);
    box-shadow: 0 10px 30px var(--shadow-color);
    padding: 16px 20px;
    border-radius: 12px;
    z-index: 2000;
    width: 320px;
    font-family: var(--font-sans);
    animation: slideUp 0.3s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilo de Tablas de Datos Premium */
.table-container {
    width: 100%;
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    background-color: var(--bg-card);
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 14px 18px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: background-color 0.2s;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(211, 47, 47, 0.02);
    color: var(--text-primary);
}

/* Badge para campos nulos o vacíos */
.badge-null {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
}

/* Badge de Estado del Alumno */
.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}
.badge-status.activo {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.badge-status.inactivo {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Módulo de Dashboard */
.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.kpi-icon i {
    width: 24px;
    height: 24px;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Enlaces Standalone (Dashboard Directo) */
.sidebar-link-standalone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    margin-bottom: 12px;
}

.sidebar-link-standalone:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.sidebar-link-standalone.active {
    background-color: var(--accent-red);
    color: #ffffff;
}

.sidebar-link-standalone i {
    width: 18px;
    height: 18px;
}

/* Control de Acceso y Ocultación por Roles (Trabajador) */
body.role-trabajador .role-trabajador-hide {
    display: none !important;
}

/* Ocultación de botones de edición y eliminación para el rol Trabajador */
body.role-trabajador button[title*="Editar"],
body.role-trabajador button[title*="Eliminar"],
body.role-trabajador button[onclick*="Edit"],
body.role-trabajador button[onclick*="Delete"],
body.role-trabajador button[onclick*="Eliminar"] {
    display: none !important;
}

/* =============================================================================
   ESTILOS PREMIUM PARA LA SECCIÓN DE ANALÍTICA Y MONITOREO
   ============================================================================= */

/* Segmented Control / Alternador de Filtros */
.btn-group-filters {
    display: flex;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.btn-filter-toggle {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-filter-toggle:hover {
    color: var(--text-primary);
}

.btn-filter-toggle.active {
    background-color: var(--bg-card);
    color: var(--accent-red);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Lista de Ranking de Distritos */
.district-ranking-item {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.district-ranking-item:last-child {
    border-bottom: none;
}

.district-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.district-ranking-name {
    color: var(--text-primary);
}

.district-ranking-count {
    color: var(--accent-red);
    font-weight: 700;
}

.district-ranking-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.district-ranking-progress {
    height: 100%;
    background-color: var(--accent-red);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Personalización de Popups de Leaflet para Temas Claro y Oscuro */
.leaflet-popup-content-wrapper {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px var(--shadow-color) !important;
    font-family: var(--font-sans) !important;
}

.leaflet-popup-tip {
    background-color: var(--bg-card) !important;
    border-left: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-popup-content {
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin: 12px 16px !important;
}

.leaflet-container {
    background: var(--bg-primary) !important;
}

/* Gráficos de Canvas */
canvas {
    max-width: 100%;
}

/* Ajustes Responsive para la Grilla de Analítica */
@media (max-width: 1024px) {
    .analytics-row-map,
    .analytics-row-charts,
    .analytics-row-projects,
    .analytics-row-details {
        grid-template-columns: 1fr !important;
    }
}

