/* ============================================================
   Paneles del alumno y del profesor — sobre /css/sitio.css.

   Mismo mundo que la portada: fondo tinta, luz en movimiento y
   tarjetas de vidrio. Todo lo que pintan panel.js, profesor.js y
   agenda.js (filas, estados, calendario, tabla de disponibilidad)
   se viste acá. El admin sigue con estilos.css + admin.css.
   ============================================================ */

body.panel-alumno { background: var(--fondo); color: #fff; min-height: 100svh; }

/* ---------------- pantalla de acceso ---------------- */

.acceso {
  position: fixed; inset: 0; z-index: 90;
  background: var(--fondo);
  display: grid; place-items: center;
  padding: 1.5rem; overflow-y: auto; overflow-x: hidden;
}
.acceso .aurora, .acceso .malla { position: fixed; }

.acceso-caja {
  position: relative; z-index: 2;
  width: min(26rem, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  text-align: center;
  padding: 2.4rem 2rem 2.2rem;
  background: rgba(14,20,40,.9); border: 1px solid var(--borde-2); border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08), 0 0 80px rgba(45,91,255,.12);
  opacity: 0; translate: 0 26px; animation: subir 900ms var(--out) 120ms forwards;
}

.acceso-logo { display: inline-flex; align-items: center; gap: .8rem; font-family: var(--display); line-height: 1; text-decoration: none; }
.acceso-logo .words { display: flex; flex-direction: column; gap: .16em; align-items: flex-start; }
.acceso-logo .l1 { font-weight: 700; font-size: 2.4rem; letter-spacing: -.035em; color: #fff; }
.acceso-logo .l2 { font-family: var(--sans); font-weight: 600; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--acento); }

.acceso-estado { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.acceso-t { font-family: var(--display); font-weight: 700; font-size: 1.75rem; letter-spacing: -.025em; color: #fff; margin: 0; line-height: 1.1; }
.acceso-s { font-size: .93rem; color: var(--texto-suave); margin: 0 0 .6rem; line-height: 1.55; }

#accesoCargando .acceso-t { font-size: 1.1rem; font-weight: 500; color: var(--texto-suave); display: inline-flex; align-items: center; gap: .6rem; }
#accesoCargando .acceso-t::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--borde-2); border-top-color: var(--cian); animation: girar 900ms linear infinite; }

.btn.ancho { width: 100%; }

.separador { position: relative; width: 100%; margin: .4rem 0; text-align: center; }
.separador::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--borde); }
.separador span { position: relative; background: #0E1428; padding: 0 .75rem; font-size: .76rem; color: #7E8AA8; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.acceso-form { width: 100%; display: flex; flex-direction: column; gap: .85rem; text-align: left; }
.campo { display: flex; flex-direction: column; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo label { font-size: .8rem; font-weight: 500; color: #C3D2DF; }
.campo .ayuda { font-size: .78rem; color: var(--texto-suave); line-height: 1.45; }
.campo input, .campo textarea {
  font: inherit; font-size: .95rem; color: #fff; width: 100%;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2);
  border-radius: 12px; padding: .7rem .9rem; min-height: 46px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.campo input::placeholder { color: #6B7A99; }
.campo input:focus, .campo textarea:focus { outline: 0; border-color: var(--azul-2); background: rgba(45,91,255,.08); box-shadow: 0 0 0 4px rgba(45,91,255,.18), 0 0 30px rgba(45,91,255,.15); }
.campo input.malo { border-color: var(--acento); }
.campo .error { font-size: .78rem; color: var(--acento); }

.acceso-error {
  width: 100%; font-size: .85rem; line-height: 1.5; color: #FFB4B6;
  background: rgba(255,90,95,.12); border: 1px solid rgba(255,90,95,.4);
  border-radius: 12px; padding: .65rem .85rem; margin: 0;
}
.acceso-alt { font-size: .85rem; color: var(--texto-suave); margin: .25rem 0 0; text-align: center; }
.enlace { background: none; border: 0; font: inherit; font-size: .85rem; color: var(--cian); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: .3rem .1rem; }
.enlace:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; border-radius: 3px; }

/* ---------------- cabecera del panel ---------------- */

.panel-shell { position: relative; min-height: 100svh; }
.panel-shell > .aurora { position: fixed; inset: 0; }
.panel-shell > .aurora span { opacity: .3; }
.panel-shell > .malla { position: fixed; inset: 0; }

.panel-top { position: sticky; top: 0; z-index: 40; padding: .8rem 1.25rem; }
.panel-top-fila {
  max-width: 62rem; margin: 0 auto; height: 3.7rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 .5rem 0 1rem; border-radius: 999px;
  background: rgba(11,16,32,.62); border: 1px solid var(--borde);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}
.panel-top .logo { font-size: 1.5rem !important; }
.panel-top .logo svg { width: 32px; height: 32px; --c1: #fff; --c2: var(--acento); }

.panel-usuario { display: flex; align-items: center; gap: .7rem; }
.pu-datos { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.pu-nombre { font-size: .88rem; font-weight: 600; color: #fff; }
.pu-correo { font-size: .72rem; color: var(--texto-suave); font-family: var(--mono); }
@media (max-width: 34rem) { .pu-datos { display: none; } }

.pu-av {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--azul), #7B5CFF); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: .85rem;
  box-shadow: 0 0 0 2px var(--fondo), 0 0 0 3px rgba(45,91,255,.6), 0 8px 20px rgba(45,91,255,.35);
}

.salir-btn {
  background: transparent; border: 1px solid var(--borde-2); color: var(--texto-suave);
  border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 200ms var(--spring), background-color 160ms ease;
}
.salir-btn .icon { width: 1rem; height: 1rem; }
.salir-btn:active { transform: scale(.94); }
.salir-btn:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .salir-btn:hover { border-color: var(--acento); color: var(--acento); background: rgba(255,90,95,.1); } }

/* ---------------- cuerpo ---------------- */

.panel-main {
  position: relative; z-index: 1;
  padding: 2rem 1.5rem 5rem; display: flex; flex-direction: column; gap: 2.5rem; max-width: 62rem;
}

.panel-cabecera { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem 0 .5rem; }
.panel-cabecera h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -.04em; line-height: 1; margin: 0;
  background: linear-gradient(92deg, #fff 0%, #C9D4F5 55%, var(--azul-2) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.bloque { display: flex; flex-direction: column; gap: 1rem; opacity: 0; translate: 0 18px; animation: subir 700ms var(--out) forwards; }
.bloque:nth-child(2) { animation-delay: 80ms; }
.bloque:nth-child(3) { animation-delay: 160ms; }
.bloque:nth-child(4) { animation-delay: 240ms; }
.bloque:nth-child(5) { animation-delay: 320ms; }
.bloque:nth-child(6) { animation-delay: 400ms; }
.bloque-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bloque-titulo h2 { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: .6rem; }
.bloque-titulo h2::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--acento); box-shadow: 0 0 14px var(--acento); }
.bloque-titulo .tiny { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--texto-suave); }
.bloque > .tiny { color: var(--texto-suave); }

.vacio {
  background: var(--vidrio); border: 1px dashed var(--borde-2); border-radius: var(--r);
  padding: 2.2rem 1.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.vacio p { margin: 0; color: var(--texto-suave); font-size: .95rem; line-height: 1.6; max-width: 32rem; }
.vacio strong { color: #fff; font-weight: 600; display: block; margin-bottom: .3rem; font-family: var(--display); font-size: 1.1rem; }
.detalle-fallo { font-family: var(--mono); font-size: .74rem; color: #7E8AA8; word-break: break-word; }

/* cifras */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1px; background: var(--borde); border: 1px solid var(--borde); border-radius: var(--r); overflow: hidden; }
.tarjeta {
  position: relative; background: var(--fondo); padding: 1.4rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: .25rem; overflow: hidden;
}
.tarjeta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(18rem circle at 0% 0%, rgba(45,91,255,.22), transparent 55%); opacity: 0; transition: opacity 400ms ease; }
.tarjeta:hover::before { opacity: 1; }
.tarjeta::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--azul), var(--cian)); transform: scaleX(0); transform-origin: left; transition: transform 700ms var(--out); }
.tarjeta:hover::after { transform: scaleX(1); }
.tarjeta > * { position: relative; }
.t-num {
  font-family: var(--display); font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #AEB9D3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tarjeta:first-child .t-num { background: linear-gradient(92deg, var(--acento), var(--acento-2)); -webkit-background-clip: text; background-clip: text; }
.t-lbl { font-size: .82rem; color: var(--texto-suave); line-height: 1.35; }
.comprar-mas { margin-top: .9rem; align-self: flex-start; }

/* filas de clase */
.row {
  position: relative; background: var(--vidrio); border: 1px solid var(--borde); border-radius: var(--r);
  padding: 1rem 1.15rem;
  display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 1rem; align-items: center;
  transition: border-color 200ms ease, transform 300ms var(--out), box-shadow 300ms ease;
}
.row::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--azul), var(--cian)); box-shadow: 0 0 14px rgba(45,91,255,.7); }
.row.sin-profesor::before { background: linear-gradient(180deg, var(--ocre), #FFC46B); box-shadow: 0 0 14px rgba(217,146,47,.6); }
.row.pasada::before { background: var(--borde-2); box-shadow: none; }
.row.pasada { opacity: .7; }
.row + .row { margin-top: .6rem; }
@media (hover: hover) and (pointer: fine) { .row:hover { border-color: var(--borde-2); transform: translateX(3px); box-shadow: 0 16px 40px rgba(0,0,0,.3); } }
@media (max-width: 40rem) { .row { grid-template-columns: 1fr; gap: .6rem; } }

.row .when { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; line-height: 1.2; color: #fff; }
.row .when .d { display: block; color: var(--azul-2); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .15rem; }
.row .who { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.row .who .n { font-weight: 600; font-size: 1rem; }
.row .who .s { font-size: .8rem; color: var(--texto-suave); }
.row.sin-profesor .who .n { color: var(--texto-suave); font-style: italic; }

.estado { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; padding: .35rem .65rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.estado .dot { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.estado.ok { background: rgba(53,224,161,.12); color: var(--verde-n); border-color: rgba(53,224,161,.35); }
.estado.pend { background: rgba(217,146,47,.14); color: #FFC46B; border-color: rgba(217,146,47,.4); }
.estado.espera { background: rgba(45,91,255,.14); color: var(--azul-2); border-color: rgba(45,91,255,.4); }
.estado.realizada { background: rgba(255,255,255,.06); color: var(--texto-suave); border-color: var(--borde); }
.estado.cancelada { background: rgba(255,90,95,.1); color: #FFB4B6; border-color: rgba(255,90,95,.35); }

.acciones-clase { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.link-cancelar { background: none; border: 0; font: inherit; font-size: .82rem; color: #7E8AA8; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: .35rem .1rem; transition: color 160ms ease; }
.link-cancelar:hover { color: var(--acento); }
.link-cancelar:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; border-radius: 3px; }
.link-cancelar:disabled { opacity: .5; cursor: default; }

/* ---------------- profesor: sala por clase ---------------- */

.clase { margin-bottom: .8rem; background: var(--vidrio); border: 1px solid var(--borde); border-radius: var(--r); overflow: hidden; }
.clase .row { margin: 0; border: 0; border-radius: 0; background: transparent; }
.clase .row:hover { transform: none; box-shadow: none; }
.clase .soltar {
  margin: 0 1.15rem .4rem; background: none; border: 0; padding: .2rem 0;
  font: inherit; font-size: .8rem; color: #7E8AA8;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color 160ms ease;
}
/* En cuál va de su plan. Al profesor le dice si esta es la primera
   clase de alguien o la última del mes, que no se preparan igual. */
.num-plan {
  margin-left: .45rem; padding: .05rem .4rem;
  border-radius: 999px; background: rgba(255,255,255,.10);
  font-family: var(--mono); font-size: .68rem; font-variant-numeric: tabular-nums;
  color: var(--texto-suave); vertical-align: middle;
}

.clase .soltar:disabled { opacity: .6; cursor: default; }
.clase .soltar:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; border-radius: 3px; }
@media (hover: hover) and (pointer: fine) { .clase .soltar:not(:disabled):hover { color: var(--acento); } }

/* Cuando ya pidió no darla, el botón desaparece: apretarlo otra vez no
   apura nada y el servidor lo rechaza igual. Queda la frase, que es lo
   que necesita leer —que su aviso salió y que la clase sigue siendo
   suya hasta que le contesten. */
.clase .pedido-hecho {
  margin: 0 1.15rem .7rem; padding: .55rem .7rem;
  border-left: 2px solid var(--azul-2); border-radius: 0 8px 8px 0;
  background: rgba(45,91,255,.1);
  font-size: .81rem; line-height: 1.45; color: var(--texto-suave);
}

.clase-sala { background: rgba(0,0,0,.25); border-top: 1px solid var(--borde); padding: .9rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .45rem; }
.clase-sala label { font-size: .78rem; font-weight: 500; color: var(--texto-suave); font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.clase-sala-fila { display: flex; gap: .5rem; flex-wrap: wrap; }
.clase-sala input {
  flex: 1; min-width: 12rem; font: inherit; font-family: var(--mono); font-size: .82rem; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2); border-radius: 10px; padding: .5rem .75rem; min-height: 40px;
}
.clase-sala input:focus { outline: 0; border-color: var(--azul-2); box-shadow: 0 0 0 3px rgba(45,91,255,.18); }
.clase-sala .tiny { line-height: 1.45; color: var(--texto-suave); }

/* ---------------- profesor: sala fija y disponibilidad ---------------- */

.caja-dispo {
  background: var(--vidrio); border: 1px solid var(--borde); border-radius: var(--r);
  padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem;
}
.dispo-pie { margin: 0; line-height: 1.5; color: var(--texto-suave); }
.dispo-acciones { display: flex; flex-wrap: wrap; gap: .6rem; }
.dispo-acciones .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.dispo-scroll { max-height: 28rem; overflow: auto; border: 1px solid var(--borde); border-radius: 14px; background: rgba(0,0,0,.25); }
.dispo { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 26rem; }
.dispo th, .dispo td { border-bottom: 1px solid var(--borde); border-right: 1px solid var(--borde); padding: 0; text-align: center; }
.dispo tr > :last-child { border-right: 0; }
.dispo thead th { position: sticky; top: 0; z-index: 2; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--azul-2); background: #0E1428; padding: .55rem .3rem; font-weight: 500; }
.dispo tbody th { position: sticky; left: 0; z-index: 1; font-family: var(--mono); font-size: .8rem; font-weight: 500; text-align: left; padding: .5rem .8rem; background: #0E1428; white-space: nowrap; color: var(--texto-suave); }
.dispo td { min-width: 2.6rem; }
.dispo label { display: block; cursor: pointer; padding: .5rem .2rem; min-height: 40px; transition: background-color 140ms ease, box-shadow 140ms ease; }
.dispo label:has(input:checked) { background: rgba(53,224,161,.18); box-shadow: inset 0 0 0 1px rgba(53,224,161,.5); }
.dispo label:focus-within { outline: 2px solid var(--cian); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .dispo label:not(:has(input:checked)):hover { background: rgba(45,91,255,.14); } }
.dispo input { accent-color: var(--verde-n); width: 1rem; height: 1rem; cursor: pointer; }
.dispo .copiar {
  display: inline-grid; place-items: center; margin-left: .35rem; width: 1.5rem; height: 1.5rem;
  font: inherit; font-size: .8rem; cursor: pointer; border-radius: 6px;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2); color: #fff;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.dispo .copiar:hover { border-color: var(--cian); color: var(--cian); }
.dispo .copiar:focus-visible { outline: 2px solid var(--cian); outline-offset: 1px; }

/* ---------------- agenda dentro del panel: en oscuro ---------------- */

.panel-alumno .agenda { background: var(--vidrio); border-color: var(--borde); box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.panel-alumno .agenda .dias { border-color: var(--borde); }
.panel-alumno .cal-nav { background: rgba(0,0,0,.2); border-color: var(--borde); }
.panel-alumno .cal-mes { color: #fff; }
.panel-alumno .cal-flecha { background: rgba(255,255,255,.06); border-color: var(--borde-2); color: var(--cian); }
.panel-alumno .cal-flecha:disabled { color: #4A5573; background: transparent; }
.panel-alumno .cal-semana { border-color: var(--borde); }
.panel-alumno .cal-semana span { color: var(--azul-2); }
.panel-alumno .cal-dia { background: rgba(255,255,255,.05); color: #fff; }
.panel-alumno .cal-dia .p { background: var(--verde-n); box-shadow: 0 0 8px var(--verde-n); }
.panel-alumno .cal-dia:disabled { color: #4A5573; background: transparent; }
.panel-alumno .cal-dia.hoy:not(.activo) { box-shadow: inset 0 0 0 1.5px var(--ocre); }
.panel-alumno .cal-dia.activo { background: var(--azul); border-color: var(--azul); box-shadow: 0 8px 24px rgba(45,91,255,.45); }
@media (hover: hover) and (pointer: fine) { .panel-alumno .cal-dia:not(:disabled):not(.activo):hover { background: rgba(45,91,255,.2); border-color: var(--azul-2); } }
.panel-alumno .bloque-nombre { color: var(--azul-2); }
.panel-alumno .hora { background: rgba(255,255,255,.05); border-color: var(--borde); color: #fff; }
.panel-alumno .hora .q { color: var(--verde-n); }
.panel-alumno .hora[disabled] { background: transparent; color: #4A5573; }
.panel-alumno .hora[disabled] .q { color: #4A5573; }
.panel-alumno .hora[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); }
@media (hover: hover) and (pointer: fine) { .panel-alumno .hora:not([aria-pressed="true"]):not([disabled]):hover { background: rgba(45,91,255,.2); border-color: var(--azul-2); } }
.panel-alumno .agenda-pie { background: rgba(0,0,0,.2); border-color: var(--borde); color: var(--texto-suave); }
.panel-alumno .empty { background: var(--vidrio); border-color: var(--borde-2); color: var(--texto-suave); }
.panel-alumno .empty strong { color: #fff; }
.panel-alumno .prompt { background: var(--vidrio); border-color: var(--borde-2); color: var(--texto-suave); }
.panel-alumno .count-bar { border-color: var(--borde); }
.panel-alumno .count-bar .n { color: #fff; }
.panel-alumno .count-bar .tiny { color: var(--texto-suave); }
.panel-alumno .reserva-caja { background: var(--vidrio); border-color: rgba(45,91,255,.45); box-shadow: 0 20px 50px rgba(45,91,255,.18); }
.panel-alumno .reserva-nota { color: var(--texto-suave); }

/* ---------------- aviso flotante ---------------- */

.aviso {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  z-index: 80; background: #0E1428; color: #fff; border: 1px solid var(--borde-2);
  padding: .8rem 1.2rem; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 30px rgba(45,91,255,.2);
  max-width: calc(100vw - 3rem);
  animation: subir 400ms var(--out);
}

/* ---------------- teléfono ---------------- */

@media (max-width: 34rem) {
  .acceso { padding: 1rem; }
  .acceso-caja { padding: 2rem 1.3rem 1.8rem; border-radius: 20px; }
  .panel-top { padding: .6rem .75rem; }
  .panel-top-fila { height: 3.4rem; }
  .panel-top .logo .words { display: none; }
  .panel-main { padding: 1.25rem 1rem 4rem; gap: 2rem; }
  .panel-cabecera { padding-top: .5rem; }
  .row { padding: .9rem .95rem; }
  .acciones-clase { justify-content: flex-start; }
  .acciones-clase .btn { min-height: 42px; }
  .tarjetas { grid-template-columns: repeat(2, 1fr); }
  .caja-dispo { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .acceso-caja, .bloque { opacity: 1; translate: none; animation: none; }
}

/* Con un diálogo abierto, el fondo deja de animarse y el halo del
   cursor se apaga: detrás de la ventana no se ven, y seguir dibujándolos
   le quitaba fluidez a lo que sí se está usando. */
body.ventana-abierta .aurora span { animation-play-state: paused; }
body.ventana-abierta .cursor-glow { opacity: 0; }

/* ---------------- modo liviano de los paneles ----------------
   En Edge la pantalla dejaba de redibujarse: el aviso de guardado
   quedaba pegado hasta refrescar, el botón seguía en «Guardando…»
   aunque ya había guardado y las casillas tardaban en marcarse. La
   página estaba bien; lo que no alcanzaba a actualizarse era la imagen.
   Detrás había capas fijas del tamaño de la pantalla: la aurora
   animada sin pausa y la malla con máscara. Los paneles son para
   trabajar, así que el fondo queda quieto y sin máscara. La portada
   conserva todo el movimiento. */
.panel-shell > .aurora span,
.admin-shell > .aurora span { animation: none; will-change: auto; }
.panel-shell > .malla,
.admin-shell > .malla { display: none; }

/* Día sin clases en la agenda del panel. */
.panel-alumno .cal-dia.bloqueado { color: #FF9A9D; background: rgba(255,90,95,.08); box-shadow: inset 0 0 0 1px rgba(255,90,95,.35); cursor: help; }
.panel-alumno .cal-dia.bloqueado .n { text-decoration: line-through; text-decoration-color: rgba(255,90,95,.8); }

/* ---------------- material, resúmenes y tareas ----------------

   Dos vistas del mismo dato: en el panel del profesor va dentro de la
   tarjeta de cada clase (sube y escribe al colgar); en el del alumno,
   en su propio bloque (vuelve a mirarlo entre clase y clase). */

.archivo {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--borde);
  border-radius: 12px;
}
.archivo + .archivo { margin-top: .5rem; }
.ar-ico {
  width: 2rem; height: 2rem; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(45,91,255,.16); color: var(--azul-2); font-size: 1rem;
}
.ar-datos { display: flex; flex-direction: column; gap: .12rem; min-width: 0; flex: 1; }
.ar-t {
  font-size: .92rem; font-weight: 500; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ar-s { font-family: var(--mono); font-size: .68rem; color: var(--texto-suave); }

/* ---- en la tarjeta del profesor ---- */

.clase-mat {
  margin-top: .85rem; padding-top: .85rem;
  border-top: 1px solid var(--borde);
  display: flex; flex-direction: column; gap: .7rem;
}
.cm-cab { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.cm-t {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--texto-suave);
}
.cm-acciones { display: flex; gap: .5rem; }
.cm-lista:empty { display: none; }

.cm-form { display: flex; flex-direction: column; gap: .45rem; }
.cm-form label { font-size: .85rem; color: #DCE4F5; }
.cm-form label .tiny { color: var(--texto-suave); }
.cm-form textarea, .cm-form input[type="text"] {
  width: 100%; font: inherit; font-size: .92rem; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2);
  border-radius: 10px; padding: .6rem .7rem; resize: vertical;
}
.cm-form textarea:focus, .cm-form input:focus {
  outline: 0; border-color: var(--azul-2); background: rgba(45,91,255,.08);
  box-shadow: 0 0 0 3px rgba(45,91,255,.18);
}
.cm-pie { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cm-estado { color: var(--texto-suave); }

/* Acciones de texto dentro de una fila de archivo. */
.enlace {
  font: inherit; font-size: .8rem; cursor: pointer;
  background: none; border: 0; padding: 0; color: var(--azul-2);
  text-decoration: underline; text-underline-offset: 2px;
}
.enlace:hover { color: #fff; }
.enlace.peligro { color: #FFB4B6; }
.enlace[disabled] { opacity: .5; cursor: default; }

/* ---- resúmenes, en el panel del alumno ---- */

.resumen {
  padding: .9rem 1rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--borde);
  border-radius: 14px;
}
.resumen + .resumen { margin-top: .6rem; }
.re-cab { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.re-f { font-family: var(--mono); font-size: .72rem; color: var(--azul-2); letter-spacing: .06em; }
.re-p { font-size: .78rem; color: var(--texto-suave); }
.re-t { margin: .5rem 0 0; font-size: .93rem; line-height: 1.55; color: #E7ECF8; white-space: pre-line; }

.palabras { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.palabra {
  font-family: var(--mono); font-size: .74rem;
  padding: .25rem .55rem; border-radius: 999px;
  background: rgba(45,91,255,.14); color: #C8D6FF;
  border: 1px solid rgba(45,91,255,.3);
}

/* ---------------- tareas ---------------- */

.tarea {
  padding: .95rem 1.05rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--borde);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: .5rem;
}
.tarea + .tarea { margin-top: .6rem; }
.ta-cab { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.ta-t { font-size: 1rem; font-weight: 600; color: #fff; }
.ta-s { margin: 0; font-family: var(--mono); font-size: .72rem; color: var(--texto-suave); letter-spacing: .04em; }
.ta-i { margin: 0; font-size: .92rem; line-height: 1.55; color: #E7ECF8; white-space: pre-line; }
.ta-k {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--texto-suave);
}
.ta-texto { margin: .3rem 0 0; font-size: .92rem; line-height: 1.55; color: #E7ECF8; white-space: pre-line; }

.ta-entrega, .ta-correccion {
  padding: .65rem .8rem; border-radius: 11px;
  display: flex; flex-direction: column; gap: .15rem;
}
.ta-entrega { background: rgba(255,255,255,.04); border: 1px solid var(--borde); }
.ta-correccion { background: rgba(45,91,255,.1); border: 1px solid rgba(45,91,255,.28); }

.ta-form { display: flex; flex-direction: column; gap: .5rem; }
.ta-form textarea {
  width: 100%; font: inherit; font-size: .92rem; color: #fff; resize: vertical;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2);
  border-radius: 10px; padding: .6rem .7rem;
}
.ta-form textarea:focus {
  outline: 0; border-color: var(--azul-2); background: rgba(45,91,255,.08);
  box-shadow: 0 0 0 3px rgba(45,91,255,.18);
}
.ta-pie { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ta-nombre { color: var(--texto-suave); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* El formulario para mandar una tarea, en el panel del profesor. */
.tarea-nueva {
  display: grid; grid-template-columns: 1fr 12rem; gap: .85rem;
  align-items: end; padding-bottom: .9rem; margin-bottom: .3rem;
  border-bottom: 1px solid var(--borde);
}
.tarea-nueva .campo-ancho { grid-column: 1 / -1; }
.tarea-nueva .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 40rem) { .tarea-nueva { grid-template-columns: 1fr; } }
.tarea-nueva select,
.tarea-nueva input[type="date"],
.tarea-nueva input[type="text"],
.tarea-nueva textarea {
  width: 100%; font: inherit; font-size: .92rem; color: #fff; resize: vertical;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2);
  border-radius: 10px; padding: .55rem .7rem; min-height: 42px;
}
.tarea-nueva select option { background: #0E1428; color: #fff; }
.tarea-nueva select:focus,
.tarea-nueva input:focus,
.tarea-nueva textarea:focus {
  outline: 0; border-color: var(--azul-2); background: rgba(45,91,255,.08);
  box-shadow: 0 0 0 3px rgba(45,91,255,.18);
}

/* El estado intermedio: entregada pero sin corregir. */
.estado.espera {
  background: rgba(45,91,255,.14); color: var(--azul-2);
  border-color: rgba(45,91,255,.4);
}

/* Dentro de la tarjeta de tarea todo es una columna flexible, así que
   lo que no es un bloque de texto hay que dejarlo de su tamaño. */
.ta-entrega .enlace, .ta-correccion .enlace { align-self: flex-start; }
.tarea > .btn { align-self: flex-start; }

/* Una clase ya dada pesa menos que una que viene: mismo formato, menos
   presencia, para que lo próximo siga siendo lo primero que se ve. */
.clase.dada { opacity: .92; }
.clase.dada .when { color: var(--texto-suave); }

/* La guía de la tarea: botón y nombre del archivo en la misma línea. */
.tarea-archivo { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.tarea-archivo .tiny { color: var(--texto-suave); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pasar lista: tres botones que se comportan como una sola respuesta. */
.clase-lista {
  margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--borde);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.lista-botones { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip-lista {
  font: inherit; font-size: .82rem; cursor: pointer;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--borde-2); color: var(--texto-suave);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.chip-lista:hover:not([disabled]) { border-color: var(--azul-2); color: #fff; }
.chip-lista.on { background: rgba(45,91,255,.18); border-color: var(--azul-2); color: #fff; font-weight: 600; }
.chip-lista[disabled] { opacity: .6; cursor: default; }

/* ---------------- libro de clases ----------------
   La misma tabla que ve la administración. Se lee de corrido, como la
   planilla que llevaban a mano: una fila por clase. */
.libro-filtros {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .8fr)) minmax(0, 1.2fr) auto;
  gap: .75rem; align-items: end;
}
@media (max-width: 62rem) { .libro-filtros { grid-template-columns: 1fr 1fr; } .libro-filtros .btn { grid-column: 1 / -1; } }
.libro-filtros input, .libro-filtros select {
  font: inherit; font-size: .9rem; color: #fff; width: 100%; min-height: 42px;
  background: rgba(255,255,255,.06); border: 1px solid var(--borde-2); border-radius: 10px;
  padding: .5rem .75rem; color-scheme: dark;
}
.libro-filtros input:focus, .libro-filtros select:focus {
  outline: 0; border-color: var(--azul-2); box-shadow: 0 0 0 3px rgba(45,91,255,.18);
}
.libro-filtros select option { background: #0E1428; color: #fff; }
.libro-filtros .btn { min-height: 42px; }

.libro-scroll { overflow-x: auto; margin-top: 1.1rem; }
table.libro { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 46rem; }
table.libro th {
  text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--borde);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--azul-2); font-weight: 500; white-space: nowrap;
}
table.libro td { padding: .85rem .8rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
table.libro tr:last-child td { border-bottom: 0; }
table.libro tr.sin-clase td { opacity: .72; }
.libro-fecha { white-space: nowrap; font-weight: 600; text-transform: capitalize; }
.libro-fecha span { display: block; font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--texto-suave); }
.libro-texto { line-height: 1.5; max-width: 26rem; color: var(--texto-suave); }
.libro-palabras {
  display: block; margin-top: .4rem; font-family: var(--mono); font-size: .72rem; color: var(--verde-n);
}

/* ---- la tarea dentro del libro ----
   La misma información que ve quien la mandó, pero apretada en una
   celda: título, en qué va, la guía, lo que entregó el alumno y la
   corrección. Si hay más de una tarea ese día, se separan con una
   línea para que no se lean como una sola. */

.libro-tarea {
  display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  padding-bottom: .7rem; margin-bottom: .7rem;
  border-bottom: 1px dashed var(--borde);
}
.libro-tarea:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.libro-tarea .lt-t { font-weight: 600; color: #fff; line-height: 1.35; }
.libro-tarea .lt-i { font-size: .82rem; line-height: 1.5; white-space: pre-line; }
.libro-tarea .lt-k {
  margin-top: .25rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--texto-suave);
}
.libro-tarea .estado { font-size: .72rem; }
.libro-tarea .enlace { text-align: left; }
.libro-tarea .btn { margin-top: .25rem; }

/* ---- qué tareas se están mirando ---- */

.tareas-vista { display: flex; align-items: center; gap: .6rem; margin: 1.2rem 0 .9rem; flex-wrap: wrap; }
.tareas-vista label {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--texto-suave);
}
.tareas-vista select {
  flex: 1 1 18rem; max-width: 26rem;
  padding: .6rem .7rem; border-radius: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--borde);
  color: #fff; font: inherit; font-size: .88rem;
}
.tareas-vista select:focus { outline: 2px solid var(--azul-2); outline-offset: 1px; }
.tareas-vista select option { background: #0E1428; color: #fff; }

/* ---------------- el libro de un alumno ----------------
   Plegado por mes y por clase. Con doscientas clases la página mide lo
   mismo que con cuatro: lo que se busca es una clase, no la lista. */

.volver {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-bottom: 1rem; font-size: .88rem; color: var(--texto-suave); text-decoration: none;
}
.volver:hover { color: #fff; }

.mes { border-bottom: 1px solid var(--borde); }
.mes:last-child { border-bottom: 0; }
.mes-cab {
  width: 100%; display: flex; align-items: center; gap: .7rem;
  padding: .9rem .2rem; background: none; border: 0; cursor: pointer;
  font: inherit; color: #fff; text-align: left;
}
.mes-t { font-weight: 600; text-transform: capitalize; }
.mes-n { margin-left: auto; font-family: var(--mono); font-size: .76rem; color: var(--texto-suave); }
.mes-cuerpo { padding-bottom: .8rem; display: flex; flex-direction: column; gap: .4rem; }

.cl { border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid transparent; }
.cl.abierta { border-color: var(--borde); background: rgba(255,255,255,.05); }
.cl.sin-clase { opacity: .78; }
.cl-cab {
  width: 100%; display: flex; align-items: center; gap: .8rem;
  padding: .7rem .85rem; background: none; border: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.cl-cab:hover { background: rgba(255,255,255,.04); border-radius: 12px; }
.cl-fecha {
  flex: 0 0 auto; width: 6.5rem; font-weight: 600; font-size: .85rem; text-transform: capitalize;
}
.cl-fecha span { display: block; font-family: var(--mono); font-size: .7rem; font-weight: 400; color: var(--texto-suave); }
.cl-medio { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.cl-asomo {
  font-size: .88rem; color: var(--texto-suave); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cl-tarea {
  font-family: var(--mono); font-size: .68rem; padding: .1rem .4rem; border-radius: 999px;
  background: rgba(255,255,255,.07); color: var(--texto-suave);
}
.cl-tarea.urge { background: rgba(255,90,95,.16); color: #FFB4B6; }
.cl-estado { flex: 0 0 auto; }
.cl-flecha { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s; }
.cl.abierta .cl-flecha, .mes.abierto .cl-flecha { transform: rotate(180deg); }

.cl-cuerpo {
  padding: .2rem .9rem 1rem; display: flex; flex-direction: column; gap: 1rem;
  border-top: 1px solid var(--borde); margin-top: .1rem;
}
.cl-bloque { display: flex; flex-direction: column; gap: .35rem; padding-top: .8rem; }
.cl-texto { margin: 0; font-size: .92rem; line-height: 1.6; color: #E7ECF8; white-space: pre-line; }
.cl-pie { display: flex; gap: .5rem; }

@media (max-width: 40rem) {
  .cl-cab { flex-wrap: wrap; gap: .4rem .7rem; }
  .cl-fecha { width: auto; }
  .cl-medio { flex-basis: 100%; order: 3; }
  .cl-asomo { white-space: normal; }
}
