/* ==========================================================================
   Aula Conectada - Sistema de Diseño & Estilos Modernos
   Inspirado en Google Classroom, con estética Glassmorphism,
   Auras de Aprendizaje animadas y Escala de Evaluación Chilena (1.0 a 7.0).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Paleta Base */
  --bg-app: #f4f6fb;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.82);
  --bg-secondary: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;

  /* Colores Principales */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;

  /* Textos */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Escala Chilena de Notas */
  --grade-blue-bg: #eff6ff;
  --grade-blue-text: #1d4ed8;
  --grade-blue-border: #93c5fd;

  --grade-pass-bg: #ecfdf5;
  --grade-pass-text: #047857;
  --grade-pass-border: #a7f3d0;

  --grade-red-bg: #fef2f2;
  --grade-red-text: #b91c1c;
  --grade-red-border: #fca5a5;

  /* Sombras y Elevaciones */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.25);

  /* Bordes Redondeados */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transición estándar */
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Reset y Tipografía
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand-title, .course-banner-title {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

code, pre, .mono-font {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Auras de Aprendizaje (Efectos Luminosos Dinámicos y Resplandor)
   ========================================================================== */
.aura-cosmos {
  --aura-color: #8b5cf6;
  --aura-glow: rgba(139, 92, 246, 0.7);
  --aura-bg: linear-gradient(135deg, #7c3aed, #c084fc);
}

.aura-creativity {
  --aura-color: #f59e0b;
  --aura-glow: rgba(245, 158, 11, 0.7);
  --aura-bg: linear-gradient(135deg, #ea580c, #fbbf24);
}

.aura-zen {
  --aura-color: #10b981;
  --aura-glow: rgba(16, 185, 129, 0.7);
  --aura-bg: linear-gradient(135deg, #059669, #34d399);
}

.aura-curiosity {
  --aura-color: #eab308;
  --aura-glow: rgba(234, 179, 8, 0.7);
  --aura-bg: linear-gradient(135deg, #ca8a04, #fde047);
}

.aura-ocean {
  --aura-color: #06b6d4;
  --aura-glow: rgba(6, 182, 212, 0.7);
  --aura-bg: linear-gradient(135deg, #0891b2, #38bdf8);
}

.aura-empathy {
  --aura-color: #ec4899;
  --aura-glow: rgba(236, 72, 153, 0.7);
  --aura-bg: linear-gradient(135deg, #db2777, #f472b6);
}

.aura-low-battery {
  --aura-color: #f97316;
  --aura-glow: rgba(239, 68, 68, 0.7);
  --aura-bg: linear-gradient(135deg, #ea580c, #ef4444);
}

/* Avatar con Aura Aplicada */
.avatar-aura-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.avatar-bubble {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #ffffff;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  user-select: none;
}

.avatar-bubble.large {
  width: 72px;
  height: 72px;
  font-size: 2.3rem;
}

.avatar-bubble.hero {
  width: 88px;
  height: 88px;
  font-size: 3rem;
}

.avatar-aura-ring {
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-full);
  background: var(--aura-bg, linear-gradient(135deg, #3b82f6, #60a5fa));
  z-index: 1;
  box-shadow: 0 0 14px var(--aura-glow, rgba(59, 130, 246, 0.5));
  animation: auraPulse 3.2s ease-in-out infinite alternate;
}

.avatar-aura-wrapper.large .avatar-aura-ring {
  inset: -4px;
  box-shadow: 0 0 22px var(--aura-glow, rgba(59, 130, 246, 0.6));
}

@keyframes auraPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.85;
    filter: blur(0.5px);
  }
  100% {
    transform: scale(1.04);
    opacity: 1;
    filter: blur(1.5px);
  }
}

/* Badge de Aura */
.aura-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--aura-bg);
  box-shadow: 0 2px 8px var(--aura-glow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Barra Superior de Navegación (Header)
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
}

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

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chilean-flag {
  font-size: 1rem;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Selector de Curso */
.course-selector-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.course-selector-box:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.course-select-native {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

/* Header Derecho: Conmutador Rápido y Usuario */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-tools-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-tool:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.role-switch-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* Botón de Cerrar Sesión Destacado */
.btn-logout {
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .btn-logout {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

html[data-theme="dark"] .btn-logout:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
}

@media (max-width: 768px) {
  .btn-logout .logout-label {
    display: none;
  }
  .btn-logout {
    padding: 7px 10px;
  }
}

/* Botón de Perfil Activo */
.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile-btn:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.user-profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* ==========================================================================
   Contenedor Principal & Banner de Curso
   ========================================================================== */
.app-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Banner de Google Classroom Modernizado */
.course-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e40af, #3b82f6 60%, #60a5fa);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: white;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
}

.course-hero-banner.theme-science {
  background: linear-gradient(135deg, #065f46, #10b981 60%, #34d399);
}

.course-hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.banner-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.course-code-tag {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.course-banner-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.course-banner-subject {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 12px;
}

.course-banner-details {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.88rem;
  opacity: 0.9;
  flex-wrap: wrap;
}

.banner-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-action-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.class-pin-card {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.class-pin-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.class-pin-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Barra de Pestañas (Sub-navegación estilo Classroom)
   ========================================================================== */
.nav-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary-border);
}

.tab-badge {
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.tab-badge.red {
  background: #ef4444;
}

/* ==========================================================================
   Contenido de Vistas (Tabs)
   ========================================================================== */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================================================
   Vista 1: Diario Mural Digital (Muro / Novedades)
   ========================================================================== */
.mural-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .mural-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar del Mural: Próximas Entregas y Acceso Rápido */
.mural-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.side-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.side-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.upcoming-task-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.upcoming-task-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.upcoming-task-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}

.upcoming-task-title:hover {
  color: var(--primary);
}

.upcoming-task-date {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tarjetas de Publicación del Mural */
.mural-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.publish-announcement-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.publish-announcement-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.publish-prompt-text {
  font-size: 0.94rem;
  color: var(--text-muted);
  flex: 1;
}

.mural-post-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.mural-post-card:hover {
  box-shadow: var(--shadow-md);
}

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

.post-author-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author-info {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.post-author-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-type-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.post-type-badge.urgente {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.post-type-badge.evento {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.post-type-badge.recurso {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.mural-post-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mural-post-content {
  font-size: 0.94rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-line;
}

/* Enlaces Externos y Recursos Adjuntos */
.attached-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.link-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.link-preview-card:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.link-preview-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.link-preview-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.link-preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-preview-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Vista 2: Tareas y Evaluaciones (Trabajo de Clase)
   ========================================================================== */
.tasks-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.tasks-title-group {
  display: flex;
  flex-direction: column;
}

.section-main-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

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

/* ==========================================================================
   Resumen Superior de Tareas y Ponderación (Adaptativo por Rol Docente / Estudiante)
   ========================================================================== */
.tasks-summary-overview-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  border-top: 4px solid var(--primary-color);
  transition: var(--transition);
}

.tasks-summary-overview-card:hover {
  box-shadow: var(--shadow-md);
}

.tasks-summary-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.tasks-summary-header-info h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tasks-summary-header-info p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.tasks-summary-global-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tasks-summary-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.tasks-summary-kpi-pill.accent {
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary-color);
  border-color: rgba(59, 130, 246, 0.25);
}

.tasks-summary-kpi-pill.success {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.tasks-summary-kpi-pill.warning {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
}

.tasks-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.task-summary-mini-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.task-summary-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
  background: white;
}

.task-summary-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.task-summary-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
}

.task-summary-metrics-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.task-summary-metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-summary-metric-line strong {
  color: var(--text-main);
  font-weight: 700;
}

.task-mini-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.task-mini-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.task-mini-progress-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.task-mini-progress-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.task-mini-progress-fill.blue  { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.task-mini-progress-fill.red   { background: linear-gradient(90deg, #ef4444, #dc2626); }

.task-summary-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.task-summary-status-pill.delivered {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.task-summary-status-pill.pending {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.task-summary-status-pill.graded {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.task-summary-status-pill.resubmitted {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.task-summary-footer-action {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.tasks-list-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Tarjeta de Tarea */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.task-card-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.task-type-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.task-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.task-meta-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.task-due-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.task-due-date.urgent {
  color: #dc2626;
}

.task-description {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 18px;
}

/* Sección de Rúbricas y Pautas dentro de la Tarea */
.task-rubric-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.rubric-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rubric-summary-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rubric-criteria-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.criteria-chip {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.criteria-chip strong {
  color: var(--primary);
}

/* Pie de Tarjeta de Tarea: Estado y Acciones */
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.task-submission-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.task-submission-status-pill.graded {
  background: var(--grade-blue-bg);
  color: var(--grade-blue-text);
  border: 1px solid var(--grade-blue-border);
}

.task-submission-status-pill.submitted {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.task-submission-status-pill.pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

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

/* ==========================================================================
   Vista 3: Calificaciones & Escala Chilena 7.0
   ========================================================================== */
.grades-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grades-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

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

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

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* Tabla de Calificaciones */
.grades-table-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.grades-table-wrapper {
  overflow-x: auto;
}

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

.grades-table th {
  background: var(--bg-secondary);
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.grades-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.grades-table tr:last-child td {
  border-bottom: none;
}

.grades-table tr:hover td {
  background: #f8fafc;
}

/* Insignias de Notas Chilenas */
.chilean-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chilean-grade-badge.grade-blue-dark {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.chilean-grade-badge.grade-blue {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.chilean-grade-badge.grade-blue-light {
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.chilean-grade-badge.grade-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.chilean-grade-badge.grade-empty {
  background: var(--bg-secondary);
  color: var(--text-light);
  border: 1px dashed var(--border-subtle);
  font-size: 0.85rem;
}

/* ==========================================================================
   Vista 4: Chat & Comunidad (Público e Individual)
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  min-height: 600px;
  overflow: hidden;
}

@media (max-width: 840px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle);
  }
}

.chat-sidebar {
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

.chat-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.chat-channels-list {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 4px;
  overflow-y: auto;
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.chat-channel-item:hover {
  background: #ffffff;
  border-color: var(--border-subtle);
}

.chat-channel-item.active {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.channel-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.channel-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.channel-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-preview {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Área de Conversación Activa */
.chat-main-area {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.chat-active-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-active-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-messages-scroll {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 460px;
}

/* Mensaje Individual */
.chat-msg-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 85%;
}

.chat-msg-row.own-message {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-bubble-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-row.own-message .msg-bubble-content {
  align-items: flex-end;
}

.msg-sender-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.msg-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.chat-msg-row.own-message .msg-bubble {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}

/* Barra de Entrada de Mensaje */
.chat-input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input-field {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.chat-input-field:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   Vista 5: Gestión de Estudiantes & Cuentas (Admin Docente sin Email)
   ========================================================================== */
.admin-students-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.info-banner-access {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.info-banner-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.info-banner-text {
  font-size: 0.88rem;
  color: #1e3a8a;
  line-height: 1.5;
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.student-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: var(--transition);
}

.student-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.student-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.student-cred-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.cred-item {
  display: flex;
  flex-direction: column;
}

.cred-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cred-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Vista 6: Mi Perfil & Selector de Aura de Aprendizaje
   ========================================================================== */
.profile-customizer-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-hero-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.auras-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.aura-option-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.aura-option-card:hover {
  border-color: var(--aura-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--aura-glow);
}

.aura-option-card.selected {
  border-color: var(--aura-color);
  background: #ffffff;
  box-shadow: 0 0 20px var(--aura-glow);
}

.aura-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aura-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.aura-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.aura-desc {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

/* Selector de Emojis */
.emoji-picker-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.emojis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.emoji-btn {
  font-size: 1.8rem;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover {
  background: #ffffff;
  transform: scale(1.18);
  box-shadow: var(--shadow-sm);
}

.emoji-btn.selected {
  background: #dbeafe;
  border-color: var(--primary);
  transform: scale(1.14);
}

/* ==========================================================================
   Modales & Diálogos Accesibles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card, #ffffff);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-main, #0f172a);
}

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

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-card, #ffffff);
  z-index: 2;
  color: var(--text-main, #0f172a);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: var(--transition);
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-secondary);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Formularios dentro del Modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Botones y Componentes Interactivos
   ========================================================================== */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* Toast de Notificaciones */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast-item.success {
  border-left-color: #10b981;
}

.toast-item.error {
  border-left-color: #ef4444;
}

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

/* ==========================================================================
   Adaptabilidad Responsiva
   ========================================================================== */
@media (max-width: 768px) {
  .main-header {
    padding: 10px 14px;
  }
  .course-hero-banner {
    padding: 24px 20px;
  }
  .course-banner-title {
    font-size: 1.6rem;
  }
  .app-container {
    padding: 16px 12px 60px;
  }
  .user-profile-name {
    display: none;
  }
}

/* ==========================================================================
   Integración Google Drive & Documentos Escolares
   ========================================================================== */
.btn-drive {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-drive:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.drive-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.drive-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.drive-picker-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.drive-picker-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
}

.drive-picker-card.selected {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.drive-badge-tag {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Inicio de Sesión y Registro con Google / Correo
   ========================================================================== */
.btn-google-auth {
  width: 100%;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google-auth:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.auth-divider-line {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.auth-divider-line::before, .auth-divider-line::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider-line:not(:empty)::before {
  margin-right: .75em;
}

.auth-divider-line:not(:empty)::after {
  margin-left: .75em;
}

/* ==========================================================================
   Gestión de Cursos y Eliminación Segura
   ========================================================================== */
.course-controls-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.danger-confirm-box {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: #991b1b;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.danger-confirm-title {
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-course-name-tag {
  background: #fee2e2;
  border: 1px dashed #ef4444;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  user-select: all;
}

/* ==========================================================================
   Moderación de Convivencia Escolar y Baneo en Chat
   ========================================================================== */
.chat-banned-alert {
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #991b1b;
  font-size: 0.88rem;
  font-weight: 600;
}

.ban-badge {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-ban-action {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ban-action:hover {
  background: #ef4444;
  color: white;
}

.btn-unban-action {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-unban-action:hover {
  background: #10b981;
  color: white;
}

/* ==========================================================================
   Agenda y Calendario del Curso
   ========================================================================== */
.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

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

.calendar-current-month {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 200px;
  text-align: center;
}

.calendar-view-toggles {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.cal-view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.cal-view-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.calendar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 0;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-collapse: collapse;
}

.calendar-day-cell {
  min-height: 105px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.calendar-day-cell:nth-child(7n) {
  border-right: none;
}

.calendar-day-cell:hover {
  background: #f8fafc;
}

.calendar-day-cell.other-month {
  background: #fafafa;
  color: var(--text-light);
  opacity: 0.6;
}

.calendar-day-cell.is-today {
  background: #eff6ff;
}

.calendar-day-cell.is-today .cal-day-number {
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cal-day-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.cal-day-badge {
  font-size: 0.68rem;
  background: var(--bg-secondary);
  padding: 1px 5px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-weight: 700;
}

.cal-event-pill {
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  transition: var(--transition);
}

.cal-event-pill:hover {
  filter: brightness(0.95);
  transform: translateX(1px);
}

.cal-event-pill.task {
  background: #fee2e2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

.cal-event-pill.evento {
  background: #dbeafe;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}

.cal-event-pill.hito {
  background: #dcfce7;
  color: #166534;
  border-left: 3px solid #10b981;
}

.cal-event-pill.academico {
  background: #f3e8ff;
  color: #6b21a8;
  border-left: 3px solid #a855f7;
}

/* Vista Lista Cronológica de la Agenda */
.agenda-list-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agenda-timeline-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.agenda-timeline-item:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.agenda-date-badge-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  text-align: center;
  min-width: 68px;
  display: flex;
  flex-direction: column;
}

.agenda-day-digit {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.agenda-month-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

/* Herramientas de Edición para Mural y Enlaces */
.post-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-link-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.quick-link-item-row:hover {
  background: var(--bg-secondary);
}

.quick-link-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.quick-link-item-row:hover .quick-link-actions {
  display: inline-flex;
}

/* ==========================================================================
   Controles del Docente en el Banner del Curso
   ========================================================================== */
.banner-teacher-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.banner-ctrl-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.banner-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

.banner-ctrl-btn.primary {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.banner-ctrl-btn.primary:hover {
  background: #f8fafc;
  color: var(--primary-dark);
}

/* ==========================================================================
   Panel de Perfil Global del Curso y Muestras Estadísticas
   ========================================================================== */
.course-global-profile-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.course-global-header-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

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

.global-header-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.global-stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.kpi-stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-stat-card.submissions::before { background: #3b82f6; }
.kpi-stat-card.missing::before { background: #f59e0b; }
.kpi-stat-card.grades::before { background: #10b981; }
.kpi-stat-card.support::before { background: #8b5cf6; }
.kpi-stat-card.concern::before { background: #ef4444; }

.kpi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.kpi-stat-card.submissions .kpi-icon-box { background: #eff6ff; color: #2563eb; }
.kpi-stat-card.missing .kpi-icon-box { background: #fffbeb; color: #d97706; }
.kpi-stat-card.grades .kpi-icon-box { background: #ecfdf5; color: #059669; }
.kpi-stat-card.support .kpi-icon-box { background: #f5f3ff; color: #7c3aed; }
.kpi-stat-card.concern .kpi-icon-box { background: #fef2f2; color: #dc2626; }

.kpi-value-digit {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.kpi-label-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-sub-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.6s ease;
}

/* Cuadrícula de Detalle Estadístico y Zonas */
.stats-breakdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .stats-breakdown-row {
    grid-template-columns: 1fr;
  }
}

.analytics-panel-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.analytics-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Barras de Distribución de Notas */
.distribution-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.distribution-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
}

.dist-range-label {
  min-width: 130px;
  font-weight: 700;
  color: var(--text-main);
}

.dist-bar-track {
  flex: 1;
  height: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.dist-bar-fill.sobresaliente { background: #3b82f6; }
.dist-bar-fill.bueno { background: #10b981; }
.dist-bar-fill.suficiente { background: #f59e0b; }
.dist-bar-fill.insuficiente { background: #ef4444; }

.dist-count-tag {
  min-width: 45px;
  text-align: right;
  font-weight: 800;
  color: var(--text-muted);
}

/* Tarjetas de Estudiantes en Alerta / Apoyo */
.student-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 12px;
}

.student-alert-item.danger {
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}

.student-alert-item.warning {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.student-alert-item.support {
  border-left: 4px solid #8b5cf6;
  background: #fbf9ff;
}

/* ==========================================================================
   Chips y Previsualización de Archivos Adjuntos en Tareas
   ========================================================================== */
.file-attach-chips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.file-attach-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.file-attach-chip:hover {
  border-color: var(--primary-border);
}

.file-attach-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.file-attach-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.file-attach-icon.drive {
  background: #e0f2fe;
}

.file-attach-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-attach-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-attach-remove-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-attach-remove-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ========================================================================
   ENFOQUE EVALUATIVO: PROCESO, PROGRESO Y CONSOLIDACIÓN + PONDERACIONES
   ======================================================================== */
.eval-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: var(--transition);
}

.eval-badge-proceso {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.eval-badge-progreso {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.eval-badge-consolidacion {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.task-weight-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.task-weight-pill.highlight {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Widget de Balance Evaluativo (Docente) */
.eval-balance-widget {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eval-balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.eval-balance-meter {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 9999px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.eval-meter-seg {
  height: 100%;
  transition: width 0.4s ease;
  position: relative;
}

.eval-meter-seg.seg-proceso {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.eval-meter-seg.seg-progreso {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.eval-meter-seg.seg-consolidacion {
  background: linear-gradient(90deg, #059669, #34d399);
}

.eval-balance-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.eval-legend-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eval-legend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eval-legend-avg {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.eval-legend-avg strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Botones rápidos de selección de ponderación */
.quick-weights-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-quick-weight {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-quick-weight:hover, .btn-quick-weight.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Estilos de desglose de notas ponderadas para estudiantes */
.student-weighted-breakdown-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   Integración Directa con Google Drive (Sesión Activa Google)
   ========================================================================== */
.drive-direct-bar {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drive-direct-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.drive-direct-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #166534;
}

.drive-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  animation: pulse-status 2s infinite ease-in-out;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.drive-quick-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.drive-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.drive-quick-chip:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.drive-quick-chip-icon {
  font-size: 1.1rem;
}

.drive-quick-chip-name {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.drive-quick-chip-add {
  font-size: 0.7rem;
  font-weight: 800;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Insignias de Reenvío / Trabajo Modificado */
.resubmission-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   Centro de Notificaciones en Tiempo Real (Campana y Modal)
   ========================================================================== */
.btn-notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, all 0.2s ease);
}

.btn-notification-bell:hover {
  background: var(--bg-hover, #f8fafc);
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.notification-badge-counter {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px white, 0 2px 5px rgba(239, 68, 68, 0.4);
  animation: notif-pulse 2s infinite ease-in-out;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.notification-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.notification-filter-btn {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.notification-filter-btn:hover {
  background: #e2e8f0;
  color: var(--text-main, #1e293b);
}

.notification-filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.notification-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(2px);
}

.notification-item.unread {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
}

.notification-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.notification-item-icon.chat {
  background: #ede9fe;
  color: #7c3aed;
}

.notification-item-icon.task {
  background: #dbeafe;
  color: #1d4ed8;
}

.notification-item-icon.submission {
  background: #fef3c7;
  color: #b45309;
}

.notification-item-icon.grade {
  background: #d1fae5;
  color: #047857;
}

.notification-item-content {
  flex: 1;
  overflow: hidden;
}

.notification-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.notification-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #475569);
  margin-top: 2px;
  line-height: 1.35;
}

.notification-item-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.notification-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #64748b);
}

/* ==========================================================================
   Modal de Revisión y Calificación de Entregas (Docente)
   ========================================================================== */
.modal-card.xlarge {
  max-width: 960px;
  width: 95%;
}

.review-task-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.review-stat-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
  text-align: center;
}

.review-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  line-height: 1.1;
}

.review-stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.review-roster-item {
  background: white;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition, all 0.2s ease);
}

.review-roster-item:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.review-roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.review-roster-student {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-roster-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.review-file-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  padding: 4px 8px;
  font-size: 0.76rem;
  color: var(--text-main, #1e293b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.review-file-preview-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.review-comment-box {
  background: var(--bg-secondary, #f8fafc);
  border-left: 3px solid #3b82f6;
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main, #334155);
  font-style: italic;
}

/* ==========================================================================
   Tarjetas de Compañeros vistas por Estudiantes (Seguridad y Privacidad)
   ========================================================================== */
.student-classmate-card {
  background: white;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition, all 0.2s ease);
}

.student-classmate-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.student-classmate-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   MODO NOCTURNO / DESCANSO VISUAL (Dark Mode)
   Diseñado para reducir fatiga ocular en jornadas escolares nocturnas
   ========================================================================== */
html[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-card: #111b2f;
  --bg-card-glass: rgba(17, 27, 47, 0.92);
  --bg-secondary: #192742;
  --border-subtle: #293d61;
  --border-hover: #456294;

  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-light: rgba(96, 165, 250, 0.18);
  --primary-border: rgba(96, 165, 250, 0.45);

  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  --accent-amber: #fde047;

  --text-main: #ffffff;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --text-inverse: #080d1a;

  /* =========================================================================
     Paleta de Calificaciones y Estados optimizada para Daltonismo (Deuteranopia,
     Protanopia, Tritanopia y Monocromatismo) con contraste WCAG AAA
     ========================================================================= */
  /* Sobresaliente (6.0 - 7.0): Oro Solar de alta luminancia */
  --grade-gold-bg: rgba(245, 158, 11, 0.25);
  --grade-gold-text: #fef08a;
  --grade-gold-border: #facc15;

  /* Aprobado (4.0 - 5.9): Azul Cielo Eléctrico (perceptiblemente distinto de tonos cálidos) */
  --grade-blue-bg: rgba(14, 165, 233, 0.22);
  --grade-blue-text: #7dd3fc;
  --grade-blue-border: #38bdf8;

  --grade-pass-bg: rgba(20, 184, 166, 0.22);
  --grade-pass-text: #5eead4;
  --grade-pass-border: #2dd4bf;

  /* Insuficiente (< 4.0): Coral / Rosa Magenta vivo con alto contraste y alerta */
  --grade-red-bg: rgba(244, 63, 94, 0.25);
  --grade-red-text: #ffe4e6;
  --grade-red-border: #fb7185;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 25px rgba(96, 165, 250, 0.4);
}

/* Transiciones suaves al cambiar de tema */
body, .app-header, .nav-tabs-bar, .modal-card, .task-card, .student-card,
.mural-card, .sidebar-card, .tasks-summary-overview-card, .task-summary-mini-card,
.form-input, .form-textarea, .form-select, select, input {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* Tipografía de Alto Contraste en Modo Nocturno */
html[data-theme="dark"] body {
  background-color: var(--bg-app);
  color: var(--text-main);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .side-card-title,
html[data-theme="dark"] .task-summary-card-title,
html[data-theme="dark"] .analytics-card-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .doc-viewer-paper-title,
html[data-theme="dark"] strong {
  color: #ffffff !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .task-desc,
html[data-theme="dark"] .mural-post-content {
  color: var(--text-muted);
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
  color: #f8fafc;
  font-weight: 600;
}

/* Cabecera y Navegación */
html[data-theme="dark"] .app-header {
  background: rgba(8, 13, 26, 0.94);
  border-bottom-color: #293d61;
}

html[data-theme="dark"] .nav-tabs-bar {
  background: #111b2f;
  border-bottom-color: #293d61;
}

html[data-theme="dark"] .tab-btn {
  color: #cbd5e1;
  font-weight: 600;
}

html[data-theme="dark"] .tab-btn:hover {
  color: #ffffff;
  background: #192742;
}

html[data-theme="dark"] .tab-btn.active {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.16);
  border-bottom-color: #60a5fa;
  font-weight: 700;
}

/* Modales y Controles de Ventanas Emergentes (Fondo Oscuro + Títulos en Blanco Alto Contraste) */
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .modal-overlay .modal-card,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .modal-overlay .modal-card.large,
html[data-theme="dark"] .modal-overlay .modal-card.xlarge,
html[data-theme="dark"] #modalCourseForm .modal-card,
html[data-theme="dark"] #modalTaskCreate .modal-card,
html[data-theme="dark"] #modalTaskSubmit .modal-card,
html[data-theme="dark"] #modalTaskEdit .modal-card,
html[data-theme="dark"] #modalReviewSubmissions .modal-card,
html[data-theme="dark"] #modalGradeSubmission .modal-card,
html[data-theme="dark"] #modalStudentForm .modal-card,
html[data-theme="dark"] #modalStudentBatchForm .modal-card,
html[data-theme="dark"] #modalMuralPostForm .modal-card,
html[data-theme="dark"] #modalGradesCalculator .modal-card,
html[data-theme="dark"] #modalSwitchUser .modal-card,
html[data-theme="dark"] #modalNotifications .modal-card,
html[data-theme="dark"] #modalGoogleDrivePicker .modal-card,
html[data-theme="dark"] #modalCourseDelete .modal-card,
html[data-theme="dark"] #modalTeacherAccount .modal-card,
html[data-theme="dark"] #modalMuralPostEdit .modal-card,
html[data-theme="dark"] #modalEventForm .modal-card,
html[data-theme="dark"] #modalQuickLinkForm .modal-card,
html[data-theme="dark"] #modalDayAgendaDetails .modal-card,
html[data-theme="dark"] #modalDocumentViewer .modal-card {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border: 1.5px solid #243859 !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
}

html[data-theme="dark"] .modal-overlay .modal-header,
html[data-theme="dark"] .modal-card .modal-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] #modalCourseForm .modal-header,
html[data-theme="dark"] #modalTaskCreate .modal-header,
html[data-theme="dark"] #modalTaskSubmit .modal-header,
html[data-theme="dark"] #modalTaskEdit .modal-header,
html[data-theme="dark"] #modalReviewSubmissions .modal-header,
html[data-theme="dark"] #modalGradeSubmission .modal-header,
html[data-theme="dark"] #modalStudentForm .modal-header,
html[data-theme="dark"] #modalStudentBatchForm .modal-header,
html[data-theme="dark"] #modalMuralPostForm .modal-header,
html[data-theme="dark"] #modalGradesCalculator .modal-header,
html[data-theme="dark"] #modalSwitchUser .modal-header,
html[data-theme="dark"] #modalNotifications .modal-header,
html[data-theme="dark"] #modalGoogleDrivePicker .modal-header,
html[data-theme="dark"] #modalCourseDelete .modal-header,
html[data-theme="dark"] #modalTeacherAccount .modal-header,
html[data-theme="dark"] #modalMuralPostEdit .modal-header,
html[data-theme="dark"] #modalEventForm .modal-header,
html[data-theme="dark"] #modalQuickLinkForm .modal-header,
html[data-theme="dark"] #modalDayAgendaDetails .modal-header,
html[data-theme="dark"] #modalDocumentViewer .modal-header {
  background: #0b1120 !important;
  background-color: #0b1120 !important;
  border-bottom: 1px solid #243859 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .modal-overlay .modal-title,
html[data-theme="dark"] .modal-card .modal-title,
html[data-theme="dark"] .modal-header .modal-title,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] #courseFormModalTitle,
html[data-theme="dark"] #submitModalHeaderTitle,
html[data-theme="dark"] #reviewTaskModalTitle,
html[data-theme="dark"] #eventFormModalTitle,
html[data-theme="dark"] #quickLinkFormModalTitle,
html[data-theme="dark"] #dayDetailsDateTitle,
html[data-theme="dark"] #docViewerTitle,
html[data-theme="dark"] #modalCourseForm .modal-title,
html[data-theme="dark"] #modalTaskCreate .modal-title,
html[data-theme="dark"] #modalTaskSubmit .modal-title,
html[data-theme="dark"] #modalTaskEdit .modal-title,
html[data-theme="dark"] #modalReviewSubmissions .modal-title,
html[data-theme="dark"] #modalGradeSubmission .modal-title,
html[data-theme="dark"] #modalStudentForm .modal-title,
html[data-theme="dark"] #modalStudentBatchForm .modal-title,
html[data-theme="dark"] #modalMuralPostForm .modal-title,
html[data-theme="dark"] #modalGradesCalculator .modal-title,
html[data-theme="dark"] #modalSwitchUser .modal-title,
html[data-theme="dark"] #modalNotifications .modal-title,
html[data-theme="dark"] #modalGoogleDrivePicker .modal-title,
html[data-theme="dark"] #modalTeacherAccount .modal-title,
html[data-theme="dark"] #modalMuralPostEdit .modal-title,
html[data-theme="dark"] #modalEventForm .modal-title,
html[data-theme="dark"] #modalQuickLinkForm .modal-title,
html[data-theme="dark"] #modalDayAgendaDetails .modal-title,
html[data-theme="dark"] #modalDocumentViewer .modal-title,
html[data-theme="dark"] .modal-header h1,
html[data-theme="dark"] .modal-header h2,
html[data-theme="dark"] .modal-header h3,
html[data-theme="dark"] .modal-header h4,
html[data-theme="dark"] .modal-title span,
html[data-theme="dark"] .modal-title strong,
html[data-theme="dark"] .modal-header span,
html[data-theme="dark"] .modal-header strong {
  color: #ffffff !important;
  background: transparent !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .modal-title[style*="color: #dc2626"],
html[data-theme="dark"] .modal-title.danger,
html[data-theme="dark"] #modalCourseDelete .modal-title,
html[data-theme="dark"] #modalCourseDelete h3 {
  color: #ff8095 !important;
}

html[data-theme="dark"] .modal-header p,
html[data-theme="dark"] .modal-header small,
html[data-theme="dark"] .modal-header .modal-subtitle,
html[data-theme="dark"] .modal-header span[style*="color: var(--text-muted)"],
html[data-theme="dark"] #reviewTaskModalSubtitle,
html[data-theme="dark"] #notificationsSubtitleCount {
  color: #93c5fd !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .modal-body {
  background-color: #0f172a !important;
  color: #e2e8f0;
}

html[data-theme="dark"] .modal-overlay .modal-footer,
html[data-theme="dark"] .modal-card .modal-footer,
html[data-theme="dark"] .modal-footer {
  background-color: #0b1120 !important;
  border-top: 1px solid #243859 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-close-modal {
  color: #94a3b8 !important;
  background: transparent !important;
}

html[data-theme="dark"] .btn-close-modal:hover {
  color: #ffffff !important;
  background: #1e293b !important;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] select,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="password"] {
  background: #0d1525;
  border-color: #3b537d;
  color: #ffffff;
}

html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-textarea:focus,
html[data-theme="dark"] .form-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #94a3b8;
}

/* Tarjetas y Contenedores */
html[data-theme="dark"] .task-card,
html[data-theme="dark"] .student-card,
html[data-theme="dark"] .student-classmate-card,
html[data-theme="dark"] .mural-card,
html[data-theme="dark"] .sidebar-card,
html[data-theme="dark"] .tasks-summary-overview-card,
html[data-theme="dark"] .task-summary-mini-card,
html[data-theme="dark"] .kpi-stat-card,
html[data-theme="dark"] .calendar-container-card,
html[data-theme="dark"] .grades-matrix-container,
html[data-theme="dark"] .chat-card {
  background: #111b2f;
  border-color: #293d61;
  color: #ffffff;
}

html[data-theme="dark"] .task-summary-metrics-box {
  background: #0d1525;
  border-color: #243654;
}

html[data-theme="dark"] .task-summary-footer-action {
  border-top-color: #243654;
}

html[data-theme="dark"] .task-mini-progress-track {
  background: #192742;
  border: 1px solid #293d61;
}

/* =========================================================================
   INSIGNIAS DE NOTAS CHILENAS (ESCALA 1.0 A 7.0) ACCESIBLES PARA DALTONISMO
   Diferenciadas por Luminancia, Color Universal (CUD) y Borde Alto Contraste
   ========================================================================= */
html[data-theme="dark"] .chilean-grade-badge {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 6.0 a 7.0 Sobresaliente: Oro Solar con borde amarillo visible para todos */
html[data-theme="dark"] .chilean-grade-badge.grade-blue-dark {
  background: rgba(245, 158, 11, 0.28);
  color: #fef08a;
  border: 1.5px solid #facc15;
}

/* 5.0 a 5.9 Bueno: Azul Cielo Eléctrico */
html[data-theme="dark"] .chilean-grade-badge.grade-blue {
  background: rgba(14, 165, 233, 0.24);
  color: #7dd3fc;
  border: 1.5px solid #38bdf8;
}

/* 4.0 a 4.9 Suficiente: Cyan / Turquesa Luminoso */
html[data-theme="dark"] .chilean-grade-badge.grade-blue-light {
  background: rgba(20, 184, 166, 0.24);
  color: #5eead4;
  border: 1.5px solid #2dd4bf;
}

/* < 4.0 Insuficiente (Nota Roja): Coral / Rosa Magenta vivo con advertencia visual */
html[data-theme="dark"] .chilean-grade-badge.grade-red {
  background: rgba(244, 63, 94, 0.28);
  color: #ffe4e6;
  border: 1.5px solid #fb7185;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.35);
}

html[data-theme="dark"] .chilean-grade-badge.grade-empty {
  background: #192742;
  color: #cbd5e1;
  border: 1.5px dashed #475569;
}

/* =========================================================================
   PÍLDORAS DE ESTADO DE ENTREGA (Cyan vs Naranja: Máximo Contraste Daltonismo)
   ========================================================================= */
html[data-theme="dark"] .task-summary-status-pill.delivered,
html[data-theme="dark"] .task-submission-status-pill.submitted {
  background: rgba(20, 184, 166, 0.24);
  color: #5eead4;
  border: 1.5px solid #14b8a6;
}

html[data-theme="dark"] .task-summary-status-pill.pending,
html[data-theme="dark"] .task-submission-status-pill.pending {
  background: rgba(249, 115, 22, 0.26);
  color: #fed7aa;
  border: 1.5px solid #f97316;
  font-weight: 800;
}

html[data-theme="dark"] .task-summary-status-pill.graded,
html[data-theme="dark"] .task-submission-status-pill.graded {
  background: rgba(168, 85, 247, 0.24);
  color: #e9d5ff;
  border: 1.5px solid #a855f7;
}

html[data-theme="dark"] .task-summary-status-pill.resubmitted {
  background: rgba(234, 179, 8, 0.24);
  color: #fef08a;
  border: 1.5px solid #eab308;
}

/* =========================================================================
   CATEGORÍAS DE EVALUACIÓN (DECRETO 67) ACCESIBLES
   ========================================================================= */
html[data-theme="dark"] .eval-badge-proceso {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1.5px solid #38bdf8;
}

html[data-theme="dark"] .eval-badge-progreso {
  background: rgba(245, 158, 11, 0.24);
  color: #fde047;
  border: 1.5px solid #f59e0b;
}

html[data-theme="dark"] .eval-badge-consolidacion {
  background: rgba(168, 85, 247, 0.24);
  color: #e9d5ff;
  border: 1.5px solid #c084fc;
}

html[data-theme="dark"] .task-weight-pill {
  background: #192742;
  color: #ffffff;
  border: 1.5px solid #3b537d;
}

html[data-theme="dark"] .task-weight-pill.highlight {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border-color: #60a5fa;
}

/* Calendario y Agenda */
html[data-theme="dark"] .calendar-day-cell {
  background: #111b2f;
  border-color: #293d61;
  color: #ffffff;
}

html[data-theme="dark"] .calendar-day-cell.other-month {
  background: #080d1a;
  opacity: 0.45;
  color: #64748b;
}

html[data-theme="dark"] .calendar-day-cell.today {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
}

html[data-theme="dark"] .calendar-weekday-header {
  background: #192742;
  color: #cbd5e1;
  font-weight: 700;
  border-color: #293d61;
}

/* Tabla de Calificaciones y Matrices */
html[data-theme="dark"] .grades-matrix-table th {
  background: #192742;
  color: #ffffff;
  font-weight: 700;
  border-color: #293d61;
}

html[data-theme="dark"] .grades-matrix-table td {
  border-color: #293d61;
  background: #111b2f;
  color: #ffffff;
}

html[data-theme="dark"] .grades-matrix-table tr:hover td {
  background: #192742;
}

/* Previsualización de Enlaces y Chips de Archivos */
html[data-theme="dark"] .link-preview-card,
html[data-theme="dark"] .review-file-preview-chip {
  background: #192742;
  border-color: #3b537d;
  color: #ffffff;
}

html[data-theme="dark"] .review-file-preview-chip:hover {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.2);
}

html[data-theme="dark"] .review-roster-item,
html[data-theme="dark"] .review-student-roster-item {
  background: #111b2f;
  border-color: #293d61;
}

html[data-theme="dark"] .review-roster-item:hover,
html[data-theme="dark"] .review-student-roster-item:hover {
  background: #192742;
}

html[data-theme="dark"] .review-comment-box {
  background: #0d1525;
  border-color: #293d61;
  color: #e2e8f0;
}

html[data-theme="dark"] .tasks-summary-kpi-pill {
  background: #192742;
  border-color: #293d61;
  color: #ffffff;
}

html[data-theme="dark"] .rubric-grade-item {
  background: #192742 !important;
  border-color: #293d61 !important;
}

html[data-theme="dark"] .btn-secondary {
  background: #192742;
  border-color: #3b537d;
  color: #ffffff;
}

html[data-theme="dark"] .btn-secondary:hover {
  background: #24385e;
  border-color: #60a5fa;
}

/* =========================================================================
   BOTONES DEL BANNER HERO Y HERRAMIENTAS EN MODO NOCTURNO
   (Fondo Oscuro Sólido + Bordes Definidos + Textos e Iconos en Blanco)
   ========================================================================= */
html[data-theme="dark"] .course-hero-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border: 1.5px solid #293d61 !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .course-banner-title {
  color: #ffffff !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .course-banner-subject,
html[data-theme="dark"] .banner-detail-item {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .course-code-tag {
  background: rgba(56, 189, 248, 0.22) !important;
  border: 1px solid #38bdf8 !important;
  color: #7dd3fc !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .class-pin-card {
  background: #111b2f !important;
  border: 1.5px solid #2e446d !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .class-pin-label {
  color: #93c5fd !important;
}

html[data-theme="dark"] .class-pin-code {
  color: #ffffff !important;
  background: #1a2744 !important;
  border: 1px solid #3b537d !important;
}

html[data-theme="dark"] .banner-ctrl-btn {
  background: #192742 !important;
  border: 1.5px solid #334a73 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .banner-ctrl-btn:hover {
  background: #24385e !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25) !important;
}

html[data-theme="dark"] .banner-ctrl-btn.primary {
  background: #2563eb !important;
  border: 1.5px solid #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45) !important;
}

html[data-theme="dark"] .banner-ctrl-btn.primary:hover {
  background: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

html[data-theme="dark"] .btn-tool {
  background: #192742 !important;
  border: 1.5px solid #2e446d !important;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .btn-tool:hover {
  background: #24385e !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #192742 !important;
  color: #fde047 !important;
  border: 1.5px solid #3b537d !important;
}

html[data-theme="dark"] .btn-theme-toggle:hover {
  background: #24385e !important;
  border-color: #fde047 !important;
}

/* =========================================================================
   CHAT, COMUNIDAD Y CONVERSACIONES EN MODO NOCTURNO
   ========================================================================= */
html[data-theme="dark"] .chat-main-area {
  background: #111b2f;
}

html[data-theme="dark"] .chat-sidebar {
  background: #0d1525;
  border-color: #293d61;
}

html[data-theme="dark"] .chat-sidebar-header {
  background: #111b2f;
  border-color: #293d61;
}

html[data-theme="dark"] .chat-channel-item:hover {
  background: #192742;
  border-color: #293d61;
}

html[data-theme="dark"] .chat-channel-item.active {
  background: #192742;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.25);
}

html[data-theme="dark"] .msg-bubble {
  background: #192742;
  border-color: #2e446d;
  color: #f8fafc;
}

html[data-theme="dark"] .chat-msg-row.own-message .msg-bubble {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #3b82f6;
}

html[data-theme="dark"] .msg-sender-header {
  color: #93c5fd;
}

html[data-theme="dark"] .msg-sender-header span:first-child {
  color: #ffffff;
  font-weight: 700;
}

html[data-theme="dark"] .channel-preview {
  color: #94a3b8;
}

html[data-theme="dark"] .chat-channel-item.active .channel-preview {
  color: #cbd5e1;
}

html[data-theme="dark"] .chat-channel-item.active .channel-name {
  color: #ffffff;
}

html[data-theme="dark"] .chat-input-bar {
  border-top-color: #293d61;
  background: #111b2f;
}

html[data-theme="dark"] .chat-input-field {
  background: #192742;
  border-color: #293d61;
  color: #ffffff;
}

html[data-theme="dark"] .chat-input-field:focus {
  background: #0d1525;
  border-color: #60a5fa;
}

/* =========================================================================
   CENTRO DE NOTIFICACIONES EN MODO NOCTURNO (Fondo Oscuro y Textos Claros)
   ========================================================================= */
html[data-theme="dark"] #modalNotifications .modal-card {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75) !important;
}

html[data-theme="dark"] #modalNotifications .modal-header {
  background: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #modalNotifications .modal-title {
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] #modalNotifications .modal-body {
  background: #0b1120 !important;
}

html[data-theme="dark"] #modalNotifications .modal-footer {
  background: #0f172a !important;
  border-top: 1px solid #1e293b !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] #modalNotifications .modal-footer span {
  color: #94a3b8 !important;
}

/* Botón de campana de notificaciones en la barra superior */
html[data-theme="dark"] .btn-notification-bell {
  background: #192742 !important;
  border-color: #2e446d !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-notification-bell:hover {
  background: #24385e !important;
  border-color: #60a5fa !important;
}

html[data-theme="dark"] .notification-bell-label {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .notification-badge-counter {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px #0f172a, 0 2px 8px rgba(239, 68, 68, 0.6) !important;
}

/* Lista de notificaciones */
html[data-theme="dark"] .notification-list {
  background: transparent !important;
}

/* Tarjetas individuales de notificación: Fondo oscuro con bordes y textos claros */
html[data-theme="dark"] .notification-item {
  background: #131d33 !important;
  border: 1.5px solid #233554 !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .notification-item:hover {
  background: #1b2947 !important;
  border-color: #3b537d !important;
  transform: translateX(3px);
}

html[data-theme="dark"] .notification-item.unread {
  background: #16264a !important;
  border: 1.5px solid #38bdf8 !important;
  border-left: 4px solid #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2) !important;
}

html[data-theme="dark"] .notification-item.unread:hover {
  background: #1e3361 !important;
  border-color: #60a5fa !important;
  border-left-color: #60a5fa !important;
}

html[data-theme="dark"] .notification-item-title {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

html[data-theme="dark"] .notification-item-desc,
html[data-theme="dark"] .notification-item-msg {
  color: #e2e8f0 !important;
  font-size: 0.85rem !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] .notification-item-time {
  color: #93c5fd !important;
  font-weight: 600 !important;
  font-size: 0.74rem !important;
  background: rgba(147, 197, 253, 0.12) !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
}

html[data-theme="dark"] .notification-unread-dot {
  width: 9px;
  height: 9px;
  background: #38bdf8 !important;
  box-shadow: 0 0 10px #38bdf8 !important;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

html[data-theme="dark"] .notification-item.unread::before {
  background: #38bdf8 !important;
  box-shadow: 0 0 8px #38bdf8 !important;
}

/* Iconos de notificaciones con fondo oscuro translúcido y colores vivos */
html[data-theme="dark"] .notification-item-icon.chat {
  background: rgba(168, 85, 247, 0.3) !important;
  color: #e9d5ff !important;
  border: 1px solid #c084fc !important;
}

html[data-theme="dark"] .notification-item-icon.task {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #bae6fd !important;
  border: 1px solid #38bdf8 !important;
}

html[data-theme="dark"] .notification-item-icon.submission {
  background: rgba(245, 158, 11, 0.3) !important;
  color: #fef08a !important;
  border: 1px solid #facc15 !important;
}

html[data-theme="dark"] .notification-item-icon.grade {
  background: rgba(20, 184, 166, 0.3) !important;
  color: #a7f3d0 !important;
  border: 1px solid #2dd4bf !important;
}

/* Botones de filtros */
html[data-theme="dark"] .notification-filters {
  border-bottom: 1px solid #1e293b;
  padding-bottom: 8px;
}

html[data-theme="dark"] .notification-filter-btn {
  background: #162238 !important;
  border: 1.5px solid #283a5e !important;
  color: #f1f5f9 !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .notification-filter-btn:hover {
  background: #223456 !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .notification-filter-btn.active {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45) !important;
}

html[data-theme="dark"] #notificationsSubtitleCount {
  color: #93c5fd !important;
  font-weight: 600 !important;
}

/* Estado vacío de notificaciones */
html[data-theme="dark"] .notification-empty-state {
  color: #cbd5e1 !important;
  background: #131d33 !important;
  border: 1px dashed #233554 !important;
  border-radius: var(--radius-md, 10px) !important;
  padding: 32px 20px !important;
}

html[data-theme="dark"] .notification-empty-state p {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .notification-empty-state p:first-of-type {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Tarjetas de Auras y Emojis */
html[data-theme="dark"] .aura-option-card.selected {
  background: #192742 !important;
  border-color: var(--aura-color) !important;
}

html[data-theme="dark"] .aura-desc {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .emoji-picker-container {
  background: #111b2f;
  border-color: #293d61;
}

/* Integración Google Drive y Autenticación */
html[data-theme="dark"] .drive-picker-card:hover {
  background: #192742;
  border-color: #60a5fa;
}

html[data-theme="dark"] .drive-picker-card.selected {
  background: #1d3154;
  border-color: #60a5fa;
}

html[data-theme="dark"] .drive-badge-tag {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

html[data-theme="dark"] .btn-google-auth {
  background: #192742;
  color: #ffffff;
  border-color: #293d61;
}

html[data-theme="dark"] .btn-google-auth:hover {
  background: #24385e;
  border-color: #60a5fa;
}

/* =========================================================================
   VISOR DE DOCUMENTOS EN MODO NOCTURNO (Descanso Visual sin deslumbramiento)
   ========================================================================= */
html[data-theme="dark"] .doc-viewer-paper {
  background: #111b2f;
  color: #ffffff;
  border: 1px solid #293d61;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .doc-viewer-paper-title {
  color: #ffffff;
}

html[data-theme="dark"] .doc-viewer-section-title {
  color: #60a5fa;
  border-left-color: #60a5fa;
}

html[data-theme="dark"] .doc-viewer-text {
  color: #e2e8f0;
}

html[data-theme="dark"] .doc-viewer-schematic-box {
  background: #0c1424;
  border-color: #293d61;
}

html[data-theme="dark"] .doc-viewer-paper-meta {
  color: #cbd5e1;
}

html[data-theme="dark"] .doc-viewer-school-badge {
  color: #93c5fd;
}

/* =========================================================================
   SOBRESCRITURA DE ELEMENTOS CON ESTILOS INLINE PARA MÁXIMA ACCESIBILIDAD
   ========================================================================= */
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#ffffff"] {
  background: #111b2f !important;
  border-color: #293d61 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] [style*="color: #15803d"],
html[data-theme="dark"] [style*="color: #166534"],
html[data-theme="dark"] [style*="color: #059669"] {
  color: #5eead4 !important;
  font-weight: 700;
}

html[data-theme="dark"] [style*="color: #dc2626"],
html[data-theme="dark"] [style*="color: #b91c1c"] {
  color: #ff8095 !important;
  font-weight: 700;
}

html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color: #334155"] {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] [style*="background: #fee2e2"] {
  background: rgba(244, 63, 94, 0.25) !important;
  color: #ffe4e6 !important;
}

html[data-theme="dark"] [style*="background: #dcfce7"] {
  background: rgba(20, 184, 166, 0.25) !important;
  color: #5eead4 !important;
}

html[data-theme="dark"] [style*="background: #eff6ff"] {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #e0f2fe !important;
}

html[data-theme="dark"] [style*="background: #f1f5f9"] {
  background: #192742 !important;
  color: #ffffff !important;
}

/* =========================================================================
   CALCULADORA DE NOTAS ESCALA CHILENA EN MODO NOCTURNO
   (Fondo Azul Marino Nocturno + Detalles y Borde en Azul Cielo / Cyan)
   ========================================================================= */
html[data-theme="dark"] #modalGradesCalculator .modal-card {
  background: #0f172a !important;
  border: 1.5px solid #243859 !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.15) !important;
}

html[data-theme="dark"] #modalGradesCalculator .modal-header {
  background: #0b1120 !important;
  border-bottom: 1.5px solid #243859 !important;
}

html[data-theme="dark"] #modalGradesCalculator .modal-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] #modalGradesCalculator .modal-title span {
  color: #38bdf8 !important;
}

html[data-theme="dark"] #modalGradesCalculator .modal-body {
  background: #0f172a !important;
}

html[data-theme="dark"] #modalGradesCalculator .modal-body p {
  color: #cbd5e1 !important;
}

/* Tarjeta de Resultado de la Calculadora (Fondo Azul Noche + Azul Cielo) */
html[data-theme="dark"] #modalGradesCalculator .modal-body > div:last-child {
  background: #142038 !important;
  border: 1.5px solid #283d63 !important;
  border-radius: var(--radius-md) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] #calcOutputLevel {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #calcOutputStats {
  color: #93c5fd !important;
  font-weight: 600 !important;
}

/* Reglas universales para cajas interiores y gradientes dentro de modales */
html[data-theme="dark"] [style*="background: linear-gradient(135deg, #f0fdf4"],
html[data-theme="dark"] [style*="background: linear-gradient(135deg, #eff6ff"],
html[data-theme="dark"] [style*="background:linear-gradient"] {
  background: #142038 !important;
  border-color: #283d63 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .modal-body [style*="background: var(--bg-secondary)"],
html[data-theme="dark"] .modal-body [style*="background:var(--bg-secondary)"] {
  background: #142038 !important;
  border-color: #283d63 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] [style*="color: #94a3b8"] {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] [style*="color: #6b7280"],
html[data-theme="dark"] [style*="color: #4b5563"],
html[data-theme="dark"] [style*="color: #374151"] {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] small,
html[data-theme="dark"] .text-xs,
html[data-theme="dark"] .text-sm {
  color: #cbd5e1;
}

html[data-theme="dark"] .modal-card p,
html[data-theme="dark"] .modal-card span {
  color: inherit;
}

html[data-theme="dark"] .notification-list::-webkit-scrollbar-thumb {
  background: #3b537d;
  border-radius: 4px;
}

/* ==========================================================================
   VISOR DE DOCUMENTOS DE ENTREGAS ESTUDIANTILES (Document Viewer)
   ========================================================================== */
.doc-viewer-modal-card {
  max-width: 940px;
  width: 95vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-md, 14px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.doc-viewer-meta-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-viewer-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.doc-viewer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.doc-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
}

.doc-viewer-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-viewer-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-subtle);
}

.doc-viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 20px;
  background: #cbd5e1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 480px;
}

html[data-theme="dark"] .doc-viewer-body {
  background: #030712;
}

.doc-viewer-paper {
  background: #ffffff;
  color: #1e293b;
  max-width: 820px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 44px 50px;
  transform-origin: top center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.doc-viewer-paper-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.doc-viewer-school-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doc-viewer-paper-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 6px 0 4px 0;
  line-height: 1.25;
}

.doc-viewer-paper-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: #64748b;
  flex-wrap: wrap;
}

.doc-viewer-section {
  margin-bottom: 22px;
}

.doc-viewer-section-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  border-left: 4px solid #2563eb;
  padding-left: 10px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.doc-viewer-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 12px;
}

.doc-viewer-schematic-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
  text-align: center;
}

.doc-viewer-schematic-svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.doc-viewer-footer {
  padding: 14px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Chip interactivo para abrir documento del estudiante */
.review-file-preview-chip {
  transition: all 0.2s ease;
  user-select: none;
}

.review-file-preview-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
  background: var(--primary-light);
}

.student-submission-attached-files-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ==========================================================================
   Gestión de Contraseñas y Primer Acceso Obligatorio
   ========================================================================== */

/* Banner de Alerta para Primer Acceso Obligatorio */
.first-login-alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  color: #92400e;
  animation: pulseFirstLogin 2s infinite ease-in-out;
}

@keyframes pulseFirstLogin {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.25); }
}

.first-login-alert-banner .alert-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.first-login-alert-banner .alert-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 3px;
  color: #78350f;
}

.first-login-alert-banner .alert-text p {
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
  color: #92400e;
}

/* Input con botón para alternar visibilidad de contraseña (ojo 👁️) */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper .form-input {
  width: 100%;
  padding-right: 42px;
}

.btn-toggle-pwd-visibility {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn-toggle-pwd-visibility:hover {
  background: var(--bg-tertiary);
  transform: translateY(-50%) scale(1.1);
  color: var(--text-main);
}

/* Barra de Fortaleza / Validación de Contraseña */
.password-strength-container {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-strength-bar {
  width: 100%;
  height: 5px;
  background: var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 999px;
  background: #ef4444;
}

.password-strength-fill.weak {
  width: 30%;
  background: #ef4444;
}

.password-strength-fill.medium {
  width: 65%;
  background: #f59e0b;
}

.password-strength-fill.strong {
  width: 100%;
  background: #10b981;
}

.password-strength-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.form-hint-feedback {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.form-hint-feedback.match-ok {
  color: #10b981;
}

.form-hint-feedback.match-error {
  color: #ef4444;
}

/* ==========================================================================
   Modo Noche: Alta Legibilidad para Modal de Contraseña
   ========================================================================== */
html[data-theme="dark"] #modalChangePassword .modal-title {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .first-login-alert-banner {
  background: rgba(245, 158, 11, 0.16);
  border-color: #fbbf24;
  color: #fde68a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}

html[data-theme="dark"] .first-login-alert-banner .alert-text strong {
  color: #fef08a;
}

html[data-theme="dark"] .first-login-alert-banner .alert-text p {
  color: #fde68a;
}

html[data-theme="dark"] .password-strength-bar {
  background: #1e293b;
}

html[data-theme="dark"] .password-strength-text {
  color: #94a3b8;
}

html[data-theme="dark"] .btn-toggle-pwd-visibility {
  color: #cbd5e1;
}

html[data-theme="dark"] .btn-toggle-pwd-visibility:hover {
  background: #1e293b;
  color: #ffffff;
}

html[data-theme="dark"] #studentSecurityCard {
  background: #162032;
  border-color: #2b3d5c;
}

html[data-theme="dark"] #studentSecurityCard h3 {
  color: #e2e8f0;
}

html[data-theme="dark"] #studentSecurityCard p {
  color: #94a3b8;
}

/* =========================================================================
   RECORRIDO DE BIENVENIDA (TOUR / ONBOARDING MODERNO Y AGIL)
   ========================================================================= */
.tour-modal-card {
  max-width: 660px;
  width: 95%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.tour-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.tour-header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tour-badge-pill {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.tour-badge-sub {
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.tour-steps-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.tour-nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-nav-tab:hover {
  color: var(--text-main);
  background: #f8fafc;
}

.tour-nav-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #eff6ff;
}

.tour-modal-body {
  padding: 24px;
  min-height: 330px;
}

.tour-slide {
  display: none;
  animation: fadeInTour 0.25s ease-out forwards;
}

.tour-slide.active {
  display: block;
}

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

.tour-slide-hero {
  text-align: center;
  margin-bottom: 20px;
}

.tour-icon-large {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 10px;
}

.tour-slide-hero h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tour-slide-hero p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}

.tour-features-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tour-feature-card:hover {
  transform: translateX(3px);
  border-color: #cbd5e1;
}

.tour-feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.tour-feature-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.tour-feature-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.tour-feature-card.highlight-cyan {
  border-left: 3px solid #06b6d4;
}

.tour-feature-card.highlight-green {
  border-left: 3px solid #10b981;
}

.tour-feature-card.highlight-indigo {
  border-left: 3px solid #6366f1;
}

.tour-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

.tour-dots-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tour-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-dot.active {
  background: #2563eb;
  width: 22px;
  border-radius: 8px;
}

.tour-footer-buttons {
  display: flex;
  gap: 10px;
}

