/* ==========================================================================
   1. RESET GLOBAL Y VARIABLES DINÁMICAS
   ========================================================================== */
:root {
    --primary-color: #2563eb;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --sidebar-bg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

body { 
    margin: 0; 
    padding: 0; 
    font-family: var(--tenant-font, system-ui, -apple-system, sans-serif); 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* ==========================================================================
   2. BOTONES Y UTILIDADES GENÉRICAS
   ========================================================================== */
.btn-primary { 
    background-color: var(--primary-color, #2563eb); 
    color: white !important; 
    padding: 0.75rem 1.2rem; 
    border: none; 
    border-radius: 6px; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    text-decoration: none;
    transition: all 0.2s; 
    display: inline-block;
}
.btn-primary:hover { filter: brightness(0.9); transform: translateY(-1px); }

.btn-danger { background-color: #dc2626; color: white !important; padding: 0.5rem 1.2rem; border-radius: 6px; }

/* Utilidades Textos */
.text-danger { color: #dc2626; font-size: 0.85rem; margin-top: 0.35rem; display: block; }
.invalid-feedback { color: #dc3545; font-size: 0.85rem; margin-top: 0.4rem; display: block; }
.is-invalid { border-color: #dc3545 !important; }

/* Utilidades para Autenticación */
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary-color); font-weight: 500; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer a.text-muted { color: var(--text-muted); }
.form-help-text { color: #64748b; font-size: 0.8rem; display: block; margin-top: 0.3rem; }
.auth-icon-header { text-align: center; margin-bottom: 1rem; color: var(--primary-color); display: flex; justify-content: center; }

/* ==========================================================================
   3. NAVEGACIÓN Y NAVBAR (Pública y Campus)
   ========================================================================== */
.navbar { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 1rem 5%; background-color: var(--sidebar-bg, #ffffff); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; width: 100%; 
}

.brand-logo, .brand img { max-height: 50px; width: auto; }
.brand-text, .brand h2 { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); text-decoration: none; margin: 0; }

.nav-links { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.nav-item, .nav-links a { text-decoration: none; color: var(--text-main, #334155); font-weight: 500; font-size: 1rem; transition: color 0.2s ease; }
.nav-item:hover, .nav-links a:hover { color: var(--primary-color, #2563eb); }
.nav-divider { width: 1px; height: 20px; background-color: #cbd5e1; margin: 0 0.5rem; }
.btn-logout { color: #dc2626 !important; font-weight: 600 !important; }

/* Botón Hamburguesa */
.mobile-menu-btn, .hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; flex-direction: column; gap: 5px; }
.mobile-menu-btn span { display: block; width: 25px; height: 3px; background-color: var(--text-main); border-radius: 3px; transition: all 0.3s ease-in-out; }

@media (max-width: 768px) {
    .mobile-menu-btn, .hamburger { display: flex; }
    .nav-links { position: absolute; top: 100%; left: 0; width: 100%; background-color: #ffffff; flex-direction: column; align-items: stretch; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in-out; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
    .nav-links.active { max-height: 400px; padding: 1rem 0; }
    .nav-item { padding: 1rem 2rem; text-align: center; border-bottom: 1px solid #f1f5f9; }
    .mobile-menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ==========================================================================
   4. FORMULARIOS GLOBALES Y AUTENTICACIÓN
   ========================================================================== */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #475569; font-size: 0.9rem; }
.form-label-flex { display: flex; justify-content: space-between; align-items: center; }

.form-control, .form-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color, #cbd5e1); border-radius: 8px; font-size: 1rem; box-sizing: border-box; transition: all 0.2s; outline: none; }
.form-control:focus, .form-input:focus { border-color: var(--primary-color, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.col { flex: 1; min-width: 200px; }

/* Tarjetas de Login/Registro */
.auth-card { width: 100%; max-width: 400px; margin: 4rem auto; padding: 2.5rem; background: var(--bg-card, #ffffff); border-radius: 10px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.auth-title { text-align: center; margin-bottom: 0.5rem; font-size: 1.5rem; font-weight: 700; color: var(--text-main, #334155); }
.auth-subtitle { text-align: center; color: var(--text-muted, #64748b); margin-bottom: 2rem; font-size: 0.9rem; line-height: 1.4; }
.link-forgot { color: var(--primary-color, #2563eb); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.link-forgot:hover { text-decoration: underline; }

/* Alertas Globales */
.alert-error, .alert-danger { background-color: #fee2e2; color: #991b1b; padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid #f87171; font-size: 0.9rem; text-align: center; }
.alert-success { background-color: #dcfce7; color: #166534; padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid #86efac; font-size: 0.9rem; text-align: center; }

/* ==========================================================================
   5. LANDING PAGES Y CATÁLOGOS
   ========================================================================== */
.hero-section, .hero { 
    width: 100%; 
    margin: 0 0 3rem 0; 
    border-radius: 1rem; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 4rem 2rem; 
    text-align: center; 
    box-sizing: border-box;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.hero-title, .hero h1 { 
    font-size: clamp(2rem, 5vw, 3rem); 
    font-weight: 800; 
    color: var(--primary-color); 
    max-width: 800px; 
    margin: 0 auto 1rem auto; 
    word-wrap: break-word; 
    border: none;
}

.hero-subtitle, .hero p { 
    font-size: 1.1rem; 
    color: #cbd5e1; 
    max-width: 600px; 
    margin: 0 auto; 
    line-height: 1.6; 
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; }
.btn-light { background: white; color: var(--text-main); padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; text-decoration: none; transition: transform 0.2s; }
.btn-outline-light { background: transparent; color: white; border: 2px solid white; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; text-decoration: none; transition: background 0.2s; }

.features-section { max-width: 1200px; margin: 0 auto 4rem auto; padding: 0 2rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: var(--bg-card); padding: 2rem; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.feature-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-main); }
.feature-text { color: var(--text-muted); line-height: 1.5; font-size: 0.95rem; }

/* Componentes de Perfil / Mi Cuenta */
.account-container { max-width: 600px; margin: 2rem auto; }
.profile-card { background: var(--bg-card, #ffffff); border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); overflow: hidden; }
.profile-header { background: var(--primary-color, #2563eb); padding: 2rem; text-align: center; color: white; }
.profile-avatar { width: 100px; height: 100px; background: white; border-radius: 50%; margin: 0 auto 1rem auto; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--primary-color, #2563eb); font-weight: bold; border: 4px solid rgba(255,255,255,0.2); }
.profile-name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.role-badge { display: inline-block; background: #e0e7ff; color: #4338ca; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-top: 0.5rem; }

/* ==========================================================================
   6. UTILIDADES DE LAYOUT Y COMPONENTES (CERO ESTILOS EN LÍNEA)
   ========================================================================== */
/* Menús e Iconos */
.nav-item, .btn-logout { display: flex; align-items: center; gap: 0.4rem; }

/* Contenedor del Campus */
.campus-main { padding-top: 2rem; padding-bottom: 4rem; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* Footer Global */
.app-footer { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.9rem; margin-top: auto; background-color: transparent; }
.footer-brand { font-weight: bold; color: var(--primary-color); }

/* Alertas Centradas con Icono */
.alert-centered { max-width: 1000px; margin: 0 auto 2rem auto; display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: bold; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Tarjetas de Cursos (Landing/Campus) */
.course-card { padding: 0; display: flex; flex-direction: column; overflow: hidden; text-align: left; background: var(--bg-card); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.course-image { height: 200px; background-color: #f1f5f9; background-size: cover; background-position: center; border-bottom: 1px solid var(--border-color); }
.course-card-body { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.course-header-flex { display: flex; justify-content: space-between; align-items: start; margin-bottom: 1rem; gap: 10px; }
.course-badge { background: #e0f2fe; color: #0284c7; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: bold; white-space: nowrap; display: flex; align-items: center; gap: 0.25rem; }
.course-topics-list { list-style-type: none; padding: 0; margin: 0; }
.course-topic-item { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.35rem; }
.course-footer { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 1.25rem; text-align: center; }
.btn-course-action { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; font-size: 0.9rem; }

/* ==========================================================================
   7. COMPONENTES DE PERFIL Y TARJETAS (CERO ESTILOS EN LÍNEA)
   ========================================================================== */
.account-wrapper { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }

.profile-hero { text-align: center; margin-bottom: 2rem; }
.profile-avatar-circle { width: 80px; height: 80px; background: var(--primary-color, #2563eb); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 1rem auto; font-weight: bold; }
.profile-hero-name { margin: 0 0 0.5rem 0; color: #0f172a; }
.role-pill { background: #e2e8f0; color: #475569; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; display: inline-block; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.card-panel { background: white; border-radius: 12px; padding: 2rem; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; height: fit-content; }
.card-title { font-size: 1.25rem; color: #0f172a; margin-top: 0; margin-bottom: 1.5rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 0.5rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.text-pending { font-size: 0.75rem; color: #d97706; display: block; margin-top: 0.2rem; }
.password-rules-box { background: #f8fafc; padding: 1rem; border-radius: 6px; margin-bottom: 1.5rem; border: 1px dashed #cbd5e1; }
.password-rules-list { font-size: 0.75rem; color: #64748b; margin: 0; padding-left: 1rem; }
.btn-dark { background: #0f172a; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: 600; cursor: pointer; width: 100%; transition: opacity 0.2s; }
.btn-dark:hover { opacity: 0.9; }
.btn-block { width: 100%; display: block; }

/* ==========================================================================
   8. PÁGINA DE INICIO (SAAS)
   ========================================================================== */
/* Forzar centrado en el layout frontend sin sidebar */
.layout-frontend .app-container { display: block; width: 100%; }
.layout-frontend .main-content { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Contenedor central restrictivo */
.content-area { max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; padding: 2rem 1rem; }

/* Secciones internas */
.features-section { width: 100%; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title { font-size: 2rem; border: none; color: var(--text-color); margin-bottom: 0.5rem; font-weight: bold; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Botones del Hero */
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.btn-outline-light { border: 2px solid white; color: white; padding: 0.75rem 1.5rem; border-radius: 6px; text-decoration: none; font-weight: 600; transition: all 0.3s; }
.btn-outline-light:hover { background: white; color: var(--primary-color); }
.btn-light { background: white; color: var(--primary-color); padding: 0.75rem 1.5rem; border-radius: 6px; text-decoration: none; font-weight: 600; transition: opacity 0.3s; }
.btn-light:hover { opacity: 0.9; }

/* Iconos de las tarjetas */
.feature-icon-wrapper { color: var(--primary-color); margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: flex-start; }

/* ==========================================================================
   9. DASHBOARD Y BACKOFFICE
   ========================================================================== */
/* Aseguramos que el contenedor del dashboard use el espacio de forma óptima */
.dashboard-container { width: 100%; max-width: 1200px; margin: 0 auto; box-sizing: border-box; }

/* Alerta Inteligente de Soporte */
.alert-support { background-color: #f0fdfa; border: 1px solid #ccfbf1; border-left: 5px solid #14b8a6; padding: 1.5rem; margin-bottom: 2rem; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.05); flex-wrap: wrap; gap: 1rem; }
.alert-support-info { display: flex; flex-direction: column; gap: 0.5rem; }
.alert-support-title { margin: 0; color: #0f766e; font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; font-weight: bold; }
.alert-support-text { margin: 0; color: #115e59; font-size: 1rem; line-height: 1.5; }

.btn-support { background-color: #0d9488; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: bold; display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.3s; }
.btn-support:hover { background-color: #0f766e; }

/* Utilidades para Tablas */
.text-muted-center { text-align: center; color: #64748b; padding: 1.5rem; }
.status-text { font-weight: bold; }
.status-active { color: #16a34a; }
.status-inactive { color: #64748b; }

/* ==========================================================================
   10. ESTRUCTURA LAYOUT ADMIN (SIDEBAR + CONTENIDO)
   ========================================================================== */
/* 1. Contenedor principal: Soporta tanto app-container (SaaS) como layout-main (Office) */
.layout-admin .app-container,
.layout-admin .layout-main {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; 
    align-items: stretch;
    min-height: calc(100vh - 70px); 
}

/* 2. Barra Lateral */
.layout-admin .sidebar {
    width: 250px; 
    flex-shrink: 0; 
    background-color: var(--sidebar-bg, #ffffff);
    border-right: 1px solid var(--border-color);
}

/* 3. Área Principal (Soporta main-content y office-main) */
.layout-admin .main-content,
.layout-admin .office-main {
    flex-grow: 1;
    width: calc(100% - 250px);
    min-width: 0; 
    display: flex;
    flex-direction: column;
}

/* 4. Envoltura de Contenido: Alineamos la altura con el texto del sidebar */
.layout-admin .content-area,
.layout-admin .content-wrapper {
    padding: 1.5rem 2rem; /* Reducimos el padding superior a 1.5rem */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1; 
}

/* 5. Matar el margen superior fantasma de los títulos principales */
.dashboard-header {
    margin-top: 0;
    margin-bottom: 2rem;
}

.dashboard-header h1,
.dashboard-header h2 {
    margin-top: 0; /* Esto elimina el espacio rojo de tu captura */
    color: var(--text-color);
}

/* ==========================================================================
   11. GESTIÓN DE TABLAS Y FORMULARIOS (BACKOFFICE)
   ========================================================================== */
.admin-container { width: 100%; max-width: 1200px; margin: 0 auto; padding-bottom: 2rem; }
.header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.header-actions h1 { margin: 0; color: var(--text-color); font-size: 2rem; }

/* Utilidades para los formularios */
.form-wrapper { width: 100%; display: flex; justify-content: flex-start; padding-top: 1rem; }
.form-container { background: #ffffff; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); width: 100%; max-width: 600px; border: 1px solid var(--border-color); }
.form-container h2 { margin-top: 0; margin-bottom: 1.5rem; color: var(--text-color); font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }

/* Botones de Acción (Iconos para tablas) */
.action-group { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-start; align-items: center; }

/* Botón base para iconos */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem; border-radius: 6px; text-decoration: none; transition: background 0.2s; border: none; cursor: pointer; color: white; }
.btn-icon svg { width: 18px; height: 18px; } /* Tamaño estándar del icono */

.btn-enter { background-color: #0d9488; }
.btn-enter:hover { background-color: #0f766e; }

.btn-edit { background-color: #2563eb; }
.btn-edit:hover { background-color: #1d4ed8; }

.btn-warning { background-color: #f59e0b; }
.btn-warning:hover { background-color: #d97706; }

.btn-delete { background-color: #dc2626; }
.btn-delete:hover { background-color: #b91c1c; }

/* Botones Grandes de Formulario */
.btn-submit { background-color: var(--primary-color); color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: 600; width: 100%; margin-top: 1rem; transition: opacity 0.2s; }
.btn-submit:hover { opacity: 0.9; }
.btn-cancel { background-color: transparent; color: #64748b; padding: 0.75rem 1.5rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: 600; text-align: center; display: block; width: 100%; box-sizing: border-box; text-decoration: none; margin-top: 0.5rem; transition: background 0.2s; }
.btn-cancel:hover { background-color: #f1f5f9; }

/* Badges */
.badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: bold; }
.badge-active { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.text-id { color: #64748b; font-weight: bold; }
.text-italic { color: #64748b; font-style: italic; }
.form-note { color: #64748b; font-size: 0.8rem; margin-top: 0.3rem; display: block; }

/* Soporte para múltiples contenedores de formularios (Grid) */
.form-wrapper.multi-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    align-items: start; /* Evita que las tarjetas se estiren a lo alto */
}

/* Colores de error en formularios */
.text-danger {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Tooltips Nativos: El cursor 'help' o 'pointer' mejora la UX */
.btn-icon[title] {
    cursor: pointer;
}
/* Utilidades para celdas de tablas (Auditoría, etc.) */
.text-sm-muted { font-size: 0.8rem; color: #64748b; display: block; margin-top: 0.2rem; }
.td-details { max-width: 300px; line-height: 1.4; word-wrap: break-word; }
.td-date { white-space: nowrap; color: #475569; font-size: 0.85rem; }

/* Badge para el tipo de Acción */
.badge-action { background-color: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; font-family: monospace; letter-spacing: 0.5px; }
/* Utilidades para Formularios y Estados */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row .form-group { margin-bottom: 0; } /* Evita doble margen en grids */
.status-danger { color: #dc2626; } /* Para estados inactivos/críticos */


/* ==========================================================================
   12. CAMPUS VIRTUAL Y REVISIÓN DE CUENTA
   ========================================================================== */
/* Contenedor del Campus */
.campus-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; width: 100%; box-sizing: border-box; }
.campus-title { color: var(--primary-color); margin-bottom: 2rem; border-bottom: 2px solid var(--border-color); padding-bottom: 1rem; }

/* Grid de Cursos (Campus) */
.campus-courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.campus-course-card { border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; flex-direction: column; transition: transform 0.2s; }
.campus-course-card:hover { transform: translateY(-5px); }
.campus-course-image { height: 160px; background-color: #f1f5f9; background-size: cover; background-position: center; }
.campus-course-body { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.campus-course-title { color: var(--text-color); margin: 0 0 1rem 0; font-size: 1.15rem; font-weight: 600; }

/* Estados del Curso (Progreso y Pendiente) */
.course-status-pending { margin-bottom: 1.5rem; margin-top: auto; text-align: center; color: #d97706; font-size: 0.9rem; font-weight: 600; }
.btn-disabled { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.75rem; background: #fbbf24; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: not-allowed; }
.course-status-active { margin-bottom: 1.5rem; margin-top: auto; }
.progress-header { display: flex; justify-content: space-between; font-size: 0.85rem; color: #64748b; margin-bottom: 0.5rem; font-weight: bold; }
.progress-track { width: 100%; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.btn-play-course { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; box-sizing: border-box; padding: 0.75rem; background: var(--primary-color, #2563eb); color: white; text-decoration: none; border-radius: 6px; font-weight: 600; transition: opacity 0.2s; }
.btn-play-course:hover { opacity: 0.9; }

/* Estado Vacío */
.empty-campus-state { grid-column: 1 / -1; text-align: center; padding: 4rem; background: #f8fafc; border-radius: 12px; border: 1px dashed #cbd5e1; }
.empty-campus-state h3 { color: #475569; margin-top: 0; }
.empty-campus-state p { color: #64748b; margin-bottom: 1.5rem; }

/* Pantalla de Revisión de Cuenta */
.review-main-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.review-card { background: #ffffff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); max-width: 500px; width: 100%; padding: 3rem 2rem; text-align: center; border: 1px solid var(--border-color); }
.review-icon-container { width: 80px; height: 80px; background-color: #fffbeb; color: #d97706; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto; }
.review-title { color: var(--text-color); font-size: 1.5rem; margin-bottom: 1rem; margin-top: 0; }
.review-description { color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; }
.review-contact-buttons { display: flex; flex-direction: column; gap: 1rem; }
.btn-contact { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.5rem; border-radius: 8px; text-decoration: none; font-weight: 600; transition: all 0.2s ease; }
.btn-whatsapp { background-color: #25D366; color: white; }
.btn-whatsapp:hover { background-color: #20bd5a; }
.btn-email { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.btn-email:hover { background-color: #e2e8f0; }

/* ==========================================================================
   13. CATÁLOGO DE CURSOS (MARKETPLACE)
   ========================================================================== */
.catalog-container { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
.page-header { text-align: center; margin-bottom: 3rem; }
.page-title { font-size: 2.5rem; color: var(--text-color); margin-bottom: 0.5rem; font-weight: bold; }
.page-subtitle { color: var(--text-muted); font-size: 1.1rem; }

/* Alerta de Prelación */
.alert-prerequisite { max-width: 1000px; margin: 2rem auto; background: #fef2f2; border: 1px solid #f87171; color: #b91c1c; padding: 1rem 1.5rem; border-radius: 8px; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 0.75rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Grid y Tarjetas del Catálogo */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.course-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.course-image { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; background-color: #f1f5f9; border-bottom: 1px solid var(--border-color); }
.course-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.course-title { font-size: 1.25rem; color: var(--text-color); margin: 0 0 0.75rem 0; font-weight: bold; }
.course-description { color: var(--text-muted); line-height: 1.5; margin-bottom: 1.5rem; flex-grow: 1; font-size: 0.95rem; }
.btn-outline { display: block; text-align: center; padding: 0.75rem; border: 2px solid var(--primary-color); color: var(--primary-color); border-radius: 6px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.btn-outline:hover { background-color: var(--primary-color); color: #ffffff; }

/* Estado Vacío */
.empty-catalog-state { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 4rem; font-size: 1.1rem; background: #f8fafc; border-radius: 12px; border: 1px dashed #cbd5e1; }

/* Detalles del Curso */
.btn-back { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); text-decoration: none; font-weight: 600; margin-bottom: 1.5rem; transition: color 0.2s; }
.btn-back:hover { color: var(--primary-color); }
.course-detail-container { background: #ffffff; border-radius: 12px; border: 1px solid var(--border-color); overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.course-hero { width: 100%; height: 350px; object-fit: cover; background-color: #f1f5f9; }
.course-info { padding: 3rem; }
.course-title-main { font-size: 2.25rem; color: var(--text-color); margin-top: 0; margin-bottom: 1rem; }
.course-meta { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.meta-tag { background: #f1f5f9; color: #475569; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: bold; border: 1px solid #e2e8f0; }
.course-full-description { color: #334155; line-height: 1.7; margin-bottom: 2.5rem; font-size: 1.05rem; }
.btn-enroll { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 2.5rem; border-radius: 6px; text-decoration: none; font-weight: 600; border: none; cursor: pointer; transition: opacity 0.2s; }


/* ==========================================================================
   14. GESTIÓN DE CURSOS Y CURRÍCULUM (MODALES Y DRAG & DROP)
   ========================================================================== */
/* Botones de Acción Secundarios (Texto + Icono) */
.btn-action-sm { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background 0.2s; border: 1px solid transparent; cursor: pointer; }
.btn-action-default { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.btn-action-default:hover { background: #f1f5f9; }
.btn-action-primary { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.btn-action-primary:hover { background: #c7d2fe; }
.btn-action-success { background: #f0fdfa; color: #0d9488; border-color: #ccfbf1; }
.btn-action-success:hover { background: #ccfbf1; }

/* Tabla de Cursos */
.course-thumb { width: 80px; height: 80px; border-radius: 8px; background-color: #f1f5f9; background-size: cover; background-position: center; border: 1px solid #cbd5e1; flex-shrink: 0; }
.badge-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 0.35rem; }
.dot-active { background-color: #16a34a; }
.dot-draft { background-color: #94a3b8; }
.course-slug { background: #f8fafc; padding: 0.25rem 0.5rem; border-radius: 4px; border: 1px solid #e2e8f0; display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; color: #64748b; margin-bottom: 0.5rem; }
.course-desc-truncate { margin: 0; color: #475569; font-size: 0.9rem; max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modales Globales */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.2s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: white; width: 100%; max-width: 800px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); max-height: 90vh; display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.2s ease; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 1.25rem; color: var(--text-color); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex-grow: 1; }
.modal-footer { padding: 1.5rem; border-top: 1px solid var(--border-color); background: #f8fafc; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; display: flex; justify-content: flex-end; gap: 1rem; }

/* Estructura del Temario (Drag & Drop) */
.topic-item { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid var(--border-color); margin-bottom: 1.5rem; overflow: hidden; }
.topic-header { background: #f8fafc; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 1rem; }
.topic-title { margin: 0; color: var(--text-color); font-size: 1.1rem; flex-grow: 1; font-weight: 600; }
.lesson-item { border: 1px solid var(--border-color); border-radius: 6px; margin-bottom: 0.5rem; background: #fff; }
.lesson-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; }
.drag-handle { cursor: grab; color: #94a3b8; }
.drag-handle:active { cursor: grabbing; }
.btn-icon-transparent { background: transparent; border: none; cursor: pointer; color: #0284c7; padding: 0.25rem; transition: color 0.2s; }
.btn-icon-transparent:hover { color: #0369a1; }
.btn-icon-muted { color: #64748b; }
.btn-icon-muted:hover { color: #334155; }
.topic-content, .lesson-content { display: none; } /* Manejado por JS */
.empty-state-dashed { text-align: center; color: #64748b; padding: 4rem; background: white; border-radius: 12px; border: 1px dashed #cbd5e1; }

/* Utilidades de Diseño / Quill */
.topic-content img, .lesson-content img, .ql-editor img { max-width: 100% !important; height: auto !important; object-fit: contain; border-radius: 4px; }
.content-limiter { max-height: 200px; overflow: hidden; position: relative; transition: max-height 0.3s ease; }
.content-limiter.expanded { max-height: none !important; }
.content-limiter:not(.expanded).has-overflow::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 80px; background: linear-gradient(transparent, #ffffff); }
.lesson-content .content-limiter:not(.expanded).has-overflow::after { background: linear-gradient(transparent, #f8fafc); }
.read-more-btn { background: none; border: none; color: var(--primary-color); font-weight: bold; cursor: pointer; padding: 0.75rem 0 0 0; font-size: 0.85rem; display: none; align-items: center; gap: 0.25rem; }

/* Formularios y Checkbox */
.form-upload-hint { margin-top: 0.75rem; font-size: 0.85rem; color: #475569; display: grid; gap: 0.25rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: bold; color: var(--text-color); margin-bottom: 0.5rem; }
.checkbox-label input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--primary-color); }
.field-note { color: var(--text-muted); font-size: 0.85rem; display: block; margin-left: 1.75rem; }
.box-highlight { background: #f8fafc; padding: 1.5rem; border-radius: 8px; border: 1px dashed #94a3b8; margin-bottom: 1.5rem; }

/* ==========================================================================
   16. CORRECCIÓN DE ENCABEZADOS Y MODALES
   ========================================================================== */
/* Alineación estricta de encabezados y botones */
.header-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.header-title-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ocupa el espacio disponible empujando los botones a la derecha */
}
.header-title-group h1 { margin: 0; }
.header-title-group p { margin: 0.5rem 0 0 0; color: var(--text-muted); }

/* .header-button-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
} */

/* Forzar barra de desplazamiento en modales largos */
.modal-content {
    max-height: 85vh !important; /* Nunca excederá el 85% de la ventana */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; 
}
.modal-content form {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Fundamental para que la caja interna haga scroll */
    height: 100%;
}
.modal-body {
    overflow-y: auto !important; /* Activa el scroll vertical */
    padding: 1.5rem;
    flex: 1 1 auto; /* Permite crecer y encogerse dinámicamente */
}
.modal-footer {
    flex-shrink: 0; /* Evita que los botones del footer se aplasten */
}

/* Ajustes de botones sin texto (Iconos) */
.btn-icon-info { background-color: #0284c7; color: white; }
.btn-icon-info:hover { background-color: #0369a1; }
.btn-icon-purple { background-color: #7c3aed; color: white; }
.btn-icon-purple:hover { background-color: #6d28d9; }

/* Forzar que los botones en el encabezado se coloquen lado a lado */
.header-button-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap; /* Impide terminantemente que salten de línea */
}

.header-button-group .btn-primary,
.header-button-group .btn-cancel {
    width: auto !important; /* Anula el 100% heredado de los formularios */
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ==========================================================================
   17. DASHBOARDS OFFICE Y PROFESOR (ESTADÍSTICAS)
   ========================================================================== */
/* Grid para 4 elementos en la fila superior */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Colores personalizados para las tarjetas operativas (Border Left) */
.stat-card-yellow { border-left: 4px solid #eab308; text-decoration: none; }
.stat-card-yellow .stat-title { color: #ca8a04; }
.stat-card-yellow .stat-value { color: var(--text-color); }

.stat-card-indigo { border-left: 4px solid #8b5cf6; text-decoration: none; }
.stat-card-indigo .stat-title { color: #7c3aed; }
.stat-card-indigo .stat-value { color: var(--text-color); }

.stat-card-orange { border-left: 4px solid #f97316; text-decoration: none; }
.stat-card-orange .stat-title { color: #ea580c; }
.stat-card-orange .stat-value { color: var(--text-color); }

.stat-card-red { border-left: 4px solid #ef4444; text-decoration: none; }
.stat-card-red .stat-title { color: #dc2626; }
.stat-card-red .stat-value { color: var(--text-color); }

/* Badges específicos para estados de inscripciones */
.badge-warning { background: #fef08a; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.text-highlight { font-weight: bold; color: var(--primary-color); }
.text-strong { font-weight: 500; color: var(--text-color); }

/* ==========================================================================
   18. GESTIÓN DE INSCRIPCIONES (TABLAS Y MODALES)
   ========================================================================== */
/* Contenedores de Tablas */
.table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 3rem;
}
.table-section-title {
    font-size: 1.25rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid;
}
.title-pending { border-bottom-color: #eab308; }
.title-active { border-bottom-color: #16a34a; }
.title-rejected { border-bottom-color: #ef4444; }

/* Filas Destacadas */
.tr-rejected { background-color: #fef2f2; }
.tr-rejected td { border-bottom-color: #fca5a5; }

/* Formularios en Modales */
.modal-form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    box-sizing: border-box;
}
.modal-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.text-warning-bold {
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: bold;
    display: block;
    margin-top: 0.5rem;
}

/* ==========================================================================
   19. REPRODUCTOR DE CURSOS (ESTUDIANTE)
   ========================================================================== */
body.player-mode { overflow: hidden; }
body.player-mode main { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }

/* Contenedor Principal */
.player-layout { display: flex; height: calc(100vh - 65px); width: 100%; border-top: 1px solid var(--border-color); background: #f8fafc; font-family: var(--tenant-font, 'Segoe UI', system-ui, sans-serif); overflow: hidden; }

/* Barra Lateral (Temario) */
.player-sidebar { width: 320px; background: white; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; z-index: 10; transition: margin-left 0.3s ease; }
.player-sidebar.collapsed { margin-left: -320px; }
.sidebar-header { height: 85px; padding: 0 1.25rem; background: var(--primary-color, #0f172a); color: white; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.sidebar-content { overflow-y: auto; flex-grow: 1; padding: 0; }

.topic-group { border-bottom: 1px solid var(--border-color); }
.topic-title { padding: 0; background: #f8fafc; display: flex; justify-content: space-between; align-items: stretch; transition: background 0.2s; border-left: 4px solid transparent; }
.topic-title:hover { background: #f1f5f9; }
.topic-title.active-topic { background: #eff6ff; border-left-color: var(--primary-color); }
.topic-link { flex-grow: 1; padding: 1rem 1rem 1rem 1.25rem; font-weight: bold; color: var(--text-color); font-size: 0.95rem; text-decoration: none; }
.topic-title.active-topic .topic-link { color: var(--primary-color); }
.topic-toggle { padding: 1rem; cursor: pointer; display: flex; align-items: center; color: #94a3b8; }
.topic-toggle:hover { color: var(--primary-color); }
.topic-toggle .chevron { transition: transform 0.3s ease; }

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.5rem 0.85rem 2.5rem; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; border-top: 1px solid #f1f5f9; transition: all 0.2s; }
.lesson-link:hover { background: #f1f5f9; color: var(--primary-color); }
.lesson-link.active { background: #eff6ff; color: var(--primary-color); border-left: 4px solid var(--primary-color); font-weight: bold; padding-left: calc(2.5rem - 4px); }
.lesson-link.locked { color: #94a3b8; cursor: not-allowed; }
.lesson-link.locked:hover { background: transparent; color: #94a3b8; }

/* Área de Contenido Principal */
.player-main { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; background: #fff; scroll-behavior: smooth; }
.main-header { height: 85px; padding: 0 3rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: flex-start; background: white; position: sticky; top: 0; z-index: 5; flex-shrink: 0; }
.header-content { display: flex; flex-direction: column; gap: 0.2rem; }
.course-label { font-size: 0.9rem; font-weight: 800; color: var(--primary-color); text-transform: uppercase; letter-spacing: 0.02em; }
.main-header h2 { margin: 0; font-size: 1.15rem; color: var(--text-color); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; }
.breadcrumb-muted { color: var(--text-muted); font-weight: 500; cursor: pointer; text-decoration: none; transition: color 0.2s; }
.breadcrumb-muted:hover { color: var(--primary-color); }

.sidebar-action-btn { background: rgba(255, 255, 255, 0.15); color: white; padding: 0.6rem; font-size: 0.85rem; font-weight: bold; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; border: none; cursor: pointer;}
.sidebar-action-btn:hover { background: rgba(255, 255, 255, 0.25); color: white; }
.hidden-actions-container { display: none; align-items: center; gap: 0.5rem; margin-right: 1.5rem; border-right: 2px solid var(--border-color); padding-right: 1.5rem; }
.show-sidebar-btn { background: #f1f5f9; color: var(--primary-color); padding: 0.6rem; border-radius: 6px; border: none; cursor: pointer; display: inline-flex;}
.show-sidebar-btn:hover { background: #e2e8f0; }

.content-area { padding: 3rem 4rem; max-width: 1300px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.media-container { 
    width: 100%; 
    max-width: 1100px; 
    margin: 0 auto 2.5rem auto; 
    border-radius: 12px; 
    overflow: hidden; 
    background: #1e293b; /* <-- Cambiado de #000 al azul corporativo */
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); 
}
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe, .video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.audio-wrapper { 
    background: transparent; /* Deja que se vea el fondo azul del .media-container */
    padding: 4rem 2rem; 
    text-align: center; 
    color: white; 
}
.doc-wrapper { border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 4px 6px rgba(0,0,0,0.05); background: transparent; }

.text-content { max-width: 900px; margin: 0 auto; font-size: 1.05rem; line-height: 1.8; color: var(--text-color); }
.text-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.5rem 0; }

/* Grid de Actividades de la Unidad */
.activities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.activity-card { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; text-decoration: none; color: inherit; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; align-items: flex-start; gap: 1rem; }
.activity-card:hover { border-color: var(--primary-color); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transform: translateY(-2px); }
.activity-card.locked { opacity: 0.6; cursor: not-allowed; border-color: #cbd5e1; }
.activity-card.locked:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.activity-icon { background: #f1f5f9; padding: 0.75rem; border-radius: 8px; color: var(--primary-color); }
.activity-icon.locked { color: #94a3b8; background: #e2e8f0; }
.activity-info h4 { margin: 0 0 0.25rem 0; font-size: 1.05rem; color: var(--text-color); }
.activity-info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* Interacción (Comentarios / Aprendizaje) */
.lesson-interaction-section { max-width: 900px; margin: 3rem auto 0 auto; padding-top: 2.5rem; border-top: 1px solid var(--border-color); }
.interaction-title { display: flex; align-items: center; gap: 0.5rem; color: var(--text-color); font-size: 1.25rem; margin: 0 0 0.5rem 0; }
.interaction-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.privacy-badge { display: inline-flex; align-items: center; gap: 0.3rem; background: #fef3c7; color: #b45309; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.8rem; font-weight: bold; margin-bottom: 2rem; }

.comments-history { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem; }
.comment-student { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.comment-student .bubble { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 0 16px 16px 16px; padding: 1.25rem; color: var(--text-color); }
.comment-teacher { display: flex; flex-direction: column; align-items: flex-end; max-width: 85%; align-self: flex-end; margin-top: 0.5rem; }
.comment-teacher .bubble { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 16px 0 16px 16px; padding: 1.25rem; color: #1e3a8a; }
.comment-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.comment-meta .name { font-weight: bold; color: var(--text-color); }
.comment-meta .time { color: #94a3b8; }
.bubble p { margin: 0 0 0.5rem 0; line-height: 1.6; }
.bubble p:last-child { margin: 0; }

.editor-wrapper { border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); background: white; }
.ql-toolbar.ql-snow { border: none !important; border-bottom: 1px solid var(--border-color) !important; background: #f8fafc; font-family: inherit; }
.ql-container.ql-snow { border: none !important; font-family: inherit; font-size: 1.05rem; }
.ql-editor { min-height: 150px; }
.word-counter { font-size: 0.85rem; font-weight: bold; transition: color 0.2s; }
.btn-submit-comment { background: var(--primary-color); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: bold; transition: all 0.2s; display: inline-flex; align-items: center; font-size: 0.95rem; }
.btn-submit-comment:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); cursor: pointer; }

/* Navegación Inferior */
.lesson-navigation { max-width: 900px; margin: 4rem auto 2rem auto; padding-top: 2rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.btn-nav { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.5rem; border-radius: 8px; font-weight: bold; text-decoration: none; transition: all 0.2s; font-size: 0.95rem; }
.btn-prev { background: #f1f5f9; color: var(--text-muted); border: 1px solid #cbd5e1; }
.btn-prev:hover { background: #e2e8f0; color: var(--text-color); }
.btn-next { background: var(--primary-color); color: white; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.btn-next:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 8px -1px rgba(0,0,0,0.15); }
.btn-locked { background: #e2e8f0 !important; color: #94a3b8 !important; box-shadow: none !important; cursor: not-allowed !important; border: 1px solid #cbd5e1; }
.btn-locked:hover { transform: none !important; filter: none !important; }

/* Elementos de Examen */
.exam-badge { background: #eff6ff; color: #1e3a8a; display: inline-flex; align-items: center; padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: bold; margin-bottom: 1.5rem; border: 1px solid #bfdbfe; }
.exam-timer { position: sticky; top: 0; background: #fee2e2; color: #991b1b; padding: 1rem; border-radius: 8px; border: 1px solid #f87171; font-weight: bold; text-align: center; margin: 1.5rem 0; z-index: 10; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.exam-question-card { margin-bottom: 2.5rem; background: #f8fafc; padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); }
.exam-question-number { background: var(--border-color); padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.9rem; margin-right: 0.5rem; color: var(--text-color); }
.exam-option-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px; background: white; transition: background 0.2s; }
.exam-textarea { width: 100%; padding: 1rem; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 1rem; box-sizing: border-box; }

@media (max-width: 768px) {
    .player-layout { flex-direction: column; height: auto; min-height: calc(100vh - 65px); }
    .player-sidebar { width: 100%; border-bottom: 2px solid var(--border-color); height: auto; }
    .player-sidebar.collapsed { margin-left: -100%; }
    .main-header, .sidebar-header { height: auto; padding: 1rem 1.5rem; }
    .content-area { padding: 1.5rem; }
    .lesson-navigation { flex-direction: column; }
    .btn-nav { width: 100%; justify-content: center; text-align: center; }
    .hidden-actions-container { border-right: none; margin-right: 0.5rem; padding-right: 0.5rem; }
    .comment-student, .comment-teacher { max-width: 100%; }
}

/* ==========================================================================
   20. GESTIÓN DE EXÁMENES (OFFICE)
   ========================================================================== */
/* Builder de Exámenes (Preguntas) */
.builder-layout { display: grid; grid-template-columns: 1fr 400px; gap: 2rem; }
.score-panel { background: #e0e7ff; border: 1px solid #c7d2fe; padding: 1rem 1.5rem; border-radius: 8px; margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.score-total { color: #3730a3; font-size: 1.1rem; }
.score-passing { color: #4338ca; font-size: 1.1rem; background: #c7d2fe; padding: 0.2rem 0.8rem; border-radius: 999px; }
.question-card { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 1rem; position: relative; }
.question-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.question-badge { background: #f1f5f9; color: var(--text-muted); padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: bold; border: 1px solid #cbd5e1; }
.question-title { margin: 0 0 1rem 0; color: var(--text-color); font-size: 1.1rem; }
.question-options { margin: 0 0 1rem 0; padding-left: 1.5rem; color: var(--text-muted); }
.correct-answer-box { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 0.75rem; border-radius: 6px; color: #166534; font-size: 0.9rem; }
.form-sticky-panel { background: #f8fafc; padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); position: sticky; top: 2rem; }

/* Tabla de Exámenes e Intentos */
.exam-layout { display: grid; grid-template-columns: 1fr 350px; gap: 2rem; }
.exam-title-group { font-weight: 600; color: var(--text-color); }
.exam-meta-group { color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.text-success { color: #16a34a; font-weight: bold; }
.text-danger { color: #dc2626; font-weight: bold; }

/* Revisión de Exámenes */
.review-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.review-answer-card { background: white; border: 1px solid; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; border-left: 4px solid; }
.review-answer-correct { border-color: #bbf7d0; border-left-color: #22c55e; }
.review-answer-incorrect { border-color: #fecaca; border-left-color: #ef4444; }
.review-student-ans { background: #f8fafc; padding: 0.75rem; border-radius: 6px; color: var(--text-color); }
.review-correct-ans { background: #f0fdf4; padding: 0.75rem; border-radius: 6px; color: #166534; }
.verdict-panel { text-align: center; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.verdict-label { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; font-weight: bold; }
.verdict-score { font-size: 3rem; font-weight: bold; }
.verdict-badge { display: inline-block; padding: 0.25rem 1rem; border-radius: 999px; font-weight: bold; font-size: 0.85rem; margin-top: 0.5rem; }
.verdict-badge-pass { background: #dcfce7; color: #166534; }
.verdict-badge-fail { background: #fee2e2; color: #991b1b; }

.warning-panel { background: #fee2e2; padding: 1.5rem; border-radius: 6px; border: 1px solid #f87171; color: #991b1b; margin-bottom: 2rem; }
.retake-panel { background: #fffbeb; padding: 1.5rem; border-radius: 6px; border: 1px solid #fde68a; margin-bottom: 2rem; }

@media (max-width: 900px) {
    .builder-layout, .exam-layout, .review-layout { grid-template-columns: 1fr; }
    .form-sticky-panel { position: static; }
}

/* ==========================================================================
   21. ESTUDIANTES POR GRUPO (OFFICE)
   ========================================================================== */
.table-progress-container { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    width: 100%; 
    max-width: 200px; 
}
.table-progress-track { 
    width: 100%; 
    height: 8px; 
    background: #e2e8f0; 
    border-radius: 999px; 
    overflow: hidden; 
}
.table-progress-fill { 
    height: 100%; 
    border-radius: 999px; 
    transition: width 0.5s ease; 
}
.table-progress-text { 
    font-size: 0.85rem; 
    font-weight: bold; 
    color: var(--text-muted); 
    min-width: 35px; 
}

/* ==========================================================================
   22. UTILIDADES DE ESTADO Y ALINEACIÓN (GRUPOS)
   ========================================================================== */
.text-lg-strong { font-size: 1.05rem; font-weight: 600; color: var(--text-color); }
.text-sm-badge { font-size: 0.9rem; }
.dates-info { text-align: left; }
.dates-info strong { color: var(--text-color); }
.align-right { text-align: right; }
.no-margin { margin: 0 !important; }
.empty-state-cell { padding: 4rem 2rem; text-align: center; color: var(--text-muted); }

/* ==========================================================================
   23. BOTONES DE ACCIÓN ESPECÍFICOS (CONTACTO)
   ========================================================================== */
.btn-icon-whatsapp { color: #16a34a; background: #f0fdf4; }
.btn-icon-whatsapp:hover { background: #16a34a; color: white; border-color: #16a34a; }

.btn-icon-chat { color: #8b5cf6; background: #f5f3ff; }
.btn-icon-chat:hover { background: #8b5cf6; color: white; border-color: #8b5cf6; }

.btn-icon-email { color: #2563eb; background: #eff6ff; }
.btn-icon-email:hover { background: #2563eb; color: white; border-color: #2563eb; }

.btn-icon-profile { color: #475569; background: #f1f5f9; }
.btn-icon-profile:hover { background: #475569; color: white; border-color: #475569; }

/* ==========================================================================
   24. DIRECTORIO DE USUARIOS (ROLES Y BADGES)
   ========================================================================== */
.badge-role { padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: bold; display: inline-block; }
.role-super { background: #f1f5f9; color: #334155; }
.role-admin { background: #e0e7ff; color: #3730a3; }
.role-teacher { background: #fae8ff; color: #86198f; }
.role-student { background: #f0fdf4; color: #166534; }
.status-indicator { font-weight: bold; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.status-active { color: #16a34a; }
.status-inactive { color: #dc2626; }
.user-meta-info { color: #94a3b8; font-size: 0.80rem; margin-top: 0.2rem; }

/* ==========================================================================
   25. UTILIDADES DE SUSPENSIÓN Y REINCORPORACIÓN
   ========================================================================== */
.history-section { margin-top: 3rem; opacity: 0.95; }
.history-title { color: var(--text-muted); font-size: 1.25rem; margin: 0 0 0.25rem 0; }
.text-strike { text-decoration: line-through; color: var(--text-muted); }

.btn-suspend { color: #ef4444; background: #fef2f2; border: 1px solid #fecaca; padding: 0.4rem 0.8rem; border-radius: 4px; font-size: 0.85rem; font-weight: bold; display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; transition: all 0.2s; }
.btn-suspend:hover { background: #ef4444; color: white; }

.btn-restore { color: #10b981; background: #ecfdf5; border: 1px solid #a7f3d0; padding: 0.4rem 0.8rem; border-radius: 4px; font-size: 0.85rem; font-weight: bold; display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; transition: all 0.2s; }
.btn-restore:hover { background: #10b981; color: white; }

/* ==========================================================================
   26. PANEL DEL PROFESOR (DASHBOARD)
   ========================================================================== */
.dashboard-section-title { color: var(--text-color); font-size: 1.1rem; margin-bottom: 1rem; font-weight: 600; }

.actions-grid-flex { display: flex; gap: 1rem; margin-bottom: 2.5rem; }

.btn-action-outline { flex: 1; text-align: center; padding: 1rem; border: 1px solid var(--border-color); border-radius: 8px; text-decoration: none; color: var(--text-color); font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.2s; background: white; }
.btn-action-outline:hover { background: #f8fafc; border-color: var(--primary-color); color: var(--primary-color); }

.activity-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; margin-bottom: 2rem; }
.activity-card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); background: #f8fafc; }
.activity-card-header h3 { margin: 0; font-size: 1.1rem; color: #0f172a; }

.text-primary-strong { font-weight: 600; color: var(--primary-color); font-size: 0.9rem; }

.btn-respond { background: #eff6ff; color: var(--primary-color); padding: 0.4rem 0.8rem; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 0.85rem; display: inline-block; transition: background 0.2s; }
.btn-respond:hover { background: #dbeafe; }

/* ==========================================================================
   27. EVALUACIONES Y BLOQUES DE SECCIÓN
   ========================================================================== */
.dashboard-section-block { display: block; width: 100%; clear: both; margin-bottom: 2rem; }
.section-title-wrapper { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 0.5rem; }
.section-title-main { margin: 0; font-size: 1.2rem; color: #0f172a; font-weight: 700; }

.row-highlight-pending { border-left: 4px solid #f59e0b !important; background: #fffbeb; }
.badge-warning { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; font-weight: bold; }

.btn-action-sm { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.85rem; font-weight: bold; text-decoration: none; transition: all 0.2s; }
.btn-action-primary { background: #eff6ff; color: var(--primary-color); border: 1px solid #bfdbfe; }
.btn-action-primary:hover { background: var(--primary-color); color: white; }

/* ==========================================================================
   28. EVALUACIONES: ACORDEÓN DE RESPUESTAS
   ========================================================================== */
.row-reviewed { background-color: #f8fafc; border-bottom: 1px solid #e2e8f0; transition: background-color 0.2s; }
.row-reviewed:hover { background-color: #f1f5f9; }

.btn-icon-toggle { margin-left: 0.5rem; background-color: #e2e8f0; color: #475569; border: none; border-radius: 4px; padding: 0.4rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-icon-toggle:hover { background-color: #cbd5e1; color: #0f172a; }
.btn-icon-toggle svg { width: 16px; height: 16px; transition: transform 0.2s; }
.btn-icon-toggle.active svg { transform: rotate(180deg); }

.reply-row { background-color: #f1f5f9; }
.reply-row.hidden { display: none; }
.reply-cell { padding: 1.5rem 2rem !important; }

.reply-content-box { border-left: 4px solid var(--primary-color); padding-left: 1.25rem; }
.reply-header { font-size: 0.85rem; color: #64748b; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.reply-header strong { color: #0f172a; }
.reply-body { color: #334155; font-size: 0.95rem; line-height: 1.6; }
/* ==========================================================================
   29. MÓDULO: LIBROS INTERACTIVOS & EDITOR VISUAL
   ========================================================================== */
/* Formularios */
.form-card { background: #ffffff; padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); max-width: 800px; }
.form-group-spaced { margin-bottom: 1.5rem; }
.form-label-bold { font-weight: 600; display: block; margin-bottom: 0.5rem; color: #0f172a; }
.form-control-full { width: 100%; padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; }
.form-checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500; color: #334155; }
.form-actions-footer { display: flex; justify-content: flex-end; gap: 1rem; border-top: 1px solid #e2e8f0; padding-top: 1.5rem; margin-top: 2rem; }
.btn-outline { padding: 0.75rem 1.5rem; border: 1px solid #cbd5e1; background: #ffffff; border-radius: 6px; color: #334155; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-primary-large { padding: 0.75rem 2rem; background: #2563eb; color: #ffffff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.btn-primary-large:hover { background: #1d4ed8; }

/* Editor Visual (Builder) Layout */
.builder-layout { display: grid; grid-template-columns: 200px 1fr 250px; gap: 1rem; height: calc(100vh - 160px); min-height: 600px; margin-top: 1rem; }
.builder-panel { background: #ffffff; border: 1px solid var(--border-color); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.builder-panel-header { padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-weight: 600; color: #0f172a; display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; }
.builder-panel-body { padding: 1rem; overflow-y: auto; flex: 1; }

/* Botón de Subida Intuitivo */
.btn-upload-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 1.5rem 1rem; background: #eff6ff; color: #2563eb; border: 2px dashed #93c5fd; border-radius: 8px; cursor: pointer; transition: all 0.2s; margin-bottom: 1.5rem; }
.btn-upload-page:hover { background: #dbeafe; border-color: #3b82f6; }
.btn-upload-page svg { width: 24px; height: 24px; }
.btn-upload-page span { font-size: 0.85rem; font-weight: 600; text-align: center; }

/* Miniaturas y Drag & Drop */
.page-thumbnail { border: 2px solid transparent; border-radius: 6px; overflow: hidden; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.2s; position: relative; background: #f1f5f9; display: flex; align-items: center; justify-content: center; min-height: 80px; }
.page-thumbnail:hover { border-color: #cbd5e1; }
.page-thumbnail.active { border-color: #2563eb; outline: 2px solid rgba(37,99,235,0.2); }
.page-thumbnail img { width: 100%; max-height: 120px; object-fit: contain; display: block; }
.page-number-badge { position: absolute; top: 0.25rem; left: 0.25rem; background: rgba(15,23,42,0.8); color: white; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: bold; pointer-events: none; }

/* Acciones en Miniatura (Eliminar) */
.page-actions { position: absolute; top: 0.25rem; right: 0.25rem; display: none; gap: 0.25rem; flex-direction: column; }
.page-thumbnail:hover .page-actions { display: flex; }
.btn-thumb-action { background: rgba(15, 23, 42, 0.8); color: white; border: none; border-radius: 4px; padding: 0.25rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.btn-thumb-action:hover { background: #2563eb; }
.btn-thumb-delete { background: #ef4444; }
.btn-thumb-delete:hover { background: #b91c1c; }

/* ==========================================================================
   30. CORRECCIONES UI - LIBROS INTERACTIVOS
   ========================================================================== */
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: #64748b; text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; transition: color 0.2s; font-weight: 500; }
.back-link:hover { color: #0f172a; text-decoration: underline; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 1rem; }
.header-title-group h1 { margin: 0; font-size: 1.5rem; color: #0f172a; }
.header-button-group { display: flex; gap: 0.5rem; align-items: center; }
.dashboard-section-block, .activity-card { display: block; width: 100%; clear: both; margin-bottom: 2rem; }
.table-wrapper, .table-responsive { width: 100%; display: block; overflow-x: auto; }
.data-table { width: 100%; }

/* ==========================================================================
   31. LIENZO, PANEO Y ZOOM
   ========================================================================== */
.builder-workspace { background: #e2e8f0; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; border: 2px dashed #cbd5e1; padding: 1rem; }
.canvas-container { position: relative; background: #ffffff; width: 100%; max-width: 850px; margin: 0 auto; box-shadow: 0 10px 25px rgba(0,0,0,0.15); transform-origin: top center; transition: transform 0.2s ease-out; }
.canvas-bg-image { display: block; width: 100%; height: auto; pointer-events: none; }

/* Estados de la herramienta Mano (Paneo) */
.builder-workspace.pan-mode-active { cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='white' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 11.5V14m0-2.5v-6a1.5 1.5 0 1 1 3 0m-3 6a1.5 1.5 0 0 0-3 0v2a7.5 7.5 0 0 0 15 0v-5a1.5 1.5 0 0 0-3 0m-6-3V11m0-5.5v-1a1.5 1.5 0 0 1 3 0v1m0 0V11m0-5.5a1.5 1.5 0 0 1 3 0v3m0 0V11'/%3E%3C/svg%3E") 12 12, grab !important; }
.builder-workspace.pan-mode-dragging { cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%23cbd5e1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 11.5V14m0-2.5v-6a1.5 1.5 0 1 1 3 0m-3 6a1.5 1.5 0 0 0-3 0v2a7.5 7.5 0 0 0 15 0v-5a1.5 1.5 0 0 0-3 0m-6-3V11m0-5.5v-1a1.5 1.5 0 0 1 3 0v1m0 0V11m0-5.5a1.5 1.5 0 0 1 3 0v3m0 0V11'/%3E%3C/svg%3E") 12 12, grabbing !important; }

/* ==========================================================================
   CONTROLES FLOTANTES UNIFICADOS (ZOOM Y PAGINACIÓN)
   ========================================================================== */
/* La "Píldora" principal que contiene ambos paneles */
.floating-controls-wrapper { 
    position: absolute; 
    bottom: 1.5rem; 
    right: 1.5rem; 
    z-index: 1000; 
    display: inline-flex; 
    align-items: center; 
    background: #ffffff; 
    border: 1px solid #cbd5e1; 
    border-radius: 30px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    height: 48px; /* Alto unificado para todo el panel */
    padding: 0 0.5rem;
    overflow: hidden;
}

/* Sub-contenedores internos sin fondo (heredan el de la píldora) */
.zoom-controls { display: flex; align-items: center; height: 100%; }
.preview-pagination { display: flex; align-items: center; height: 100%; }

/* Divisor sutil entre Paginación y Zoom (solo se ve cuando hay paginación) */
.preview-pagination { border-right: 1px solid #e2e8f0; padding-right: 0.5rem; margin-right: 0.5rem; }

/* Botones unificados (Mismos estilos para flechas y lupas) */
.btn-zoom, .preview-pagination button { 
    background: transparent; 
    border: none; 
    padding: 0 0.75rem; 
    height: calc(100% - 10px); /* Deja un pequeño margen arriba y abajo */
    color: #475569; 
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: color 0.2s, background 0.2s; 
    border-radius: 20px;
}
.btn-zoom:hover, .preview-pagination button:hover { background: #f8fafc; color: #2563eb; }
.btn-zoom.active-tool { color: #2563eb; background: #f1f5f9; }
.preview-pagination button:disabled { color: #94a3b8; cursor: not-allowed; background: transparent; }

/* Textos indicadores unificados (100% y Página 1 de 3) */
.zoom-level-display, .preview-page-indicator { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #0f172a; 
    padding: 0 0.75rem; 
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap; /* Evita que el texto salte de línea */
}
.zoom-level-display { border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; min-width: 55px; justify-content: center; }

/* ==========================================================================
   32. WIDGETS INTERACTIVOS EN EL LIENZO
   ========================================================================== */
.tool-btn { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem 1rem; margin-bottom: 0.5rem; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 6px; cursor: grab; font-weight: 500; color: #475569; transition: all 0.2s; }
.tool-btn:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.tool-btn svg { width: 18px; height: 18px; }

.canvas-element { position: absolute; transform: translate(-50%, -50%); z-index: 10; border: 2px solid transparent; transition: box-shadow 0.2s, border-color 0.2s; }
.canvas-element.selected { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.3); }
.canvas-element[data-type="audio"] { border-radius: 50%; }
.canvas-element[data-type="input"] { border-radius: 4px; }

.resizer { width: 12px; height: 12px; background: #ffffff; border: 2px solid #2563eb; border-radius: 50%; position: absolute; right: -6px; bottom: -6px; cursor: se-resize; display: none; z-index: 20; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.canvas-element.selected .resizer { display: block; }

.audio-widget { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #ffffff; border-radius: 50%; padding: 10%; box-sizing: border-box; box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: grab; }
.audio-widget:active { cursor: grabbing; }
.audio-btn-toggle { width: 100%; height: 100%; border-radius: 50%; background: #2563eb; color: #ffffff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: background 0.2s; }
.audio-btn-toggle:hover { background: #1d4ed8; }
.audio-btn-toggle svg { width: 50%; height: 50%; fill: currentColor; }
.icon-container { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.text-widget-input { width: 100%; height: 100%; background: rgba(255, 255, 255, 0.85); border: 1px dashed #64748b; border-radius: 4px; padding: 0 0.5rem; box-sizing: border-box; font-family: inherit; color: #0f172a; font-size: 0.9rem; outline: none; pointer-events: none; }

/* ==========================================================================
   33. PANEL DE PROPIEDADES (EDITOR VISUAL)
   ========================================================================== */
.properties-divider { border-top: 1px solid #e2e8f0; margin: 1.5rem 0; }
.properties-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.properties-header h3 { margin: 0; font-size: 0.95rem; font-weight: 600; color: #0f172a; }
.prop-badge { background: #e2e8f0; color: #475569; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; }
.prop-label { display: block; font-size: 0.85rem; font-weight: 600; color: #334155; margin-bottom: 0.4rem; }
.prop-file-btn { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; color: #475569; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left;}
.prop-file-btn:hover { border-color: #2563eb; background: #eff6ff; color: #2563eb; }
.prop-file-btn svg { flex-shrink: 0; width: 16px; height: 16px; }
.btn-delete-widget { width: 100%; padding: 0.6rem; margin-top: 1rem; background: transparent; border: 1px solid #fca5a5; color: #ef4444; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-delete-widget:hover { background: #fef2f2; border-color: #ef4444; }

.prop-input { width: 100%; padding: 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.85rem; color: #334155; margin-bottom: 1rem; box-sizing: border-box; font-family: inherit; }
.prop-textarea { width: 100%; padding: 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.85rem; color: #334155; margin-bottom: 1rem; box-sizing: border-box; resize: vertical; min-height: 60px; font-family: inherit; }
.prop-input:focus, .prop-textarea:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.prop-checkbox-wrapper { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; cursor: pointer; padding: 0.5rem; background: #f8fafc; border-radius: 6px; border: 1px solid #e2e8f0; }
.prop-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: #2563eb; }
.prop-checkbox-label { font-size: 0.85rem; font-weight: 600; color: #334155; cursor: pointer; user-select: none; }
.mb-1 { margin-bottom: 1rem; }

/* Estado Bloqueado en el lienzo */
.canvas-element.locked { border-color: #94a3b8; outline: none; box-shadow: none; }
.canvas-element.locked.selected { border-style: dashed; box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3); cursor: not-allowed; }
.canvas-element.locked .resizer { display: none !important; }

/* ==========================================================================
   34. MODO VISTA PREVIA Y PAGINACIÓN ESTUDIANTE
   ========================================================================== */
body.preview-active .builder-panel { display: none !important; } 
body.preview-active .builder-layout { grid-template-columns: 1fr; margin-top: 0; height: calc(100vh - 100px); }

/* Ajuste del lienzo para hacer scroll de la hoja */
body.preview-active .builder-workspace { 
    display: block !important;
    text-align: center; 
    border: none; 
    background: #94a3b8; 
    padding: 2rem 1rem 7rem 1rem; 
    overflow: auto !important; 
}
body.preview-active .canvas-container { display: inline-block; text-align: left; }

/* Desactivar elementos de edición */
body.preview-active .canvas-element { border-color: transparent !important; box-shadow: none !important; cursor: default !important; pointer-events: none; }
body.preview-active .resizer { display: none !important; }

/* Reactivar clics en herramientas en Modo Estudiante */
body.preview-active .audio-widget, 
body.preview-active .audio-btn-toggle { pointer-events: auto; cursor: pointer; } 
body.preview-active .text-widget-input { pointer-events: auto; cursor: text; background: #ffffff; border: 2px solid #cbd5e1; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
body.preview-active .text-widget-input:focus { border-color: #2563eb; }

/* --- MAGIA DEL CENTRADO DE LA PÍLDORA UNIFICADA --- */
body.preview-active .floating-controls-wrapper {
    position: fixed;
    bottom: 30px; /* Suficiente margen para no tapar los créditos del footer */
    left: 50%;
    right: auto;
    transform: translateX(-50%); /* Centrado perfecto */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2); /* Sombra un poco más profunda para resaltar */
}

/* Ocultar la herramienta de la manito en la vista previa */
body.preview-active #btnPanTool { display: none; }
body.preview-active #btnPanTool + div { display: none; } /* Oculta la línea divisoria vertical que está al lado de la manito */

/* ==========================================================================
   DISEÑO DE PANTALLA DIVIDIDA (AUTH INSTITUTOS)
   ========================================================================== */
.split-auth-layout { display: flex; min-height: 100vh; background-color: #f8f9fa; }
.split-form-section { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.split-form-container { width: 100%; max-width: 450px; }
.split-image-section { flex: 1; background-size: cover; background-position: center; display: none; }
@media (min-width: 769px) { .split-image-section { display: block; } }

.auth-header-wrapper { text-align: center; margin-bottom: 2rem; }
.auth-logo-img { max-height: 80px; margin-bottom: 1rem; }
.auth-logo-text { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); margin-bottom: 1rem; }
.auth-main-title { margin: 0; font-size: 1.5rem; color: #1e293b; }
.auth-main-subtitle { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }

.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; color: #475569; font-size: 0.9rem; }
.form-input { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; }
.form-input:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
.error-text { color: #dc2626; font-size: 0.8rem; margin-top: 0.25rem; display: block; }

.auth-options-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.85rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--text-muted); }
.auth-link { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.btn-auth-submit { width: 100%; padding: 0.75rem; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: 600; transition: opacity 0.2s; }
.btn-auth-submit:hover { opacity: 0.9; }

.auth-footer-text { text-align: center; margin-top: 2rem; font-size: 0.9rem; color: var(--text-muted); }