/* -------------------------------------------------------------
   SISTEMA DE ESTILOS - RUBÉN MUÑOZ ACADEMIA DOCENTE
   Aesthetics: Warm Dark/Light Premium, Glassmorphism, Terracotta Accents
------------------------------------------------------------- */

/* ==========================================================================
   1. VARIABLES DE DISEÑO & TEMAS
   ========================================================================== */
:root {
    /* Paleta de Marca (Basada en el logo de Rubén Muñoz) */
    --brand-terracotta: hsl(5, 63%, 45%);
    --brand-terracotta-hover: hsl(5, 63%, 52%);
    --brand-terracotta-glow: rgba(178, 59, 43, 0.35);
    
    --brand-cream: hsl(38, 40%, 95%);
    --brand-cream-dark: hsl(38, 25%, 88%);
    
    /* Gradientes */
    --gradient-brand: linear-gradient(135deg, hsl(5, 63%, 45%) 0%, hsl(24, 75%, 50%) 100%);
    --gradient-gold: linear-gradient(135deg, hsl(38, 90%, 50%) 0%, hsl(20, 80%, 50%) 100%);
    --gradient-dark-glass: linear-gradient(135deg, rgba(30, 24, 22, 0.7) 0%, rgba(15, 12, 11, 0.85) 100%);
    
    /* Fuentes */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Sombras y Bordes */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 25px var(--brand-terracotta-glow);
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Variables del Tema Oscuro (Defectuoso) */
body.dark-theme {
    --bg-main: hsl(12, 18%, 7%);
    --bg-surface: hsl(12, 14%, 11%);
    --bg-surface-glass: rgba(22, 18, 16, 0.65);
    --bg-header-glass: rgba(15, 12, 11, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-rich: rgba(178, 59, 43, 0.25);
    
    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(12, 10%, 75%);
    --text-muted: hsl(12, 8%, 52%);
    --text-inverse: hsl(12, 18%, 7%);
    
    --accent-emerald: hsl(145, 63%, 42%);
    --accent-cyan: hsl(188, 78%, 40%);
    --accent-violet: hsl(262, 60%, 55%);
}

/* Variables del Tema Claro (Estética Notoria) */
body.light-theme {
    --bg-main: hsl(38, 25%, 96%);
    --bg-surface: hsl(38, 20%, 98%);
    --bg-surface-glass: rgba(250, 246, 240, 0.85);
    --bg-header-glass: rgba(245, 239, 230, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-rich: rgba(178, 59, 43, 0.2);
    
    --text-primary: hsl(12, 25%, 12%);
    --text-secondary: hsl(12, 15%, 32%);
    --text-muted: hsl(12, 10%, 52%);
    --text-inverse: hsl(0, 0%, 98%);
    
    --accent-emerald: hsl(145, 63%, 35%);
    --accent-cyan: hsl(188, 78%, 35%);
    --accent-violet: hsl(262, 60%, 45%);
}

/* ==========================================================================
   2. REINICIOS & ESTILOS BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Fondo decorativo */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    transition: all 0.8s ease;
}

body.dark-theme .blob {
    opacity: 0.12;
}

body.light-theme .blob {
    opacity: 0.06;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--brand-terracotta);
}

.blob-2 {
    bottom: -15%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--brand-terracotta-hover);
}

.blob-3 {
    top: 40%;
    left: 35%;
    width: 35vw;
    height: 35vw;
    background: var(--brand-cream-dark);
}

/* ==========================================================================
   3. CABECERA & NAVEGACIÓN
   ========================================================================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-header-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.brand-logo:hover {
    transform: scale(1.02);
}

.brand-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-terracotta);
    letter-spacing: 1px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-terracotta);
    background-color: rgba(178, 59, 43, 0.08);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Selector Rápido de Rol */
.role-selector-wrapper {
    position: relative;
}

.btn-role-badge {
    background: var(--gradient-brand);
    border: none;
    color: white;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.btn-role-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.role-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    width: 210px;
    display: none;
    flex-direction: column;
    padding: 0.5rem;
    z-index: 101;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.role-dropdown.show {
    display: flex;
}

.role-option {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.role-option:hover {
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
}

/* Tema oscuro/claro toggle */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    background-color: var(--border-color);
    color: var(--brand-terracotta);
}

/* Perfil Widget */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--brand-terracotta);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

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

.user-name-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.btn-signout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    transition: var(--transition-smooth);
}

.btn-signout:hover {
    color: var(--brand-terracotta);
    transform: translateX(2px);
}

/* ==========================================================================
   4. ESTRUCTURA SPA Y COMPONENTES COMUNES
   ========================================================================== */
.app-viewport {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Spinner de Carga */
.app-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1.5rem;
}

.app-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--brand-terracotta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.app-spinner-text {
    font-family: var(--font-heading);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Títulos y Secciones */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1rem;
}

.page-title-block h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-title-block p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Tarjetas Estilo Glassmorphism */
.glass-card {
    background-color: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-rich);
    box-shadow: var(--shadow-md);
}

/* Botones Premium */
.btn-primary {
    background: var(--gradient-brand);
    color: white;
    border: none;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

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

.btn-outline {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.btn-outline:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.btn-outline-sm:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
    border-color: var(--brand-terracotta);
}

/* Utilidades rápidas */
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted) !important; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }

/* ==========================================================================
   5. VISTA: DASHBOARD DE ESTUDIANTE (Home del Alumno)
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

/* Buscador e inicio de cursos */
.courses-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-filter-bar {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input-wrapper input:focus {
    border-color: var(--brand-terracotta);
    box-shadow: 0 0 10px rgba(178, 59, 43, 0.15);
}

.filter-select {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-select:focus {
    border-color: var(--brand-terracotta);
}

/* Tarjetas de Cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-brand);
    opacity: 0.8;
}

/* Colores de curso individuales alternativos */
.course-card.color-cyan::before {
    background: var(--accent-cyan);
}
.course-card.color-violet::before {
    background: var(--accent-violet);
}
.course-card.color-emerald::before {
    background: var(--accent-emerald);
}

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.course-badge-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-terracotta);
    letter-spacing: 0.8px;
}

.course-card.color-cyan .course-badge-category { color: var(--accent-cyan); }
.course-card.color-violet .course-badge-category { color: var(--accent-violet); }
.course-card.color-emerald .course-badge-category { color: var(--accent-emerald); }

.course-card-difficulty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.course-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.course-card-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Barra de progreso de la Tarjeta */
.course-card-progress {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-track-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill-bar {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 20px;
    width: 0%; /* Manejado dinámicamente */
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-card.color-cyan .progress-fill-bar { background: var(--accent-cyan); }
.course-card.color-violet .progress-fill-bar { background: var(--accent-violet); }
.course-card.color-emerald .progress-fill-bar { background: var(--accent-emerald); }

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

.course-meta-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Barra Lateral de Perfil / Estadísticas Estudiante */
.dashboard-sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-instructor-widget {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.welcome-avatar-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--brand-terracotta);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.welcome-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 0.76rem;
    color: var(--brand-terracotta);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-top: 0.2rem;
}

.welcome-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.6rem;
    line-height: 1.4;
}

/* Widget de estadísticas generales */
.stats-summary-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stats-summary-card h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.stat-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Widget de Certificados */
.certificates-list-card {
    display: flex;
    flex-direction: column;
}

.certificates-list-card h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.cert-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition-smooth);
}

.cert-item-link:hover {
    border-color: var(--brand-terracotta);
    transform: translateX(3px);
}

.cert-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cert-item-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.cert-item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cert-download-icon {
    color: var(--brand-terracotta);
    font-size: 0.85rem;
}

/* ==========================================================================
   6. VISTA: VISUALIZADOR DE CURSO (Focus Mode Lecciones)
   ========================================================================== */
.focus-mode-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--bg-surface-glass);
    overflow: hidden;
    min-height: calc(100vh - 180px);
}

/* Barra Lateral del Visualizador (Syllabus) */
.focus-sidebar {
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.focus-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.focus-course-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.focus-course-progress-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.focus-course-progress-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.focus-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Módulo en el listado del Focus Mode */
.focus-module-group {
    margin-bottom: 1rem;
}

.focus-module-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.focus-lessons-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.focus-lesson-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: var(--transition-smooth);
}

.focus-lesson-item:hover {
    background-color: rgba(178, 59, 43, 0.05);
    color: var(--text-primary);
}

.focus-lesson-item.active {
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
    border-left-color: var(--brand-terracotta);
    font-weight: 600;
}

.focus-lesson-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    line-height: 1.3;
}

.focus-lesson-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    transition: var(--transition-smooth);
}

.focus-lesson-item.completed .focus-lesson-checkbox {
    background-color: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

.focus-lesson-status-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.focus-lesson-item.locked {
    pointer-events: none;
    opacity: 0.5;
}

/* Panel Principal de Contenido del Visualizador */
.focus-content-viewport {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

/* Reproductor de Video Premium */
.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Relación de aspecto 16:9 */
    background-color: #000;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.video-player-wrapper iframe,
.video-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, hsl(12, 14%, 11%) 0%, hsl(12, 18%, 6%) 100%);
    color: var(--text-secondary);
}

.video-placeholder-fallback i {
    font-size: 3rem;
    color: var(--brand-terracotta);
}

/* Textos de la lección */
.lesson-article-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.lesson-article-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.lesson-rich-text {
    line-height: 1.6;
    font-size: 0.98rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lesson-rich-text p {
    margin-bottom: 0.5rem;
}

.lesson-rich-text h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 1rem;
    font-weight: 700;
}

.lesson-rich-text ul {
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Navegación entre lecciones */
.lesson-navigation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

/* Quiz Seccion Interactivo */
.lesson-quiz-section {
    background-color: var(--bg-surface);
    border: 1px dashed var(--border-color-rich);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    margin-top: 1rem;
}

.lesson-quiz-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quiz-question-text {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    list-style: none;
}

.quiz-option-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: left;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.quiz-option-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.quiz-option-btn.selected {
    border-color: var(--brand-terracotta);
    background-color: rgba(178, 59, 43, 0.05);
    color: var(--brand-terracotta);
    font-weight: 600;
}

.quiz-option-btn.correct {
    border-color: var(--accent-emerald);
    background-color: rgba(22, 163, 74, 0.06);
    color: var(--accent-emerald);
}

.quiz-option-btn.wrong {
    border-color: hsl(0, 72%, 50%);
    background-color: rgba(239, 68, 68, 0.06);
    color: hsl(0, 72%, 50%);
}

.quiz-feedback-box {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-feedback-box.correct {
    background-color: rgba(22, 163, 74, 0.08);
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
}

.quiz-feedback-box.wrong {
    background-color: rgba(239, 68, 68, 0.08);
    color: hsl(0, 72%, 50%);
    border: 1px solid hsl(0, 72%, 50%);
}

/* ==========================================================================
   7. VISTA: PANEL DE CONTROL INSTRUCTOR (Admin View)
   ========================================================================== */
.admin-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.admin-header-actions {
    display: flex;
    gap: 0.75rem;
}

.admin-panel-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-panel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.admin-panel-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tabla de Alumnos */
.student-table-container {
    overflow-x: auto;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.admin-table tr:hover td {
    background-color: rgba(178, 59, 43, 0.02);
}

.student-info-cell {
    display: flex;
    flex-direction: column;
}

.student-name-main {
    font-weight: 600;
    color: var(--text-primary);
}

.student-username-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-badge-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-percent {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: var(--border-color);
    color: var(--text-secondary);
}

.badge-percent.completed {
    background-color: rgba(22, 163, 74, 0.12);
    color: var(--accent-emerald);
}

.badge-percent.inprogress {
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
}

.student-actions-list {
    display: flex;
    gap: 0.4rem;
}

.btn-icon-action {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon-action:hover {
    color: var(--brand-terracotta);
    border-color: var(--brand-terracotta);
    background-color: rgba(178, 59, 43, 0.05);
}

/* ==========================================================================
   8. VENTANAS MODALES (Overlays)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 8, 8, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 520px;
    position: relative;
    padding: 2.2rem;
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-card.modal-large {
    max-width: 900px;
}

.modal-card.modal-auth {
    max-width: 420px;
    background-color: var(--bg-surface-glass);
    border-color: var(--border-color-rich);
    box-shadow: var(--shadow-glow);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--brand-terracotta);
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
    align-items: center;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Estilos de Formularios en Modales */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    color: var(--brand-terracotta);
    border-bottom-color: var(--brand-terracotta);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--brand-terracotta);
    box-shadow: 0 0 8px rgba(178, 59, 43, 0.12);
}

.courses-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.checkbox-label:hover {
    background-color: rgba(178, 59, 43, 0.05);
}

.checkbox-label input {
    width: auto;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   9. EDITOR DE PLAN DE ESTUDIOS EN CREADOR DE CURSOS
   ========================================================================== */
.syllabus-builder-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    background-color: var(--bg-main);
    min-height: 380px;
}

.syllabus-sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
}

.syllabus-sidebar h4 {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}

.syllabus-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.builder-module-item {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-terracotta);
    padding: 0.3rem 0.5rem;
    background-color: rgba(178, 59, 43, 0.05);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.builder-lesson-item {
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.builder-lesson-item:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.builder-lesson-item.active {
    background-color: var(--brand-terracotta);
    color: white;
}

.syllabus-editor-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.empty-state-card {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.empty-state-card i {
    font-size: 2.5rem;
}

/* ==========================================================================
   10. MAQUETACIÓN DEL CERTIFICADO PREMIUM
   ========================================================================== */
.modal-certificate-viewer {
    background-color: #1a1615;
    border-color: #3b2520;
    padding: 1.5rem;
}

.certificate-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.certificate-container {
    width: 100%;
    background-color: #fcfaf7; /* Fondo crema cálido premium */
    color: #2b1f1d;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.cert-border-outer {
    border: 8px double #b23b2b; /* Doble borde color terracota */
    padding: 1.5rem;
    position: relative;
}

.cert-border-inner {
    border: 1px solid rgba(178, 59, 43, 0.3);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.cert-watermark {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 24rem;
    font-weight: 800;
    color: rgba(178, 59, 43, 0.03); /* Monograma marca de agua ultra sutil */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    letter-spacing: -20px;
}

.cert-header, .cert-body, .cert-footer {
    position: relative;
    z-index: 1;
    width: 100%;
}

.cert-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.cert-logo {
    height: 70px;
    width: auto;
}

.cert-header-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.cert-institution {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #b23b2b;
    letter-spacing: 1.5px;
}

.cert-department {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #614a46;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

.cert-body {
    text-align: center;
    margin-bottom: 3.5rem;
}

.cert-main-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 800;
    color: #2b1f1d;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.cert-award-text {
    font-size: 0.95rem;
    font-style: italic;
    color: #614a46;
    margin-bottom: 1.5rem;
}

.cert-student-name {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: #b23b2b;
    margin-bottom: 1.2rem;
    border-bottom: none;
}

.cert-divider {
    width: 120px;
    height: 2px;
    background-color: #b23b2b;
    margin: 1.5rem auto;
}

.cert-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a3834;
    max-width: 600px;
    margin: 0 auto 1.25rem;
}

.cert-course-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #2b1f1d;
    margin-bottom: 1rem;
}

.cert-meta-info {
    font-size: 0.85rem;
    color: #614a46;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1rem;
    padding: 0 1rem;
}

.cert-signature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
}

.cert-signature-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    margin-bottom: -10px;
}

.cert-signature-line {
    width: 100%;
    height: 1px;
    background-color: rgba(178, 59, 43, 0.4);
    margin-bottom: 0.5rem;
}

.cert-signer-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #2b1f1d;
}

.cert-signer-title {
    font-size: 0.72rem;
    color: #614a46;
}

.cert-validation-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.25rem;
}

.cert-date-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #614a46;
}

.cert-date {
    font-weight: 700;
    font-size: 0.85rem;
    color: #2b1f1d;
}

.cert-qr-placeholder {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(178, 59, 43, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #614a46;
    background-color: white;
    font-size: 1.6rem;
    margin: 0.35rem 0;
    border-radius: 4px;
}

.cert-code {
    font-family: monospace;
    font-size: 0.72rem;
    color: #614a46;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   11. ANIMACIONES Y EFECTOS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

/* Sistema de Toasts flotantes */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 300;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    transform: translateX(120%);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-smooth);
}

.toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success {
    border-left: 4px solid var(--accent-emerald);
}
.toast-success i { color: var(--accent-emerald); }

.toast-info {
    border-left: 4px solid var(--brand-terracotta);
}
.toast-info i { color: var(--brand-terracotta); }

.toast-error {
    border-left: 4px solid hsl(0, 72%, 50%);
}
.toast-error i { color: hsl(0, 72%, 50%); }

@keyframes toastIn {
    to { transform: translateX(0); }
}

/* ==========================================================================
   12. RESPONSIVE DESIGN (Pantallas Adaptables)
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .focus-mode-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .focus-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .admin-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: space-between;
    }
    
    .app-viewport {
        padding: 1.5rem 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .syllabus-builder-layout {
        grid-template-columns: 1fr;
    }
    
    .syllabus-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}

/* ==========================================================================
   13. ESTILOS DE IMPRESIÓN DEL CERTIFICADO (PDF)
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    
    #modal-certificate,
    #certificate-print-area,
    #certificate-print-area * {
        visibility: visible;
    }
    
    #modal-certificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background-color: transparent !important;
        padding: 0 !important;
    }
    
    .certificate-modal-actions,
    .modal-close {
        display: none !important;
    }
    
    #certificate-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        background-color: #fff !important;
        padding: 0 !important;
    }
    
    .cert-border-outer {
        border-width: 4px !important;
    }
    
    .cert-border-inner {
        padding: 2rem !important;
    }
}

/* ==========================================================================
   8. PREVISUALIZADOR DE EMAIL Y AJUSTES DE NOTIFICACIONES (EmailJS)
   ========================================================================== */
.email-dispatch-status {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}
.email-dispatch-status.show {
    display: flex;
}
.email-dispatch-status.sending {
    background-color: rgba(6, 182, 212, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}
.email-dispatch-status.success {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.email-dispatch-status.error {
    background-color: rgba(178, 59, 43, 0.08);
    color: var(--brand-terracotta);
    border: 1px solid rgba(178, 59, 43, 0.2);
}

.email-envelope-preview {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    margin-bottom: 1rem;
}
body.dark-theme .email-envelope-preview {
    background: rgba(30, 24, 22, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

.email-header-preview {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
body.dark-theme .email-header-preview {
    background-color: rgba(255, 255, 255, 0.02);
}
.email-header-preview p {
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}
.email-header-preview p:last-child {
    margin-bottom: 0;
}
.email-header-preview strong {
    color: var(--text-primary);
    width: 65px;
    display: inline-block;
}

.email-body-preview {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 250px;
    overflow-y: auto;
}
.email-body-preview h4 {
    font-family: var(--font-heading);
    color: var(--brand-terracotta);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.email-body-preview ul {
    margin: 1rem 0;
    padding-left: 1.25rem;
}
.email-body-preview li {
    margin-bottom: 0.5rem;
}
.email-body-preview code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--brand-terracotta);
    font-weight: 700;
}
body.dark-theme .email-body-preview code {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Panel de Ajustes de EmailJS */
.admin-settings-card {
    grid-column: 1 / -1;
    margin-top: 2rem;
}
.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
