/* ==========================================================================
   ESTILOS GENERALES Y VARIABLES DE DISEÑO
   Proyecto: Entrenamiento Oral del Vocabulario de Programación (POO - Java)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta de Colores Institucional */
  --color-primary: #002351;
  --color-primary-hover: #1b396a;
  --color-secondary: #0058be;
  --color-secondary-hover: #004395;
  --color-secondary-container: #2170e4;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-muted: #f1f5f9;
  --color-surface-hover: #f8fafc;

  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;

  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;

  /* Colores de Estado Semántico */
  --color-success-bg: #ecfdf5;
  --color-success-text: #065f46;
  --color-success-border: #a7f3d0;
  --color-success-accent: #10b981;

  --color-warning-bg: #fffbeb;
  --color-warning-text: #92400e;
  --color-warning-border: #fde68a;
  --color-warning-accent: #f59e0b;

  --color-danger-bg: #fef2f2;
  --color-danger-text: #991b1b;
  --color-danger-border: #fecaca;
  --color-danger-accent: #ef4444;

  --color-info-bg: #eff6ff;
  --color-info-text: #1e40af;
  --color-info-border: #bfdbfe;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Reseteo básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Iconos de Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  font-size: 20px;
  vertical-align: middle;
}

/* ==========================================================================
   COMPONENTES COMUNES: ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Botones genéricos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease-in-out;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

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

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

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

.btn-neutral {
  background-color: var(--color-surface-muted);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

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

.btn-outline {
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background-color: var(--color-surface);
}

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

/* Insignias / Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}
.badge-success .badge-dot { background-color: var(--color-success-accent); }

.badge-warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning-border);
}
.badge-warning .badge-dot { background-color: var(--color-warning-accent); }

.badge-info {
  background-color: var(--color-info-bg);
  color: var(--color-info-text);
  border: 1px solid var(--color-info-border);
}
.badge-info .badge-dot { background-color: var(--color-secondary); }

.badge-neutral {
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Tarjetas y Contenedores */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   PANTALLA DE ACCESO (INDEX.HTML)
   ========================================================================== */
/* ==========================================================================
   PANTALLA DE ACCESO ESTILO GOOGLE SIGN-IN (INDEX.HTML)
   ========================================================================== */
.google-auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background-color: #f0f4f9;
}

.google-auth-card {
  width: 100%;
  max-width: 448px;
  background-color: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 28px;
  padding: 2.5rem 2.25rem 2.25rem;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .google-auth-wrapper {
    padding: 0;
    background-color: #ffffff;
  }
  .google-auth-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 2rem 1.5rem;
  }
}

.google-brand-header {
  margin-bottom: 1.75rem;
}

.google-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: #e8f0fe;
  color: #0b57d0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.google-brand-icon .material-symbols-outlined {
  font-size: 24px;
}

.google-auth-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: #1f1f1f;
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.google-auth-subtitle {
  font-size: 0.95rem;
  color: #444746;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

/* Banner de error de autenticación */
.google-error-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.google-error-banner .material-symbols-outlined {
  font-size: 20px;
  color: #c5221f;
  flex-shrink: 0;
}

/* Selector de Perfil Segmentado estilo Google Material You */
.google-role-selector {
  display: flex;
  gap: 0.5rem;
  background-color: #f0f4f9;
  padding: 0.25rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
}

.google-role-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 100px;
  color: #444746;
  background: transparent;
  transition: all 0.2s ease;
  border: none;
}

.google-role-chip .material-symbols-outlined {
  font-size: 18px;
}

.google-role-chip:hover {
  color: #1f1f1f;
  background-color: rgba(0, 0, 0, 0.03);
}

.google-role-chip.active {
  background-color: #ffffff;
  color: #0b57d0;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Campos de formulario con etiqueta flotante estilo Google */
.google-field {
  position: relative;
  margin-bottom: 1.25rem;
}

.google-input {
  width: 100%;
  height: 54px;
  padding: 1rem 0.875rem 0.25rem;
  font-size: 0.95rem;
  color: #1f1f1f;
  background-color: #ffffff;
  border: 1px solid #747775;
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.google-input:hover {
  border-color: #1f1f1f;
}

.google-input:focus {
  outline: none;
  border: 2px solid #0b57d0;
  padding-left: calc(0.875rem - 1px);
  padding-right: calc(0.875rem - 1px);
}

.google-label {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #444746;
  transition: all 0.15s ease;
  background-color: transparent;
}

.google-input:focus ~ .google-label,
.google-input:not(:placeholder-shown) ~ .google-label {
  top: 14px;
  font-size: 0.72rem;
  color: #0b57d0;
  font-weight: 500;
}

.google-input:not(:focus):not(:placeholder-shown) ~ .google-label {
  color: #444746;
}

.google-field-hint {
  font-size: 0.775rem;
  color: #444746;
  margin-top: 0.35rem;
  line-height: 1.35;
  padding-left: 0.25rem;
}

/* Acciones inferiores de la tarjeta */
.google-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}

.google-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0b57d0;
  text-decoration: none;
  padding: 0.25rem 0;
}

.google-link:hover {
  text-decoration: underline;
}

.google-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #0b57d0;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.65rem 1.5rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 40px;
}

.google-btn-primary:hover {
  background-color: #0842a0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.google-btn-primary:disabled {
  background-color: #e0e2ec;
  color: #8e918f;
  cursor: not-allowed;
  box-shadow: none;
}

/* Pie de página estilo Google */
.google-auth-footer {
  width: 100%;
  max-width: 448px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: #444746;
}

.google-footer-links {
  display: flex;
  gap: 1.25rem;
}

.google-footer-links a {
  color: #444746;
  text-decoration: none;
}

.google-footer-links a:hover {
  color: #1f1f1f;
}

/* ==========================================================================
   PANEL DOCENTE (DOCENTE.HTML)
   ========================================================================== */
.dashboard-main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-intro {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.kpi-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.kpi-total {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.kpi-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: var(--color-surface-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.table-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.search-input-wrapper .material-symbols-outlined {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  font-size: 18px;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.65rem 0.45rem 2.1rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  padding: 0.75rem 1.25rem;
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: var(--color-surface-hover);
}

.student-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.table-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   PANTALLA DE ENTRENAMIENTO DEL ALUMNO (ALUMNO.HTML)
   ========================================================================== */
.student-layout {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.sidebar-stages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stage-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background-color: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

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

.stage-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.stage-number-bubble {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--color-text-light);
}

.stage-card-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-left: 1.85rem;
  line-height: 1.3;
}

/* Estados de las etapas */
.stage-card.active {
  border: 2px solid var(--color-secondary);
  background-color: #f0f7ff;
}
.stage-card.active .stage-number-bubble {
  background-color: var(--color-secondary);
}

.stage-card.completed {
  border-color: var(--color-success-border);
  background-color: var(--color-success-bg);
}
.stage-card.completed .stage-number-bubble {
  background-color: var(--color-success-accent);
}

.stage-card.pending {
  opacity: 0.65;
}

/* ==========================================================================
   LISTA DE ACTIVIDADES EN LA BARRA LATERAL (ALUMNO.HTML)
   ========================================================================== */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.activity-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background-color: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
  user-select: none;
}

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

.activity-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.activity-item-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.activity-item-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-left: 1.85rem;
  line-height: 1.3;
}

/* Estado: Completada anteriormente (Verde) */
.activity-item.completed {
  border-color: var(--color-success-border);
  background-color: var(--color-success-bg);
}
.activity-item.completed .activity-item-icon {
  background-color: var(--color-success-accent);
}
.activity-item.completed .activity-item-title {
  color: var(--color-success-text);
}

/* Estado: En curso actualmente (Azul) */
.activity-item.current {
  border: 2px solid var(--color-secondary);
  background-color: #f0f7ff;
}
.activity-item.current .activity-item-icon {
  background-color: var(--color-secondary);
}
.activity-item.current .activity-item-title {
  color: var(--color-secondary);
}

/* Estado: Desactivada / Bloqueada (Grisáceo) */
.activity-item.locked {
  border-color: var(--color-border);
  background-color: var(--color-surface-muted);
  opacity: 0.55;
  cursor: not-allowed;
}
.activity-item.locked .activity-item-icon {
  background-color: var(--color-text-light);
}
.activity-item.locked .activity-item-title {
  color: var(--color-text-muted);
}

/* Contenedor horizontal de etapas en el área principal */
.stages-grid-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* ==========================================================================
   LAYOUT EN DOS MITADES: CÓDIGO Y ACCIONES DE VOZ (ALUMNO.HTML)
   ========================================================================== */
.exercise-two-halves {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .exercise-two-halves {
    grid-template-columns: 1fr;
  }
}

.exercise-two-halves .code-viewer {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.exercise-two-halves .code-content-wrapper {
  flex: 1;
}

.exercise-actions-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: flex-start;
}

.model-audio-card {
  background-color: #f0f7ff;
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-play-model {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background-color: var(--color-secondary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
  width: 100%;
}

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

.model-text-quote {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.35;
  background-color: #ffffff;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.recorder-card-compact {
  background-color: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.recorder-card-compact .btn-record {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  justify-content: center;
}

.hints-container-box {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Área central de práctica */
.practice-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-header-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.activity-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

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

/* Caja de Código Java */
.code-viewer {
  background-color: #1e1e2e;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #313244;
  box-shadow: var(--shadow-sm);
}

.code-viewer-header {
  background-color: #181825;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #313244;
}

.code-window-dots {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background-color: #f38ba8; }
.dot-yellow { background-color: #f9e2af; }
.dot-green { background-color: #a6e3a1; }

.code-file-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cdd6f4;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.code-content-wrapper {
  display: flex;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

.code-lines-num {
  user-select: none;
  padding-right: 1rem;
  margin-right: 1rem;
  border-right: 1px solid #313244;
  color: #585b70;
  text-align: right;
  display: flex;
  flex-direction: column;
}

.code-body {
  color: #cdd6f4;
  white-space: pre;
}

.kw { color: #cba6f7; font-weight: 600; }
.cl { color: #f9e2af; font-weight: 600; }
.tp { color: #89dceb; }
.vr { color: #cdd6f4; }
.sy { color: #9399b2; }

/* Grabador de Voz */
.recorder-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.recorder-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-text-light);
}

.status-indicator-dot.recording {
  background-color: var(--color-danger-accent);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-record {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

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

.btn-record.recording {
  background-color: var(--color-danger-accent);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Estados deshabilitados de los botones de práctica (grisáceos) */
.btn-record:disabled,
.btn-play-model:disabled {
  background-color: var(--color-text-light);
  color: var(--color-surface);
  box-shadow: none;
  opacity: 0.75;
  cursor: not-allowed;
}

/* Barra de continuación (cambio de etapa o actividad)
   Usa la misma semántica de "completado" que .stage-card.completed,
   .activity-item.completed y .badge-success. */
.continue-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding: 1.35rem 1.5rem;
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-left: 4px solid var(--color-success-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.continue-bar-info {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-success-text);
  line-height: 1.5;
}

.continue-bar-info .material-symbols-outlined {
  font-size: 22px;
  color: var(--color-success-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.continue-bar .btn {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
  padding: 0.6rem 1.35rem;
}

/* Transcripción no editable (solo voz) */
.transcript-display-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.transcript-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.transcript-display-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.transcript-badge-locked {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  gap: 0.25rem;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  background-color: var(--color-surface);
}

.transcript-display-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: var(--color-surface-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  min-height: 72px;
  transition: all 0.2s ease;
  user-select: text;
  cursor: default;
}

.transcript-display-box.recording-active {
  border-color: var(--color-secondary);
  background-color: #f8faff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.transcript-display-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: all 0.2s ease;
}

.transcript-display-box.recording-active .transcript-display-icon {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  animation: pulse-dot 1.5s infinite;
}

.transcript-text {
  font-size: 0.875rem;
  color: var(--color-text-main);
  line-height: 1.5;
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.transcript-text.empty {
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.8;
}

/* Transcripción y Feedback */
.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1rem;
  align-items: stretch;
}

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

.feedback-card {
  border-left: 4px solid var(--color-secondary);
}

/* ==========================================================================
   MODALES ACCESIBLES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

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

.modal-dialog {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

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

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

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

/* Clases de utilidad */
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }

/* ==========================================================================
   MODAL DE BIENVENIDA Y CONTINUIDAD
   ========================================================================== */
.welcome-modal-card {
  max-width: 520px;
  text-align: center;
  align-items: center;
  padding: 2.25rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.welcome-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.1);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.welcome-icon-wrapper .material-symbols-outlined {
  font-size: 36px;
}

.welcome-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.welcome-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.welcome-instructions-box {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.825rem;
  color: var(--color-text-main);
  text-align: left;
  line-height: 1.45;
  margin-bottom: 1.5rem;
  width: 100%;
}

.resume-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--color-secondary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

/* ==========================================================================
   ESTILOS PARA LOS PANELES DE DOCENTE (PANEL 1 Y PANEL 2)
   ========================================================================== */
.hidden {
  display: none !important;
}

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

.student-detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.student-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 0.85rem;
}

.student-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.student-detail-metrics {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.student-detail-metric-item {
  display: flex;
  flex-direction: column;
}

.student-detail-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.student-detail-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.feedback-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.feedback-activity-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.feedback-activity-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feedback-stage-row {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--color-secondary);
}

.feedback-stage-row.en-curso {
  border-left-color: var(--color-warning-accent);
  background: var(--color-warning-bg);
}

.feedback-stage-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-stage-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   MODAL ESTÉTICO: REGISTRAR ESTUDIANTE EN EL GRUPO
   ========================================================================== */
.modal-dialog-aesthetic {
  max-width: 540px;
  border-radius: 20px;
  padding: 0;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  background: #ffffff;
  animation: modal-pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-aesthetic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--color-border);
}

.modal-aesthetic-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-aesthetic-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 35, 81, 0.25);
  flex-shrink: 0;
}

.modal-aesthetic-avatar .material-symbols-outlined {
  font-size: 24px;
}

.modal-aesthetic-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
}

.modal-aesthetic-subtitle {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.btn-close-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-close-circle:hover {
  background: #f1f5f9;
  color: var(--color-danger-accent);
  border-color: var(--color-danger-border);
  transform: rotate(90deg);
}

.modal-aesthetic-form {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.aesthetic-alert-error {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
}

.aesthetic-alert-error .material-symbols-outlined {
  font-size: 18px;
  color: #ef4444;
  flex-shrink: 0;
}

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

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

.aesthetic-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aesthetic-label {
  font-size: 0.785rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.required-star {
  color: var(--color-danger-accent);
  font-weight: bold;
}

.aesthetic-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.aesthetic-input-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 19px;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.aesthetic-input {
  width: 100%;
  height: 44px;
  padding: 0 0.85rem 0 2.5rem;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--color-text-main);
  transition: all 0.2s ease;
}

.aesthetic-input:hover {
  background: #ffffff;
  border-color: #94a3b8;
}

.aesthetic-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 88, 190, 0.12);
}

.aesthetic-input:focus ~ .aesthetic-input-icon,
.aesthetic-input-wrapper:focus-within .aesthetic-input-icon {
  color: var(--color-secondary);
}

.aesthetic-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.aesthetic-toggle-pwd:hover {
  color: var(--color-primary);
}

.aesthetic-toggle-pwd .material-symbols-outlined {
  font-size: 20px;
}

.aesthetic-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  padding-left: 0.2rem;
}

.aesthetic-info-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  font-size: 0.8rem;
  color: #1e40af;
  line-height: 1.45;
}

.aesthetic-info-callout .material-symbols-outlined {
  font-size: 19px;
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-aesthetic-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.btn-aesthetic-cancel {
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-color: #cbd5e1;
  color: #475569;
}

.btn-aesthetic-cancel:hover {
  background: #f1f5f9;
  color: var(--color-text-main);
}

.btn-aesthetic-submit {
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0.55rem 1.35rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 35, 81, 0.2);
  transition: all 0.2s ease;
}

.btn-aesthetic-submit:hover {
  box-shadow: 0 6px 14px rgba(0, 35, 81, 0.3);
  transform: translateY(-1px);
}

.btn-aesthetic-submit:active {
  transform: translateY(0);
}

/* ==========================================================================
   BOTONES DE ACCIONES EN LA TABLA DEL GRUPO
   ========================================================================== */
.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-action .material-symbols-outlined {
  font-size: 17px;
}

.btn-icon-action:hover {
  background: var(--color-surface-muted);
  color: var(--color-text-main);
  border-color: #cbd5e1;
}

.btn-icon-edit:hover {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

.btn-icon-delete:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Animación spin para indicador de carga del agente */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}




