/* static/css/styles.css */

:root {
    /* Light Mode Default Theme (Grays, whites, blacks, and Conalep green) */
    --bg-primary: #f4f4f5; /* Light gray page background */
    --bg-secondary: #ffffff; /* Clean white cards and sidebar */
    --bg-tertiary: #e4e4e7; /* Muted gray border/background fields */
    --accent: #006d51; /* Official Conalep Green */
    --accent-hover: #00503b;
    --accent-rgb: 0, 109, 81;
    --text-primary: #09090b; /* Zinc 950 text */
    --text-secondary: #71717a; /* Zinc 500 text */
    --border-color: #e4e4e7; /* Zinc 200 border */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-bg: rgba(0, 0, 0, 0.02);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Explicit Light Mode Override */
html[data-theme="light"] {
    --bg-primary: #f4f4f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e4e4e7;
    --accent: #006d51;
    --accent-hover: #00503b;
    --accent-rgb: 0, 109, 81;
    --text-primary: #09090b;
    --text-secondary: #71717a;
    --border-color: #e4e4e7;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-bg: rgba(0, 0, 0, 0.02);
}

/* System Dark Mode (active only if no manual light override is set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Dark Mode Theme (Charcoals, solid off-black, zinc borders, Conalep green) */
        --bg-primary: #0a0a0a; /* Deep black page background */
        --bg-secondary: #121212; /* Rich dark charcoal cards/sidebar */
        --bg-tertiary: #1c1c1e; /* Lighter charcoal for fields/inputs */
        --accent: #008a67; /* Brighter Conalep green for dark mode contrast */
        --accent-hover: #006d51;
        --accent-rgb: 0, 138, 103;
        --text-primary: #f4f4f5; /* Zinc 100 text */
        --text-secondary: #a1a1aa; /* Zinc 400 text */
        --border-color: #27272a; /* Zinc 800 border */
        --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
        --hover-bg: rgba(255, 255, 255, 0.02);
    }
}

/* Explicit Dark Mode Override */
html[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1c1c1e;
    --accent: #008a67;
    --accent-hover: #006d51;
    --accent-rgb: 0, 138, 103;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --border-color: #27272a;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --hover-bg: rgba(255, 255, 255, 0.02);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

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

/* Left Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.brand-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 3rem;
    text-align: left;
    padding-left: 1.25rem; /* Alinea horizontalmente con los íconos del menú */
}

.brand-logo {
    width: 150px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item a:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.menu-item.active a {
    color: #fff;
    background-color: var(--accent);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
}

.user-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.25rem;
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
}

.logout-btn:hover {
    color: #f43f5e;
}

.sidebar-action-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.25rem;
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.sidebar-action-btn:hover, .sidebar-action-btn.active {
    color: var(--accent);
}

.sidebar-action-btn.logout:hover {
    color: #f43f5e;
}

.sidebar-action-btn.logout i {
    transform: translateX(2px); /* Compensación óptica para la flecha hacia la izquierda */
}

/* Mobile Header & Overlay default hidden */
.mobile-header {
    display: none;
}
.mobile-sidebar-overlay {
    display: none;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    min-width: 0; /* Previene el desborde en contenedores flex */
    padding: 3rem;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--bg-primary);
    padding: 1.5rem 0;
    margin-top: -1.5rem; /* Ajusta la holgura del padding del header */
    margin-bottom: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.metric-icon.blue {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.metric-icon.teal {
    background-color: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.metric-details {
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.chart-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

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

/* Standard Panels & Tables */
.data-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Custom Styled Tables */
.custom-table-wrapper {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.custom-table tr:hover td {
    background-color: var(--hover-bg);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge.info {
    background-color: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

/* Forms Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
}

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

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Alert Boxes */
.alert-box {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-box.danger {
    background-color: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.alert-box.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Login Page Container */
.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Filters Layout */
.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filters-row form {
    display: flex;
    gap: 1rem;
    flex-grow: 1;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters-row .form-group {
    flex-grow: 1;
    min-width: 180px;
}

.filters-row .btn {
    height: 48px;
}

/* Result Box for Generated References */
.result-card {
    background-color: rgba(var(--accent-rgb), 0.05);
    border: 1px dashed var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.result-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.result-reference {
    font-size: clamp(1.2rem, 5vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.result-details {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.result-details span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Responsive media queries */
@media (max-width: 992px) {
    body {
        flex-direction: column !important;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.25rem;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        height: 60px;
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .mobile-menu-btn,
    .mobile-theme-btn {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        transition: var(--transition);
    }
    .mobile-menu-btn:hover,
    .mobile-theme-btn:hover {
        background-color: var(--hover-bg);
        color: var(--text-primary);
    }

    .mobile-brand-logo {
        height: 30px;
        display: flex;
        align-items: center;
    }

    /* Mostrar logos correctos en el mobile-header según el tema */
    .mobile-brand-logo .logo-light,
    .mobile-brand-logo .logo-dark {
        display: none !important;
    }
    html:not([data-theme="dark"]) .mobile-brand-logo .logo-light {
        display: block !important;
        height: 30px !important;
        width: auto !important;
    }
    html[data-theme="dark"] .mobile-brand-logo .logo-dark {
        display: block !important;
        height: 30px !important;
        width: auto !important;
    }

    /* Mobile Sidebar Drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1050 !important;
        background-color: var(--bg-secondary) !important;
        border-right: 1px solid var(--border-color) !important;
        border-bottom: none !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 1.25rem !important;
        box-shadow: 20px 0 30px rgba(0, 0, 0, 0.15) !important;
        overflow-y: auto !important;
    }

    .mobile-sidebar-active .sidebar {
        transform: translateX(280px) !important;
    }

    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
    }

    .mobile-sidebar-active .mobile-sidebar-overlay {
        display: block;
    }

    .app-container {
        flex-direction: column;
    }

    .brand-section {
        margin-bottom: 1.5rem !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding-left: 0 !important;
    }

    .brand-logo {
        width: 150px !important;
        height: 45px !important;
        display: flex !important;
        justify-content: flex-start !important;
    }

    .brand-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .menu-list {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-bottom: 2rem !important;
        flex-grow: 1 !important;
    }

    .menu-item a {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.95rem !important;
        gap: 1rem !important;
    }

    .menu-item a span {
        display: inline !important;
    }

    .user-section {
        border-top: 1px solid var(--border-color) !important;
        padding-top: 1.5rem !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .user-info {
        display: flex !important;
        flex-direction: column !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem 1rem !important;
        width: 100%;
    }

    .sidebar-toggle-btn {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .section-header .btn {
        width: 100%;
    }

    .filters-row form {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row .form-group {
        width: 100%;
    }

    .filters-row .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Sidebar toggle on desktop only (min-width: 993px) */
@media (min-width: 993px) {
    .sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), border 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .logo-simple {
        display: none !important;
    }
    
    .logo-full {
        display: block !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .menu-item a span,
    .user-info span,
    .brand-title {
        white-space: nowrap;
    }
    
    .sidebar-collapsed .sidebar {
        width: 80px !important;
        padding: 2rem 0.5rem !important;
        align-items: center;
    }
    
    .sidebar-collapsed .brand-section {
        flex-direction: column-reverse !important; /* Coloca el botón arriba y el logo abajo en modo compacto */
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin-bottom: 2rem !important;
        gap: 1.25rem !important;
    }
    
    .sidebar-collapsed .brand-info {
        align-items: center !important;
        width: 100% !important;
    }
    
    .sidebar-collapsed .brand-logo {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .sidebar-collapsed .logo-full {
        display: none !important;
    }
    
    .sidebar-collapsed .logo-simple {
        display: block !important;
        max-width: 45px !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .sidebar-collapsed .brand-title,
    .sidebar-collapsed .menu-item a span,
    .sidebar-collapsed .user-info {
        display: none !important;
    }
    
    .sidebar-collapsed .menu-item a {
        justify-content: center !important;
        padding: 0.85rem !important;
        font-size: 1.35rem !important;
    }
    
    .sidebar-collapsed .user-section {
        justify-content: center !important;
        border-top: none !important;
        padding-top: 0 !important;
    }
    
    /* Hover effect for toggle button inside sidebar */
    .sidebar-toggle-btn:hover {
        color: var(--text-primary) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
    }
}

/* Ocultar botón de sándwich en móviles y tabletas */
@media (max-width: 992px) {
    .sidebar-toggle-btn,
    .theme-toggle-btn {
        display: none !important;
    }
}

/* Reglas globales de logos (ocultar simple por defecto en móvil/tablet) */
.logo-simple {
    display: none;
}
.logo-full {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Theme toggle button hover effects */
.theme-toggle-btn:hover {
    color: var(--accent) !important;
    background-color: var(--hover-bg);
}

/* Custom Premium Modals */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

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

.custom-modal-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    transform: scale(0.85);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal-card {
    transform: scale(1);
}

.custom-modal-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.custom-modal-icon-container.danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.custom-modal-icon-container.warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.custom-modal-icon-container.info {
    background-color: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.custom-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.custom-modal-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.custom-modal-actions .btn {
    flex-grow: 1;
    height: 44px;
    padding: 0;
}

/* Animated Filters Panel */
.filters-panel {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.35s ease, 
                transform 0.35s ease, 
                padding-top 0.35s ease, 
                padding-bottom 0.35s ease, 
                margin-bottom 0.35s ease, 
                border-color 0.35s ease;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    border-color: transparent !important;
}

.filters-panel.active {
    max-height: 300px; /* Suficiente para el contenido de los filtros en escritorio */
    opacity: 1;
    transform: translateY(0);
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    margin-bottom: 2rem !important;
    border-color: var(--border-color) !important;
}

@media (max-width: 992px) {
    .filters-panel.active {
        max-height: 600px; /* Suficiente cuando los filtros se apilan en responsive */
    }
}

/* Soporte para logotipos de temas claro/oscuro */
.logo-dark {
    display: none !important;
}
.logo-light {
    display: none !important;
}

/* Mostrar solo cuando la barra lateral no esté colapsada */
html:not(.sidebar-collapsed) .logo-light {
    display: block !important;
}
html[data-theme="dark"]:not(.sidebar-collapsed) .logo-dark {
    display: block !important;
}
html[data-theme="dark"]:not(.sidebar-collapsed) .logo-light {
    display: none !important;
}

/* Student Dashboard Grid Responsiveness */
.student-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .student-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .student-dashboard-grid > .data-panel {
        min-width: 0;
    }
}

/* Responsividad de Tablas en Móviles (Estilo Cards) */
@media (max-width: 768px) {
    .table-to-cards thead {
        display: none !important;
    }
    .table-to-cards tr {
        display: block !important;
        margin-bottom: 1.25rem !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        padding: 1.25rem !important;
        background-color: var(--bg-secondary) !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    }
    .table-to-cards td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 0.85rem 0 !important;
        font-size: 0.9rem !important;
        text-align: right !important;
    }
    .table-to-cards td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        justify-content: flex-end !important;
    }
    .table-to-cards td::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: var(--text-secondary) !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        text-align: left !important;
        margin-right: 1.5rem !important;
        flex-shrink: 0 !important;
    }
    
    .hide-on-mobile {
        display: none !important;
    }

    .data-panel {
        padding: 1.25rem !important;
        border-radius: 12px !important;
        margin-bottom: 1.25rem !important;
    }
}

/* Ajuste de escala para pantallas de laptops (como 1366x768) */
@media (max-width: 1400px) and (min-width: 993px) {
    html {
        font-size: 14px;
    }
    .sidebar {
        width: 250px;
        padding: 1.5rem 1rem;
    }
    .main-content {
        padding: 2rem;
    }
}

/* Dropdown Menu de Usuario */
.user-dropdown {
    position: absolute;
    bottom: 85px;
    left: 1.5rem;
    right: 1.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 250;
    transition: var(--transition);
}

.sidebar-collapsed .user-dropdown {
    left: 56px; /* Abre hacia la derecha de la barra colapsada, con leve solape para verse unificado */
    bottom: 1.5rem;
    width: 200px;
    right: auto;
}

.user-dropdown.show {
    display: flex;
    animation: dropdownFadeIn 0.2s ease-out;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box !important;
}

.user-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.user-dropdown-item.logout:hover {
    color: #f43f5e;
    background-color: rgba(244, 63, 94, 0.1);
}

.user-dropdown-item i {
    font-size: 1.2rem;
}

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

/* Easter Egg - Modo Leyenda Cyberpunk */
html[data-easter-egg="active"] {
    --accent: #00ffcc;
    --accent-hover: #00e6b8;
    --accent-rgb: 0, 255, 204;
}

html[data-easter-egg="active"] .data-panel,
html[data-easter-egg="active"] .result-card,
html[data-easter-egg="active"] .sidebar {
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.4) !important;
    border-color: rgba(0, 255, 204, 0.6) !important;
}

.konami-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999999;
    font-size: 2.5rem;
    top: -60px;
    animation: rainParticle 3s linear forwards;
}

@keyframes rainParticle {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(108vh) rotate(720deg) scale(1.3);
    }
}




