* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f1f5f9;
  color: #1e293b;
  padding-bottom: 40px;
}

.app-header {
  background-color: #2563eb;
  color: white;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.container {
  max-width: 1150px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 18px;
}

.oculto { display: none !important; }
.text-center { text-align: center; }
.texto-suave { color: #64748b; font-size: 0.88rem; }
.text-danger { color: #dc2626 !important; border-color: #fecaca !important; }

/* Botones e Inputs */
.botones-rol {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover:not(:disabled) { opacity: 0.9; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background-color: #2563eb; color: white; }
.btn-secondary { background-color: #475569; color: white; }
.btn-success { background-color: #16a34a; color: white; }
.full-width { width: 100%; margin-top: 10px; }

.btn-mini {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-mini:hover { background: #e2e8f0; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

input, textarea, select {
  padding: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Grid Profesor (2 Columnas) */
.panel-profesor {
  display: grid;
  grid-template-columns: 2fr 1.15fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .panel-profesor { grid-template-columns: 1fr; }
}

.sala-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
}

.sala-info-grupo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.acciones-json {
  display: flex;
  gap: 8px;
}

.badge-codigo {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 1.05rem;
  letter-spacing: 1px;
}

.badge-en-curso {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

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

/* Cajas con barra deslizable */
.scroll-box {
  max-height: 170px;
  overflow-y: auto;
  padding-right: 4px;
}
.scroll-box-medio {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.scroll-box-grande {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Constructor Preview */
.preview-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.pregunta-preview-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.9rem;
}
.pregunta-preview-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 6px;
}
.opcion-preview {
  padding-left: 12px;
  color: #475569;
  font-size: 0.85rem;
}
.opcion-correcta {
  color: #15803d;
  font-weight: 700;
}

/* Resumen entregas */
.resumen-entregas {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.stat-pill {
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Lista lateral de alumnos */
.alumno-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
}
.alumno-item:last-child { border-bottom: none; }

.alumno-nombre-box {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.95rem;
}

.alumno-dni-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: #64748b;
}

.punto-estado {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.online { background-color: #22c55e; box-shadow: 0 0 6px #22c55e; }
.ausente { background-color: #ef4444; box-shadow: 0 0 6px #ef4444; }
.desconectado { background-color: #94a3b8; }

.nombre-desconectado {
  text-decoration: line-through;
  color: #94a3b8;
}

.progreso-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  margin-top: 3px;
}
.progreso-entregado {
  background: #dcfce7;
  color: #15803d;
}

.alumno-stats {
  text-align: right;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.35;
  flex-shrink: 0;
}

/* Vista Alumno */
.barra-estado-alumno {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}
.badge-online {
  font-size: 0.82rem;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 12px;
}
.badge-offline {
  font-size: 0.82rem;
  font-weight: 600;
  color: #b91c1c;
  background: #fee2e2;
  padding: 3px 8px;
  border-radius: 12px;
}

.aviso-monitoreo {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.caja-estado-centro {
  text-align: center;
  padding: 36px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
}

.titulo-eval {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}

.tarjeta-pregunta-alumno {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.tarjeta-pregunta-alumno h4 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.opcion-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opcion-radio-label:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Logs de alertas */
.lista-logs {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-item {
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  border-left: 3px solid #cbd5e1;
}
.log-alerta { border-left-color: #ef4444; background: #fef2f2; }
