/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utilidad universal para ocultar elementos */
.hidden {
    display: none !important;
}

:root {
    /* Neon Blue Theme - Dark Mode */
    --bg-dark: #0a0e1a;
    --bg-dark-secondary: #0f1525;
    --bg-glass: rgba(15, 25, 45, 0.75);
    --bg-glass-hover: rgba(20, 35, 60, 0.85);

    /* Neon Colors */
    --neon-blue: #00d4ff;
    --neon-cyan: #00ffff;
    --neon-electric: #0099ff;
    --neon-glow: rgba(0, 212, 255, 0.6);

    /* Success Green */
    --success-green: #00ff88;
    --success-green-glow: rgba(0, 255, 136, 0.5);

    /* Text Colors */
    --text-white: #ffffff;
    --text-light-blue: #a0c4ff;
    --text-gray: #6b7d99;

    /* Border and Glow */
    --border-neon: 1px solid rgba(0, 212, 255, 0.5);
    --border-neon-active: 1px solid rgba(0, 212, 255, 0.9);
    --shadow-neon: 0 0 15px rgba(0, 212, 255, 0.3);
    --shadow-neon-strong: 0 0 25px rgba(0, 212, 255, 0.5);

    /* Sizes */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-xxs: 6px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #050810 0%, #0a0e1a 50%, #0f1525 100%);
    min-height: 100vh;
    color: var(--text-white);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 153, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   PANTALLA DE INICIO
   ============================================ */
.home-container {
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-neon-active);
    box-shadow: var(--shadow-neon-strong);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-logo {
    margin-bottom: 30px;
}

.logo-large {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: bold;
    font-size: 48px;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 60px rgba(0, 212, 255, 0.8);
    }
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 22px;
    font-weight: 500;
    color: var(--neon-cyan);
    margin-bottom: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.hero-description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light-blue);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Identity Badges */
.identity-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.identity-badge {
    background: rgba(10, 20, 35, 0.6);
    border: var(--border-neon);
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.identity-badge:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow: var(--shadow-neon);
}

.badge-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.badge-icon.gold {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.badge-icon.blue {
    background: rgba(0, 212, 255, 0.2);
    color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.badge-icon.purple {
    background: rgba(156, 89, 182, 0.2);
    color: #9b59b6;
    box-shadow: 0 0 15px rgba(156, 89, 182, 0.4);
}

.badge-icon.green {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.badge-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.badge-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1;
}

.badge-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* Home Main Layout */
.home-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    position: relative;
    z-index: 2;
}

/* Section Headers */
.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.section-title i {
    color: var(--neon-blue);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-gray);
}

/* Courses Section */
.courses-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-neon-active);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-neon);
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.course-item {
    background: rgba(10, 20, 35, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.course-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--neon-cyan);
    transform: translateX(8px);
    box-shadow: var(--shadow-neon);
}

.course-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.course-item-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.course-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
}

.course-item-badges {
    display: flex;
    gap: 8px;
}

.course-badge {
    padding: 5px 12px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--neon-cyan);
    font-weight: 600;
}

.course-arrow {
    color: var(--neon-cyan);
    font-size: 18px;
    transition: transform 0.3s;
}

.course-item:hover .course-arrow {
    transform: translateX(5px);
}

.courses-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.courses-loading .spinner {
    margin-bottom: 16px;
}

/* Calendar Section */
.calendar-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-neon-active);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-neon);
}

.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(10, 20, 35, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-sm);
}

.calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border: var(--border-neon);
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--neon-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.calendar-nav-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: var(--shadow-neon);
}

.calendar-current-month {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    min-width: 200px;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.calendar-today-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.calendar-today-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

/* Calendar Grid */
.calendar-grid {
    background: rgba(10, 20, 35, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-white);
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.calendar-day:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--neon-cyan);
}

.calendar-day.today {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    font-weight: 700;
}

.calendar-day.other-month {
    color: var(--text-gray);
    opacity: 0.5;
}

.calendar-day.selected {
    background: rgba(0, 212, 255, 0.3);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.6);
}

.calendar-day.holiday {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.4);
}

.calendar-day.holiday:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* Festivos Nacionales - Dorado */
.calendar-day.national {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.calendar-day.national:hover {
    background: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Festivos de Reus - Morado/Granate */
.calendar-day.reus {
    background: rgba(156, 89, 182, 0.2);
    border-color: rgba(156, 89, 182, 0.6);
    box-shadow: 0 0 12px rgba(156, 89, 182, 0.3);
}

.calendar-day.reus:hover {
    background: rgba(156, 89, 182, 0.35);
    box-shadow: 0 0 18px rgba(156, 89, 182, 0.5);
}

/* Events Panel */
.calendar-events-panel {
    background: rgba(10, 20, 35, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
}

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

.events-panel-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.events-panel-header h4 i {
    color: var(--neon-blue);
}

.btn-add-event {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.btn-add-event:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.events-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.events-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
    color: var(--neon-cyan);
}

.events-empty p {
    font-size: 14px;
}

.event-item {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-xs);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s;
}

.event-item:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateX(5px);
}

.event-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.event-item-icon.exam {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.event-item-icon.practice {
    background: rgba(0, 212, 255, 0.2);
    color: var(--neon-blue);
}

.event-item-icon.meeting {
    background: rgba(102, 204, 255, 0.2);
    color: #66ccff;
}

.event-item-icon.holiday {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-green);
}

/* Festivos Nacionales - Dorado */
.event-item-icon.national {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Festivos de Reus - Morado/Violeta */
.event-item-icon.reus {
    background: rgba(156, 89, 182, 0.25);
    color: #9b59b6;
    box-shadow: 0 0 15px rgba(156, 89, 182, 0.5);
}

.event-item-icon.other {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light-blue);
}

.event-item-content {
    flex: 1;
    min-width: 0;
}

.event-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 4px;
}

.event-item-description {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 6px;
}

.event-item-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
}

.event-item-course {
    color: var(--neon-cyan);
}

.event-item-time {
    color: var(--text-gray);
}

.event-item-actions {
    display: flex;
    gap: 6px;
}

.event-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-xxs);
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s;
}

.event-action-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    color: var(--neon-cyan);
}

.event-action-btn.delete:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* FAB Home Button */
.fab-home {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-white);
    transition: all 0.3s;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.fab-home.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.fab-home:hover {
    transform: scale(1.1);
    box-shadow: 0 0 35px rgba(0, 212, 255, 0.8);
}

.fab-home:active {
    transform: scale(0.95);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}


.modal-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-neon-active);
    border-radius: var(--radius);
    box-shadow: var(--shadow-neon-strong);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.05);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--neon-blue);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: var(--border-neon);
    background: rgba(10, 20, 35, 0.6);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    color: #ff4444;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--neon-blue);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: var(--border-neon);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-white);
    background: rgba(10, 20, 35, 0.8);
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-neon);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-dark-secondary);
    color: var(--text-white);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-modal {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-modal.btn-secondary {
    background: rgba(107, 125, 153, 0.2);
    color: var(--text-gray);
    border: 1px solid rgba(107, 125, 153, 0.3);
}

.btn-modal.btn-secondary:hover {
    background: rgba(107, 125, 153, 0.3);
    color: var(--text-white);
}

.btn-modal.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.btn-modal.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .home-main {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 36px;
    }

    .identity-badges {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 20px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .identity-badges {
        grid-template-columns: 1fr;
    }

    .home-main {
        padding: 24px 16px;
    }

    .calendar-controls {
        flex-direction: column;
        gap: 12px;
    }

    .calendar-nav-group {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-current-month {
        min-width: auto;
    }

    .calendar-day {
        font-size: 12px;
    }

    .fab-home {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
}

/* Header */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: var(--border-neon-active);
    box-shadow: var(--shadow-neon-strong);
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: bold;
    font-size: 20px;
    box-shadow: var(--shadow-neon);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.header-info h1 {
    font-size: 22px;
    color: var(--text-white);
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.fecha {
    font-size: 14px;
    color: var(--text-light-blue);
}

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

.curso-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.curso-selector label {
    font-weight: 500;
    color: var(--text-light-blue);
    font-size: 14px;
}

.curso-selector select {
    padding: 10px 16px;
    border: var(--border-neon);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-white);
    background: rgba(10, 20, 35, 0.9);
    cursor: pointer;
    min-width: 220px;
    transition: all 0.3s;
    outline: none;
}

.curso-selector select:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.curso-selector select:focus {
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-neon);
}

.curso-selector select option {
    background: var(--bg-dark-secondary);
    color: var(--text-white);
}

/* Métricas */
.metricas-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metrica-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: var(--border-neon);
    box-shadow: var(--shadow-neon);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.metrica-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon-cyan);
    box-shadow: var(--shadow-neon-strong);
}

.metrica-card.active-detail {
    border-color: var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.metrica-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    position: relative;
    flex-shrink: 0;
}

.metrica-icon.blue {
    background: rgba(0, 212, 255, 0.15);
    color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.metrica-icon.cyan {
    background: rgba(0, 255, 255, 0.15);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.metrica-icon.orange {
    background: rgba(255, 153, 102, 0.15);
    color: #ff9966;
    box-shadow: 0 0 15px rgba(255, 153, 102, 0.4);
}

.metrica-icon.green {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.metrica-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.metrica-valor {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.metrica-label {
    font-size: 13px;
    color: var(--text-light-blue);
    margin-top: 6px;
    font-weight: 500;
}

.metrica-detail {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 4px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metrica-expand {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-cyan);
    font-size: 14px;
    transition: transform 0.3s;
    opacity: 0.6;
}

.metrica-card:hover .metrica-expand {
    opacity: 1;
}

.metrica-card.active-detail .metrica-expand {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
}

/* Tabs */
.tabs-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0;
    box-shadow: var(--shadow-neon);
    border: var(--border-neon-active);
    border-bottom: none;
}

.tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.tab {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    position: relative;
}

.tab:hover {
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.tab.active {
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--neon-blue);
    box-shadow: 0 -2px 10px rgba(0, 212, 255, 0.6);
    border-radius: 3px 3px 0 0;
}

.tab i {
    font-size: 16px;
}

/* Tabla Container */
.tabla-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-neon);
    border: var(--border-neon-active);
    border-top: none;
}

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

.search-box {
    position: relative;
    width: 320px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-cyan);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: var(--border-neon);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: rgba(10, 20, 35, 0.8);
    color: var(--text-white);
    transition: all 0.3s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-neon);
}

.search-box input::placeholder {
    color: var(--text-gray);
}

.btn-refresh {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
}

.btn-refresh i {
    transition: transform 0.3s;
}

.btn-refresh:hover i {
    transform: rotate(180deg);
}

/* Tablas */
.tabla-content {
    overflow-x: auto;
}


table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(0, 212, 255, 0.08);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

th {
    padding: 16px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light-blue);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    font-size: 14px;
    color: var(--text-white);
}

tbody tr {
    background: transparent;
    transition: all 0.3s;
}

tbody tr:nth-child(even) {
    background: rgba(0, 212, 255, 0.03);
}

tbody tr:hover {
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Badges y estados */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-green);
    border: 1px solid var(--success-green);
    box-shadow: 0 0 10px var(--success-green-glow);
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.4);
}

.badge-inactive {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.5);
}

.badge-position {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    color: var(--text-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: var(--shadow-neon);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-position.gold {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.badge-position.silver {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.4);
}

.badge-position.bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(107, 125, 153, 0.3);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(107, 125, 153, 0.4);
}

.toggle.active {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--success-green);
    box-shadow: 0 0 15px var(--success-green-glow);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--text-gray);
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle.active::after {
    transform: translateX(24px);
    background: var(--success-green);
    box-shadow: 0 0 10px var(--success-green-glow);
}

.toggle.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Barra de progreso para temas */
.progress-bar {
    width: 100%;
    max-width: 200px;
    height: 10px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-xxs);
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
    border-radius: var(--radius-xxs);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tema-stats {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tema-porcentaje {
    font-weight: 700;
    color: var(--neon-cyan);
    min-width: 50px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

/* Empty State */
.tabla-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.tabla-empty.visible {
    display: flex;
}

.tabla-empty i {
    font-size: 56px;
    margin-bottom: 18px;
    opacity: 0.4;
    color: var(--neon-cyan);
}

.tabla-empty p {
    font-size: 16px;
    font-weight: 500;
}

/* Paginación */
.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.btn-pag {
    width: 44px;
    height: 44px;
    border: var(--border-neon);
    background: rgba(10, 20, 35, 0.6);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    transition: all 0.3s;
}

.btn-pag:hover:not(:disabled) {
    border-color: var(--neon-blue);
    background: rgba(0, 212, 255, 0.15);
    color: var(--neon-cyan);
    box-shadow: var(--shadow-neon);
}

.btn-pag:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(107, 125, 153, 0.3);
}

.pag-info {
    font-size: 14px;
    color: var(--text-light-blue);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}


.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-white);
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toast {
    padding: 16px 22px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: var(--border-neon);
    box-shadow: var(--shadow-neon-strong);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideIn 0.3s ease;
    min-width: 320px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-green);
    box-shadow: 0 0 20px var(--success-green-glow);
}

.toast.error {
    border-left: 4px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.4);
}

.toast.info {
    border-left: 4px solid var(--neon-blue);
}

.toast i {
    font-size: 20px;
}

.toast.success i { color: var(--success-green); }
.toast.error i { color: #ff4444; }
.toast.info i { color: var(--neon-blue); }

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-white);
    font-weight: 500;
}

/* Fecha en tabla */
.fecha-tabla {
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-light-blue);
}

/* Pregunta truncada */
.pregunta-text {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-white);
}

.pregunta-text:hover {
    white-space: normal;
    overflow: visible;
    background: rgba(0, 212, 255, 0.1);
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* Tema badge */
.tema-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    color: var(--text-white);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: var(--shadow-neon);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Contador badge */
.contador-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 7px 14px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    color: var(--text-white);
    border-radius: var(--radius-lg);
    font-weight: 700;
    box-shadow: var(--shadow-neon);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Estudiante sin nombre (fallback) */
.sin-nombre {
    color: var(--warning-yellow);
    font-style: italic;
    font-size: 0.9em;
    opacity: 0.8;
}

.sin-nombre::before {
    content: '👤 ';
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Chart Containers */

/* Panel de Desglose de Métricas */
.metricas-detail-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-neon-active);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-neon-strong);
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

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


.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.05);
}

.detail-panel-header h3 {
    font-size: 18px;
    color: var(--text-white);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-detail {
    width: 36px;
    height: 36px;
    border: var(--border-neon);
    background: rgba(10, 20, 35, 0.6);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-close-detail:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.4);
}

.detail-panel-content {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

/* Estilos del contenido del panel */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.detail-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(5px);
}

.detail-item-name {
    font-size: 14px;
    color: var(--text-white);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-item-value {
    font-size: 16px;
    color: var(--neon-cyan);
    font-weight: 700;
    margin-left: 16px;
}

.detail-item-percentage {
    font-size: 12px;
    color: var(--text-gray);
    margin-left: 8px;
    min-width: 45px;
}

/* Gráfico mini dentro del panel */
.detail-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 40px;
}

.detail-chart-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-stat {
    text-align: center;
}

.detail-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.detail-stat-label {
    font-size: 12px;
    color: var(--text-light-blue);
    margin-top: 4px;
}

/* Chart Containers */
.chart-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-neon);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-neon);
    position: relative;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}


/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 20, 35, 0.5);
    border-radius: var(--radius-xxs);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-electric));
    border-radius: var(--radius-xxs);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}
