:root {
    --bg-dark: #07090e;
    --bg-card: rgba(15, 23, 42, 0.55);
    --border-color: rgba(255, 255, 255, 0.16);
    --border-glow: rgba(255, 255, 255, 0.28);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --purple-glow: rgba(139, 92, 246, 0.35);
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    --purple: #8b5cf6;
    --amber: #f59e0b;
    --cyan: #06b6d4;
    --indigo: #6366f1;
    --green: #22c55e;
    --danger: #ef4444;
    
    --panel-bg: rgba(15, 23, 42, 0.55);
    --panel-border: rgba(255, 255, 255, 0.16);
    --card-hover: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.16);
    --select-option-bg: #0f172a;
    --select-option-color: #f8fafc;

    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 26px;
    --radius-pill: 9999px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* TEMA CLARO (DIURNO) DE ALTO CONTRASTE Y CRISTAL ELEGANTE */
body.light-theme {
    --bg-dark: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(15, 23, 42, 0.12);
    --border-glow: rgba(99, 102, 241, 0.25);
    --text-main: #0f172a;
    --text-muted: #475569;
    
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(15, 23, 42, 0.14);
    --card-hover: rgba(99, 102, 241, 0.06);
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: rgba(15, 23, 42, 0.2);
    --select-option-bg: #ffffff;
    --select-option-color: #0f172a;
}

body.light-theme .hero-video-bg {
    opacity: 0.25;
    filter: contrast(0.9) brightness(1.2);
}

body.light-theme .video-gradient-overlay {
    background: radial-gradient(circle at center, rgba(240, 244, 248, 0.5) 0%, rgba(240, 244, 248, 0.92) 100%);
}

body.light-theme .glass-header,
body.light-theme .glass-panel,
body.light-theme .glass-panel-ultra,
body.light-theme .kpi-card,
body.light-theme .accordion-item,
body.light-theme .measure-card,
body.light-theme .download-item-card,
body.light-theme .final-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-theme .welcome-badge-glass,
body.light-theme .brand-badge,
body.light-theme .brand-badge-pill {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4f46e5;
}

body.light-theme .welcome-hero-title,
body.light-theme .brand h1,
body.light-theme .serif-title,
body.light-theme .section-title h2,
body.light-theme .group-header h2,
body.light-theme .card-header h3,
body.light-theme .kpi-value,
body.light-theme .accordion-title {
    color: #0f172a;
}

body.light-theme .clean-bullet-list li strong {
    color: #1e293b;
}

body.light-theme .clean-bullet-list {
    color: #334155;
}

body.light-theme .bullet-highlight {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: #6366f1;
}

body.light-theme .city-chip {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.12);
    color: #334155;
}

body.light-theme .city-chip.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
}

body.light-theme .data-table th {
    background: rgba(15, 23, 42, 0.05);
    color: #475569;
    border-bottom-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .data-table td {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    color: #1e293b;
}

body.light-theme .data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

body.light-theme .academic-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.1);
    color: #1e293b;
}

body.light-theme .academic-item strong {
    color: #0f172a;
}

body.light-theme .search-input,
body.light-theme .select-input,
body.light-theme .form-input-pill {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.2);
    color: #0f172a;
}

body.light-theme .activity-tab-btn {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(15, 23, 42, 0.12);
    color: #475569;
}

body.light-theme .activity-tab-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
}

body.light-theme .activity-tab-btn.active .tab-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

body.light-theme .modal-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

/* REGLAS EXHAUSTIVAS DE MODO CLARO (LIGHT-THEME) */
body.light-theme .master-accordion-header h3,
body.light-theme .card-header h3,
body.light-theme .sub-section-title h4,
body.light-theme .compare-header h4,
body.light-theme .measure-card-header h4,
body.light-theme .activity-hero-header h2,
body.light-theme .chip-info strong,
body.light-theme .metric-row strong,
body.light-theme .download-item-card strong,
body.light-theme .accordion-header,
body.light-theme .accordion-title {
    color: #0f172a !important;
}

body.light-theme .master-accordion-header p,
body.light-theme .activity-hero-header p,
body.light-theme .section-desc,
body.light-theme .chip-info small,
body.light-theme .metric-row span,
body.light-theme .compare-content p,
body.light-theme .compare-note,
body.light-theme .download-item-card small,
body.light-theme .accordion-body p,
body.light-theme .clean-bullet-list li,
body.light-theme .dataset-selector-label {
    color: #334155 !important;
}

body.light-theme .btn-act2-filter,
body.light-theme .btn-act1-filter,
body.light-theme .btn-tf-view,
body.light-theme .btn-table-view,
body.light-theme .btn-action-sm {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.2);
    color: #1e293b !important;
}

body.light-theme .btn-act2-filter:hover,
body.light-theme .btn-act1-filter:hover,
body.light-theme .btn-tf-view:hover,
body.light-theme .btn-table-view:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a !important;
}

body.light-theme .btn-act2-filter.active,
body.light-theme .btn-act1-filter.active,
body.light-theme .btn-tf-view.active,
body.light-theme .btn-table-view.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

body.light-theme .dataset-chip {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.15);
}
body.light-theme .dataset-chip.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.25) 100%);
    border-color: #059669;
}

body.light-theme .act2-nav-bar,
body.light-theme .act1-nav-bar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.light-theme .variability-compare-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.08));
    border-color: rgba(16, 185, 129, 0.4);
}

body.light-theme .accordion-body {
    background: rgba(241, 245, 249, 0.7);
    color: #1e293b;
}

/* RESET Y GLOBALES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.55;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.hidden {
    display: none !important;
}

/* CORRECCIÓN DE MENÚS DESPLEGABLES (SELECT & OPTION) PARA EVITAR PROBLEMAS DE CONTRASTE DEL NAVEGADOR */
select {
    background-color: var(--input-bg);
    color: var(--text-main);
}
select option {
    background-color: var(--select-option-bg);
    color: var(--select-option-color);
    padding: 8px 12px;
}

/* Background Ambient Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
}
.bg-glow-1 {
    top: -150px;
    left: -150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(0,0,0,0) 70%);
}
.bg-glow-2 {
    top: 300px;
    right: -150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(0,0,0,0) 70%);
}

/* VIDEO DE FONDO PERMANENTE */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: #000;
}

.hero-video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    filter: contrast(1.05) brightness(0.88);
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.video-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(7, 9, 14, 0.35) 0%, rgba(7, 9, 14, 0.85) 100%);
    pointer-events: none;
    transition: background 0.4s ease;
}

/* ========================================================================= */
/* 1. PANTALLA DE BIENVENIDA (PORTADA REFINADA) */
/* ========================================================================= */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 40px 24px;
    overflow: hidden;
}

.welcome-content-minimal {
    max-width: 680px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 26px;
    z-index: 10;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.welcome-badge-glass {
    padding: 8px 24px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #e2e8f0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.welcome-hero-title {
    font-family: var(--font-serif);
    font-size: 5.5rem;
    font-weight: 400;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 6px 40px rgba(0,0,0,0.9);
}

.title-purple-glow {
    font-style: italic;
    background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 40%, #a855f7 80%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 0 25px rgba(192, 132, 252, 0.45));
}

.welcome-actions { 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    margin-top: 10px; 
}

.glass-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 46px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.glass-pill-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 20px 55px rgba(168, 85, 247, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.pill-arrow { font-size: 1.3rem; transition: transform 0.25s ease; }
.glass-pill-btn:hover .pill-arrow { transform: translateX(8px); }

.welcome-footer-subtle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.welcome-footer-subtle strong {
    color: #ffffff;
}

/* ========================================================================= */
/* 2. PANTALLA DE LOGIN CON VISOR DE CONTRASEÑA (OJITO) */
/* ========================================================================= */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    background: rgba(7, 9, 14, 0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.glass-panel-ultra {
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.login-card-futuristic {
    width: 100%;
    max-width: 460px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.login-header { text-align: center; }
.brand-badge-pill {
    display: inline-block;
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.serif-title {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 400;
    line-height: 1.1;
    color: #fff;
}
.login-subtext {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.role-quick-selector { display: flex; flex-direction: column; gap: 8px; }
.selector-title { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.role-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-role-glass {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.btn-role-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}
.btn-role-glass.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}
.role-icon { font-size: 1.2rem; }
.role-info strong { display: block; font-size: 0.88rem; }
.role-info small { font-size: 0.72rem; color: var(--text-muted); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.form-input-pill {
    width: 100%;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.form-input-pill:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #8b5cf6;
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

/* WRAPPER DEL CAMPO DE CONTRASEÑA CON BOTÓN DE OJITO */
.password-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
.password-input-wrapper .password-field {
    padding-right: 52px;
}
.btn-eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    color: var(--text-muted);
}
.btn-eye-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-50%) scale(1.1);
}
.eye-symbol {
    font-size: 1.15rem;
    user-select: none;
}

.login-error { color: var(--danger); font-size: 0.85rem; text-align: center; }

.btn-pill-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 26px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
}
.btn-pill-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.65);
}

/* ========================================================================= */
/* BOTONES GLOBALES & ACCIONES */
/* ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.86rem;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    backdrop-filter: blur(16px);
}
.btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
}
.btn-primary { background: rgba(59, 130, 246, 0.85); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-primary:hover { background: #3b82f6; transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); }
.btn-emerald { background: rgba(16, 185, 129, 0.85); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-emerald:hover { background: #10b981; transform: translateY(-2px); box-shadow: 0 8px 24px var(--emerald-glow); }
.btn-indigo { background: rgba(99, 102, 241, 0.85); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-indigo:hover { background: #6366f1; transform: translateY(-2px); }
.btn-green { background: rgba(34, 197, 94, 0.85); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-green:hover { background: #22c55e; transform: translateY(-2px); }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-icon { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius-pill); padding: 8px 12px; cursor: pointer; color: var(--text-main); }

/* BOTÓN SELECTOR DE MODO DIURNO / NOCTURNO */
.btn-theme-pill {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
}
.btn-theme-pill:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.35);
}
.theme-icon { font-size: 1.1rem; }

/* ========================================================================= */
/* 3. DASHBOARD MAIN LAYOUT & HEADER */
/* ========================================================================= */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.8s ease;
}

.glass-header {
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.brand-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.brand-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.1;
    color: #ffffff;
}
.subtitle { font-size: 0.86rem; color: var(--text-muted); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
    transition: all 0.3s ease;
}
.user-avatar { font-size: 1.1rem; }
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.83rem; font-weight: 700; }
.user-role-label { font-size: 0.65rem; color: var(--text-muted); }

.user-badge.gerencia-vip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
    border: 1px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}
.user-badge.gerencia-vip .user-name { color: #FCD34D; }
.user-badge.gerencia-vip .user-role-label { color: #FBBF24; font-weight: 600; }

.academic-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.academic-item .label { color: var(--text-muted); margin-right: 4px; }
.divider { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.15); }

/* BANNER DE RESUMEN EJECUTIVO */
.exec-summary-banner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.9));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}
.exec-summary-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, #F59E0B, #D97706);
}
.exec-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}
.exec-summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #FCD34D;
}
.exec-summary-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-weight: 600;
}
.exec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.exec-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.exec-item-icon { font-size: 1.2rem; }
.exec-item-text strong { display: block; font-size: 0.82rem; color: #F3F4F6; margin-bottom: 2px; }
.exec-item-text span { font-size: 0.76rem; color: #9CA3AF; line-height: 1.3; }

.status-banner {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    backdrop-filter: blur(16px);
}
.status-info { background: rgba(59, 130, 246, 0.2); border: 1px solid var(--primary); color: #93c5fd; }
.status-success { background: rgba(16, 185, 129, 0.2); border: 1px solid var(--emerald); color: #6ee7b7; }
.status-error { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--danger); color: #fca5a5; }

/* ========================================================================= */
/* 4. BARRA DE NAVEGACIÓN DE LAS 4 GRANDES PESTAÑAS */
/* ========================================================================= */
.activities-nav-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 4px 0 10px 0;
}
@media (max-width: 900px) {
    .activities-nav-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .activities-nav-container { grid-template-columns: 1fr; }
}

.activity-tab-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.activity-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}
.activity-tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(139, 92, 246, 0.4) 100%);
    border-color: #8b5cf6;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab-step-badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a5b4fc;
}
.activity-tab-btn.active .tab-step-badge {
    background: #8b5cf6;
    color: #ffffff;
}

.tab-text-wrap { display: flex; flex-direction: column; }
.tab-main-title { font-size: 1rem; font-weight: 800; }
.tab-subtitle { font-size: 0.75rem; color: var(--text-muted); }

/* CONTENIDO DE PESTAÑAS */
.tab-content {
    display: flex;
    flex-direction: column;
    gap: 26px;
    animation: fadeIn 0.4s ease;
}

/* ========================================================================= */
/* 5. SELECTOR DE MUNICIPIOS & KPIS */
/* ========================================================================= */
.controls-section { display: flex; flex-direction: column; gap: 12px; }
.section-title h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    color: #fff;
}
.section-title p { font-size: 0.85rem; color: var(--text-muted); }

.city-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.city-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
}
.city-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}
.city-chip.active {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.city-flag { font-size: 1.1rem; }

/* KPIS DE CRISTAL */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.kpi-card {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: var(--transition);
}
.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 45px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
}
.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.icon-blue { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.3); }
.icon-purple { background: rgba(139, 92, 246, 0.2); border: 1px solid rgba(139, 92, 246, 0.3); }
.icon-emerald { background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.2); border: 1px solid rgba(245, 158, 11, 0.3); }

.kpi-content { display: flex; flex-direction: column; }
.kpi-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 400;
    line-height: 1;
    margin: 4px 0 2px 0;
    color: #ffffff;
}
.kpi-sub { font-size: 0.72rem; color: var(--text-muted); }

/* ========================================================================= */
/* 6. ACORDEONES INTERACTIVOS PARA PREGUNTAS Y CONCLUSIONES */
/* ========================================================================= */
.accordion-panel-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.section-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}
.accordion-item:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}
.accordion-item.open {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
}

.accordion-badge {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-blue { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.35); color: #60a5fa; }
.badge-purple { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.35); color: #c084fc; }
.badge-green { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }

.accordion-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: #fff;
    flex: 1;
}

.accordion-toggle-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.accordion-item.open .accordion-toggle-icon {
    transform: rotate(180deg);
    color: #a5b4fc;
}

.accordion-body {
    padding: 0 20px 18px 20px;
    border-top: 1px solid transparent;
    display: none;
    animation: fadeIn 0.3s ease;
}
.accordion-item.open .accordion-body {
    display: block;
    border-top-color: rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

/* LISTAS LIMPIAS EN PUNTOS */
.clean-bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    color: #cbd5e1;
}
.clean-bullet-list li {
    position: relative;
    padding-left: 18px;
    line-height: 1.5;
}
.clean-bullet-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #a5b4fc;
    font-size: 1.1rem;
    top: -2px;
}
.clean-bullet-list li strong {
    color: #ffffff;
    font-weight: 700;
}
.bullet-highlight {
    background: rgba(99, 102, 241, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #8b5cf6;
    margin-top: 4px;
}

/* ========================================================================= */
/* 7. GRÁFICOS Y BOTONES DE DESCARGA */
/* ========================================================================= */
.charts-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.group-header h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    color: #fff;
}
.group-header p { font-size: 0.85rem; color: var(--text-muted); }

.complementary-group {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.glass-panel {
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.primary-chart {
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}
@media (max-width: 768px) {
    .charts-section { grid-template-columns: 1fr; }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
}

.chart-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action-sm {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-action-sm:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}
.btn-chart-excel:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #6ee7b7;
}

.badge { padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); font-size: 0.72rem; color: var(--text-muted); }
.badge-primary { padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(59, 130, 246, 0.25); border: 1px solid rgba(59, 130, 246, 0.4); color: #60a5fa; font-size: 0.72rem; font-weight: 700; }
.badge-accent { padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(139, 92, 246, 0.25); border: 1px solid rgba(139, 92, 246, 0.4); color: #c084fc; font-size: 0.72rem; font-weight: 600; }
.badge-brand { padding: 3px 8px; border-radius: var(--radius-pill); background: rgba(139, 92, 246, 0.2); color: #c084fc; font-size: 0.72rem; font-weight: 600; }
.badge-green { padding: 3px 8px; border-radius: var(--radius-pill); background: rgba(16, 185, 129, 0.2); color: #34d399; font-size: 0.72rem; font-weight: 600; }
.badge-red { padding: 3px 8px; border-radius: var(--radius-pill); background: rgba(239, 68, 68, 0.2); color: #fca5a5; font-size: 0.72rem; font-weight: 600; }

.chart-container {
    position: relative;
    height: 290px;
    width: 100%;
}

.db-icon-3d {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-right: 8px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.db-select-btn:hover .db-icon-3d {
    transform: scale(1.1);
}

.sb-icon-3d {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 8px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-item:hover .sb-icon-3d {
    transform: scale(1.15);
}

/* ========================================================================= */
/* 8. TABLAS DE DATOS */
/* ========================================================================= */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    text-align: left;
}
.data-table th {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}
.table-foot-totals {
    font-weight: 800;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.filter-controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-input, .select-input {
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}
.search-input:focus, .select-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* ========================================================================= */
/* 9. ESTILOS ACTIVIDAD 2 & ACTIVIDAD 3 */
/* ========================================================================= */
.activity-hero-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.activity-badge-pill {
    align-self: flex-start;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c084fc;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.activity-hero-header h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    color: #fff;
}
.activity-hero-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 4px;
}

.variable-selector-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.var-label { font-size: 0.85rem; color: var(--text-main); }
.select-variable-act2 { min-width: 320px; }

.measures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}
.measure-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.measure-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}
.measure-icon { font-size: 1.3rem; }
.measure-card-header h4 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 400;
}
.measure-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.metric-row.highlight-row {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
}
.metric-row span { color: var(--text-muted); }
.metric-row strong { color: var(--text-main); font-weight: 700; }

/* SIMULADOR PREDICTIVO */
.simulator-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.simulator-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .simulator-grid { grid-template-columns: 1fr; }
}

.simulator-input-card, .simulator-output-card {
    padding: 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sim-label { font-size: 0.85rem; color: var(--text-main); }
.sim-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sim-slider {
    flex: 1;
    accent-color: #8b5cf6;
    height: 6px;
    cursor: pointer;
}
.sim-number-input {
    width: 100px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-weight: 700;
    text-align: center;
}
.sim-help { font-size: 0.75rem; color: var(--text-muted); }

.simulator-output-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.35);
    justify-content: center;
    align-items: center;
    text-align: center;
}
.sim-output-badge {
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.3);
    color: #c084fc;
    font-weight: 700;
    text-transform: uppercase;
}
.sim-output-value {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 400;
    color: #ffffff;
    line-height: 1;
}
.sim-output-formula { font-size: 0.8rem; color: var(--text-muted); }
.sim-output-formula code { background: rgba(0, 0, 0, 0.3); padding: 2px 6px; border-radius: 4px; color: #a5b4fc; }
.sim-interval { font-size: 0.78rem; color: var(--text-muted); }

/* ========================================================================= */
/* 10. ACTIVIDAD 4 (ENTREGA FINAL) */
/* ========================================================================= */
.final-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.final-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.final-card-icon { font-size: 1.8rem; }
.final-card h4 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: #ffffff;
}
.final-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.downloads-center-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.download-item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition);
}
.download-item-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.dl-icon { font-size: 1.6rem; }
.dl-info strong { display: block; font-size: 0.9rem; color: #fff; }
.dl-info small { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; display: block; margin-top: 2px; }

/* ESTILOS PARA ESTADOS DE PESTAÑAS Y MÓDULOS BLOQUEADOS */
.badge-active-next {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

.badge-locked {
    background: rgba(239, 68, 68, 0.18) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}

.activity-tab-btn.tab-locked {
    opacity: 0.72;
}
.activity-tab-btn.tab-locked:hover {
    opacity: 1;
}

/* PLACEHOLDER ELEGANTE ACTIVIDAD 2 */
.activity-ready-placeholder {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.12));
    border: 1px dashed rgba(99, 102, 241, 0.35);
}
.ready-icon-pulse {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.ready-info-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ready-info-box h3 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: #fff;
}
.ready-info-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.ready-tags-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.ready-tag {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.76rem;
    font-weight: 700;
    color: #a5b4fc;
}

/* TARJETA DE MÓDULO BLOQUEADO */
.locked-module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 50px 30px;
    gap: 18px;
    max-width: 780px;
    margin: 20px auto;
}
.locked-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.25);
}
.locked-glow-icon {
    font-size: 2.4rem;
}
.locked-badge {
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.locked-module-card h2 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    color: #ffffff;
}
.locked-module-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 580px;
    line-height: 1.6;
}
.locked-steps-indicator {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}
.step-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
}
.step-pill.completed {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--emerald);
    color: #6ee7b7;
}
.step-pill.in-progress {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--indigo);
    color: #a5b4fc;
}
.step-pill.locked {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}

/* ========================================================================= */
/* BARRA DE NAVEGACIÓN Y ACORDEONES MAESTROS DE ACTIVIDAD 1 */
/* ========================================================================= */
.act1-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 14px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(99, 102, 241, 0.3);
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.act1-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.act1-nav-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.act1-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-act1-filter {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-act1-filter:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}
.btn-act1-filter.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.act1-nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ACORDEÓN MAESTRO PARA ACTIVIDAD 1 */
.master-accordion-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.master-accordion-section:hover {
    border-color: rgba(255, 255, 255, 0.28);
}
.master-accordion-section.open {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.master-accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}
.master-accordion-header:hover {
    background: rgba(255, 255, 255, 0.07);
}
.master-accordion-section.open .master-accordion-header {
    background: rgba(99, 102, 241, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.master-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.master-section-icon {
    font-size: 1.6rem;
}
.master-header-info h3 {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 400;
    color: #ffffff;
}

.master-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.master-toggle-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.master-accordion-section.open .master-toggle-arrow {
    transform: rotate(180deg);
    color: #a5b4fc;
}

.master-accordion-body {
    padding: 24px;
    display: none;
    animation: fadeIn 0.35s ease;
}
.master-accordion-section.open .master-accordion-body {
    display: block;
}

/* BOTONES SELECTORES DE VISTA DE TABLAS */
.tables-view-selector-bar {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tables-view-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.btn-table-view {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-table-view:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}
.btn-table-view.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.sub-section-title {
    margin-bottom: 14px;
}
.sub-section-title h4 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: #a5b4fc;
}

/* SELECTOR DE DATASET INTERACTIVO EN ACTIVIDAD 2 */
.dataset-selector-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.dataset-selector-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dataset-selector-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.dataset-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.dataset-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.dataset-chip.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%);
    border-color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.chip-icon { font-size: 1.4rem; }
.chip-info strong { display: block; font-size: 0.82rem; color: #fff; }
.chip-info small { font-size: 0.72rem; color: var(--text-muted); }

/* BARRA DE NAVEGACIÓN ACTIVIDAD 2 */
.act2-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 14px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(16, 185, 129, 0.3);
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.act2-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.act2-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-act2-filter, .btn-tf-view {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-act2-filter:hover, .btn-tf-view:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}
.btn-act2-filter.active, .btn-tf-view.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

/* CUADRO DE COMPARACIÓN DE VARIABILIDAD */
.variability-compare-box {
    padding: 18px 22px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.12));
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.compare-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.compare-icon { font-size: 1.3rem; }
.compare-header h4 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: #34d399;
}
.compare-content p {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.5;
}
.compare-note {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* MODAL DE CRISTAL GOOGLE SHEETS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 20px;
    background: rgba(7, 9, 14, 0.7);
    backdrop-filter: blur(24px);
}
.modal-card {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
}
.modal-body { display: flex; flex-direction: column; gap: 16px; font-size: 0.88rem; }
.modal-options { display: flex; flex-direction: column; gap: 12px; }

.option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
}
.opt-icon { font-size: 1.6rem; }
.opt-text { display: flex; flex-direction: column; flex: 1; }
.opt-text strong { font-size: 0.9rem; }
.opt-text small { font-size: 0.78rem; color: var(--text-muted); }

.modal-alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}
.modal-alert-success { background: rgba(16, 185, 129, 0.2); border: 1px solid var(--emerald); color: #6ee7b7; }
.modal-alert-error { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--danger); color: #fca5a5; }

.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ========================================================================= */
/* ESTILOS BENTO-GRID: EXPLORADOR POR VARIABLE (ACTIVIDAD 2)                 */
/* ========================================================================= */
.var-selector-container {
    margin-bottom: 24px;
}
.var-selector-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.var-pill-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.var-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}
.var-pill-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: #818cf8;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}
.var-pill-icon {
    font-size: 1.8rem;
}
.var-pill-text {
    display: flex;
    flex-direction: column;
}
.var-pill-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}
.var-pill-text small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.bento-variable-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
    animation: fadeIn 0.35s ease;
}
.bento-top-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}
@media (max-width: 1024px) {
    .bento-top-row {
        grid-template-columns: 1fr;
    }
}
.bento-table-card,
.bento-chart-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.bento-measures-card {
    padding: 20px 24px;
}
.kpi-six-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.kpi-mini-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s;
}
.kpi-mini-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}
.kpi-mini-card .kpi-mini-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-mini-card .kpi-mini-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}
.kpi-mini-card .kpi-mini-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}
body.light-theme .kpi-mini-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.12);
}
body.light-theme .kpi-mini-card .kpi-mini-val {
    color: #0f172a;
}
body.light-theme .var-pill-btn {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.12);
    color: #1e293b;
}
body.light-theme .var-pill-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: #6366f1;
    color: #0f172a;
}

/* ========================================================================= */
/* BARRA SUPERIOR MINIMALISTA ESTILO TESLA                                   */
/* ========================================================================= */
.tesla-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    margin-bottom: 24px;
    background: rgba(10, 12, 16, 0.82);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    position: sticky;
    top: 14px;
    z-index: 100;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}
.tesla-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    letter-spacing: 1.2px;
    font-weight: 700;
}
.brand-logo-text {
    color: var(--text-main);
}
.brand-divider {
    color: var(--text-muted);
    opacity: 0.5;
}
.brand-subject {
    color: #a5b4fc;
}

.tesla-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tesla-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tesla-nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}
.tesla-nav-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.tesla-nav-btn.is-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.tesla-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tesla-icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}
.tesla-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}
.user-pill-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
}
.user-avatar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}
.tesla-logout-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.tesla-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}

/* ========================================================================= */
/* HUB DE INICIO (ESTILO TESLA CARDS)                                        */
/* ========================================================================= */
.tesla-hub-hero {
    padding: 36px 40px;
    margin-bottom: 28px;
    border-radius: var(--radius-lg);
}
.hub-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.hub-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 10px;
}
.hub-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.6;
    margin-bottom: 18px;
}
.hub-team-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.strip-divider {
    opacity: 0.4;
}

.tesla-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.tesla-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.tesla-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}
.tesla-card.card-highlight {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 27, 75, 0.35) 100%);
}
.tesla-card.card-highlight:hover {
    border-color: #818cf8;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
}
.tesla-card.card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-status-pill {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.status-done {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}
.status-current {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.status-locked {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}
.card-icon-big {
    font-size: 1.8rem;
}
.card-body-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}
.card-body-content p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}
.card-footer-action {
    display: flex;
    align-items: center;
}
.action-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #93c5fd;
    transition: transform 0.2s;
}
.tesla-card:hover .action-link {
    transform: translateX(4px);
}
.action-link.highlight-text {
    color: #a5b4fc;
}

/* ========================================================================= */
/* SUB-PÁGINAS Y NAVEGACIÓN DEDICADA DE ACTIVIDADES                          */
/* ========================================================================= */
.subpage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
}
.subpage-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--text-muted);
}
.subpage-header h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-main);
}
.subpage-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.subpage-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.act2-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 22px;
    border-radius: var(--radius-pill);
}
.act2-subnav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
}
.act2-subnav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}
.act2-subnav-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.view-switch-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.switch-pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}
.switch-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
.switch-pill-btn.active {
    background: #4f46e5;
    border-color: #6366f1;
    color: #ffffff;
}

.page-view {
    animation: fadeIn 0.35s ease;
}
.subtab-view {
    animation: fadeIn 0.35s ease;
}

/* TEMA CLARO PARA BARRA TESLA */
body.light-theme .tesla-navbar {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}
body.light-theme .brand-logo-text { color: #0f172a; }
body.light-theme .brand-subject { color: #4f46e5; }
body.light-theme .tesla-nav-btn { color: #475569; }
body.light-theme .tesla-nav-btn:hover { background: rgba(15, 23, 42, 0.05); color: #0f172a; }
body.light-theme .tesla-nav-btn.active {
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.3);
}
body.light-theme .tesla-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.1);
}
body.light-theme .tesla-card.card-highlight {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 242, 255, 0.9) 100%);
    border-color: rgba(99, 102, 241, 0.35);
}
body.light-theme .card-body-content h3 { color: #0f172a; }
body.light-theme .card-body-content p { color: #475569; }
body.light-theme .hub-title { color: #0f172a; }
body.light-theme .hub-subtitle { color: #475569; }
body.light-theme .act2-subnav { background: rgba(255, 255, 255, 0.9); border-color: rgba(15, 23, 42, 0.1); }
body.light-theme .act2-subnav-btn { color: #475569; }
body.light-theme .act2-subnav-btn:hover { background: rgba(15, 23, 42, 0.06); color: #0f172a; }
body.light-theme .act2-subnav-btn.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}
/* ========================================================================= */
/* LAYOUT PRINCIPAL CON MENÚ LATERAL (SIDEBAR)                              */
/* ========================================================================= */
.app-main-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
    margin-top: 18px;
}

.app-sidebar {
    width: 280px;
    min-width: 280px;
    padding: 18px 14px;
    border-radius: var(--radius-lg);
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(20px);
    z-index: 40;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a5b4fc;
}

.sidebar-menu-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-group-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    padding: 4px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    transform: translateX(3px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.22) 0%, rgba(124, 58, 237, 0.22) 100%);
    border-color: rgba(99, 102, 241, 0.45);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-item .sb-icon {
    font-size: 1.05rem;
}

.app-content-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 960px) {
    .app-main-layout {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
    }
}

/* TEMA CLARO PARA SIDEBAR */
body.light-theme .app-sidebar {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
body.light-theme .sidebar-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
body.light-theme .sidebar-title {
    color: #4f46e5;
}
body.light-theme .sidebar-group-label {
    color: #64748b;
}
body.light-theme .sidebar-item {
    color: #475569;
}
body.light-theme .sidebar-item:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}
/* =========================================================
   LIQUID GLASS (AGUA TRANSPARENTE / GLASSMORPHISM PREMIUM)
   ========================================================= */
.liquid-glass-card {
    background: radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 12px 36px rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.liquid-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(60deg, transparent 30%, rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 55%, transparent 70%);
    pointer-events: none;
    transform: rotate(-10deg);
}

.liquid-glass-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 16px 48px rgba(79, 70, 229, 0.2);
    transform: translateY(-2px);
}

/* Caja de Parámetros de Sturges (Estilo Hoja de Clase) */
.sturges-summary-box {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
}

.sturges-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sturges-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sturges-item span {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sturges-item strong {
    font-size: 0.95rem;
    color: #818cf8;
    font-weight: 700;
}

/* Tema Claro para Liquid Glass */
body.light-theme .liquid-glass-card {
    background: radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.85) 100%);
    border-color: rgba(203, 213, 225, 0.8);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(0, 0, 0, 0.06);
}

body.light-theme .sturges-summary-box {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.2);
}

body.light-theme .sturges-item {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.6);
}

body.light-theme .sturges-item strong {
    color: #4f46e5;
}

/* =========================================================
   BLOQUES DE CRISTAL 3D FLIP CARDS (GLASSMORPHISM PREMIUM)
   ========================================================= */
.glass-flip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 20px;
    perspective: 1200px;
}

.glass-flip-card {
    background: transparent;
    min-height: 250px;
    cursor: pointer;
    perspective: 1200px;
}

.glass-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    border-radius: 20px;
}

.glass-flip-card:hover .glass-card-inner {
    box-shadow: 0 16px 40px rgba(56, 189, 248, 0.25), 0 0 25px rgba(255, 255, 255, 0.12);
}

.glass-flip-card.flipped .glass-card-inner {
    transform: rotateY(180deg);
}

.glass-card-front,
.glass-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.glass-card-front {
    background: radial-gradient(135% 135% at 10% 10%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 12px 36px rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.glass-card-front .glass-card-title {
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.45;
    margin-top: 12px;
    color: #f8fafc;
}

.glass-card-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.84rem;
    color: #38bdf8;
    font-weight: 500;
}

.glass-card-hint .flip-icon {
    font-size: 1.1rem;
    animation: rotatePulse 3s infinite linear;
}

@keyframes rotatePulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

.glass-card-back {
    background: radial-gradient(135% 135% at 90% 90%, rgba(56, 189, 248, 0.12) 0%, rgba(15, 23, 42, 0.92) 100%);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
    transform: rotateY(180deg);
    box-shadow: inset 0 1px 2px rgba(56, 189, 248, 0.4), 0 16px 48px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.glass-card-content {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #f1f5f9;
}

.glass-card-content p {
    margin-bottom: 8px;
}

.glass-card-hint-back {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: right;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* TEMA CLARO PARA GLASS FLIP CARDS */
body.light-theme .glass-card-front {
    background: radial-gradient(135% 135% at 10% 10%, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.88) 100%);
    border-color: rgba(203, 213, 225, 0.9);
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 1), 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.light-theme .glass-card-front .glass-card-title {
    color: #1e293b;
}

body.light-theme .glass-card-back {
    background: radial-gradient(135% 135% at 90% 90%, rgba(238, 242, 255, 0.98) 0%, rgba(224, 231, 255, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #1e293b;
}

body.light-theme .glass-card-content {
    color: #334155;
}

/* =========================================================
   ESTILO LIQUID PARA GRÁFICOS Y CONTENEDORES
   ========================================================= */
.liquid-chart-container {
    background: radial-gradient(130% 130% at 50% 0%, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.45) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 12px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.35s ease;
}

.liquid-chart-container:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 16px 40px rgba(14, 165, 233, 0.2);
}

/* =========================================================
   SUBMENU DE SELECCIÓN DE BASE DE DATOS EN SIDEBAR
   ========================================================= */
.db-selector-subgroup {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.db-select-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
}

.db-select-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    color: #ffffff;
    transform: translateX(3px);
}

.db-select-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.28));
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.db-select-btn .db-icon {
    font-size: 1.1rem;
}

.db-select-btn .db-text small {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

body.light-theme .db-select-btn {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.8);
    color: #334155;
}

body.light-theme .db-select-btn:hover {
    background: rgba(224, 242, 254, 0.9);
    border-color: rgba(56, 189, 248, 0.4);
    color: #0369a1;
}

body.light-theme .db-select-btn.active {
    background: linear-gradient(135deg, #e0f2fe, #e0e7ff);
    border-color: #0284c7;
    color: #0369a1;
}

/* ESTILOS ACTIVIDAD 3: REGRESIÓN Y CORRELACIÓN */
.db-act3-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94A3B8;
    transition: all 0.25s ease;
}
.db-act3-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60A5FA;
}
.db-act3-btn.active {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    border-color: #3B82F6;
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.act3-subtab-btn {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    transition: all 0.25s ease;
}
.act3-subtab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
}
.act3-subtab-btn.active {
    background: rgba(37, 99, 235, 0.25);
    border-color: #3B82F6;
    color: #60A5FA;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.25);
}



