:root {
  color-scheme: dark;
  --fondo: #0b1220;
  --panel: #141c2f;
  --linea: #2a3854;
  --texto: #e7eefc;
  --muted: #93a0bd;
  --acento: #3b82f6;
  --ok: #16a34a;
  --aviso: #d97706;
  --peligro: #dc2626;
  --radio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 500px at 10% -10%, #1e3a8a 0%, transparent 50%), var(--fondo);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, sans-serif;
}

a { color: #93c5fd; }

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

h1, h2, p { margin-top: 0; }

.acceso, .pagina { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }

.marca { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.marca svg { width: 48px; height: 48px; flex: none; }
.marca h1 { margin: 0 0 0.25rem; font-size: 1.8rem; }
.marca p, .ayuda, .etiqueta { color: var(--muted); }

.tarjeta, .estadistica, .tarea {
  background: color-mix(in srgb, var(--panel) 92%, white 0%);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 1rem;
}

.pestanas { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pestana, .boton, .boton-texto {
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: transparent;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.pestana[aria-selected="true"], .boton {
  background: var(--acento);
  border-color: var(--acento);
  color: white;
}
.boton-texto:hover, .pestana:hover { border-color: #60a5fa; }
.boton-peligro { background: var(--peligro); border-color: var(--peligro); color: white; }

.campo, .check { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.8rem; }
.campo input, .campo select, .campo textarea, #filtro-alumno, .form-linea input {
  width: 100%;
  background: #0b1220;
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
textarea { resize: vertical; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.dos-paneles { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 1rem; align-items: start; }

.aviso { padding: 0.7rem 0.9rem; border-radius: 10px; margin-bottom: 1rem; }
.aviso-error { background: #451a1a; color: #fecaca; }
.aviso-ok { background: #052e16; color: #bbf7d0; }

.rejilla-modulos, .fila-pastillas, .fila-botones, .fila-url, .editor-barra, .form-linea {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.fila-url, .editor-barra { justify-content: space-between; }
.modulos { border: 1px solid var(--linea); border-radius: 10px; margin-bottom: 0.8rem; }
.check-modulo {
  display: flex; gap: 0.4rem; align-items: center;
  border: 1px solid var(--linea); border-radius: 999px; padding: 0.35rem 0.7rem;
}

.barra {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--linea);
  position: sticky; top: 0; background: rgba(11, 18, 32, 0.92); backdrop-filter: blur(10px);
}
.volver { display: block; color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.pastilla {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  color: white; font-size: 0.78rem; font-weight: 700;
}

.cuota { height: 8px; background: #0b1220; border-radius: 99px; overflow: hidden; border: 1px solid var(--linea); }
.cuota span { display: block; height: 100%; background: var(--acento); width: 0; }
.cuota-caja { margin: 0.8rem 0; }

.migas { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.migas button { background: none; border: 0; color: #93c5fd; cursor: pointer; padding: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla-contenedor { overflow-x: auto; }
.nombre-archivo { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: left; }
.carpeta { color: #fde68a; }

.estadisticas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1rem; }
.estadistica strong { display: block; font-size: 1.8rem; }
.lista-tareas { display: grid; gap: 0.8rem; margin-top: 1rem; }
.tarea header, .alumno-cabecera { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.nota { font-size: 1.4rem; font-weight: 700; }
.cerrada { opacity: 0.65; }
.progreso { color: var(--muted); font-size: 0.9rem; }

dialog {
  width: min(920px, calc(100% - 2rem));
  background: var(--panel); color: var(--texto);
  border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
#editor { width: min(1000px, calc(100% - 1rem)); height: min(80vh, 720px); }
#editor form { display: flex; flex-direction: column; height: 100%; gap: 0.6rem; }
#editor textarea {
  flex: 1; width: 100%; min-height: 50vh;
  background: #0b1220; border: 1px solid var(--linea); border-radius: 10px;
  font-family: Consolas, monospace; padding: 0.8rem;
}
.alumno { border-bottom: 1px solid var(--linea); padding: 0.8rem 0; }
.alumno details { margin-top: 0.5rem; }
.correccion { display: grid; grid-template-columns: 1.1fr 0.5fr 1.4fr auto; gap: 0.6rem; align-items: start; padding: 0.8rem 0; border-bottom: 1px solid var(--linea); }
.correccion textarea, .correccion input { width: 100%; background: #0b1220; border: 1px solid var(--linea); border-radius: 10px; padding: 0.5rem; }

@media (max-width: 800px) {
  .dos, .dos-paneles, .estadisticas, .correccion { grid-template-columns: 1fr; }
  .barra { align-items: flex-start; flex-direction: column; }
}
