/* ============================================================
   Entrena — Sistema de diseño "Papel & Tinta"
   Todo claro: papel cálido + tinta negra + azul eléctrico como
   único acento de datos. CTAs negros tinta (nada de degradés
   genéricos). Tipografías: Space Grotesk (display) + Manrope.
   Navegación oculta: drawer off-canvas desde la botonera.
   Paleta de gráficos validada (dataviz): #2a78d6 + #c94a75
   sobre blanco (CVD ΔE 15.4 · contraste ≥ 3:1).
   ============================================================ */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/static/fonts/spacegrotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/static/fonts/manrope-var.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --glass: rgba(20, 22, 26, .04);
  --ink: #14161a;
  --ink-2: #454c56;
  --muted: #7d8289;
  --hairline: #e9e6de;
  --hairline-strong: #d9d5ca;
  --primary: #1f5eff;
  --primary-deep: #1849d8;
  --primary-ink: #1a4fd6;          /* texto/links azul eléctrico sobre papel */
  --primary-soft: rgba(31, 94, 255, .09);
  --cta: #16181d;                  /* botón tinta */
  --cta-hover: #23262d;
  --accent: #1f5eff;
  --accent-soft: rgba(31, 94, 255, .09);
  --amber: #b97b00;
  --amber-ink: #8a5d00;
  --amber-soft: #fdf3dd;
  --ok: #0f8a3d;
  --ok-ink: #0b6b30;
  --ok-soft: #e4f4e9;
  --danger: #cf3a3a;
  --danger-ink: #a32c2c;
  --danger-soft: #fbe9e9;
  --magenta-ink: #a63a60;
  --magenta-soft: #f9e8ee;
  --chart-1: #2a78d6;
  --chart-2: #c94a75;
  --chart-grid: #eeece5;
  --chart-axis: #d8d5cb;
  --grad-hero: linear-gradient(120deg, #14161a 0%, #23262d 60%, #1a2c55 100%);
  --radius: 18px;
  --radius-sm: 13px;
  --shadow-1: 0 1px 2px rgba(20, 22, 26, .04), 0 6px 24px rgba(20, 22, 26, .05);
  --shadow-2: 0 18px 50px rgba(20, 22, 26, .16);
  --shadow-lift: 0 8px 26px rgba(20, 22, 26, .1);
  --glow-cta: 0 2px 10px rgba(20, 22, 26, .22);
  --glow-cta-hover: 0 6px 22px rgba(31, 94, 255, .28);
  --ring: 0 0 0 3px rgba(31, 94, 255, .25);
  --ease: cubic-bezier(.22, .8, .36, 1);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}

/* Transiciones suaves entre páginas (View Transitions API, degrada sola) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: url('/static/img/patterns/pattern-grid.svg');
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(31, 94, 255, .18); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
a { color: var(--primary-ink); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-family: var(--font-display); }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.08rem; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }

/* Scrollbar con identidad: tinta y azul partidos por una barra diagonal "/" */
* { scrollbar-width: thin; scrollbar-color: #1f5eff transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 8px; border: 2px solid var(--bg); background-clip: padding-box;
  background-image: linear-gradient(160deg, #1f5eff 0%, #1f5eff 44%, #f7f6f2 46%, #f7f6f2 52%, #14161a 54%, #14161a 100%);
}
::-webkit-scrollbar-thumb:hover {
  background-image: linear-gradient(160deg, #4b83ff 0%, #4b83ff 44%, #ffffff 46%, #ffffff 52%, #2c3038 54%, #2c3038 100%);
}

/* Cursor propio: flecha azul eléctrico con filo blanco */
body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M5.2 2.8v15.3l4.1-3.8 2.6 6 2.7-1.2-2.6-5.9 5.6-.6z' fill='%231f5eff' stroke='white' stroke-width='1.3' stroke-linejoin='round'/></svg>") 5 3, default;
}
html.navigating, html.navigating * { cursor: progress !important; }

/* ============================================================
   Shell: topbar fija + drawer oculto (se despliega con la botonera)
   ============================================================ */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--hairline);
}
/* Línea de energía bajo el header */
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--cta) 0%, var(--primary) 26%, rgba(31, 94, 255, .25) 55%, transparent 80%);
}
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .2s var(--ease);
}
.menu-btn:hover { border-color: var(--ink); box-shadow: var(--shadow-lift); }
.menu-btn:active { transform: scale(.94); }
.tb-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.tb-brand b { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
.topbar .tt { font-family: var(--font-display); font-weight: 500; font-size: .95rem; color: var(--ink-2); padding-left: 12px; border-left: 1px solid var(--hairline-strong); }
.topbar .sp { flex: 1; }
.topbar .avatar { text-decoration: none; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--cta);
  color: #fff; font-weight: 700; font-size: .85rem; font-family: var(--font-display);
  display: inline-flex; align-items: center; justify-content: center;
}
/* Menú de usuario desplegable (avatar del header) */
.user-menu { position: relative; }
.user-menu .avatar { border: 0; cursor: pointer; transition: box-shadow .15s, transform .12s var(--ease); }
.user-menu .avatar:hover { box-shadow: 0 0 0 3px rgba(31, 94, 255, .2); }
.user-menu .avatar:active { transform: scale(.94); }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; z-index: 46;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: var(--shadow-2); padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.user-menu.open .user-pop { opacity: 1; transform: none; pointer-events: auto; }
.up-head { padding: 10px 12px 9px; border-bottom: 1px solid var(--hairline); margin-bottom: 5px; line-height: 1.3; }
.up-head b { display: block; font-size: .86rem; }
.up-head small { color: var(--muted); font-size: .73rem; }
.up-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; border: 0; background: none; cursor: pointer;
  font-family: var(--font); font-size: .87rem; font-weight: 600; color: var(--ink-2);
  text-align: left; transition: background .12s, color .12s;
}
.up-item:hover { background: var(--surface-2); color: var(--ink); }
.up-item.danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
.up-item svg { flex: none; opacity: .7; }

.bell { position: relative; display: inline-flex; padding: 8px; border-radius: 12px; color: var(--ink-2); }
.bell:hover { background: var(--glass); color: var(--ink); }
.bell .dot {
  position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--primary); color: #fff; font-size: .64rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.bell { border: 0; background: none; cursor: pointer; }

/* ---------- Panel desplegable de notificaciones (campana) ---------- */
.notif-menu { position: relative; }
.notif-pop {
  position: absolute; right: -52px; top: calc(100% + 10px); width: 372px; max-width: calc(100vw - 24px); z-index: 46;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: var(--shadow-2); overflow: hidden;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.notif-menu.open .notif-pop { opacity: 1; transform: none; pointer-events: auto; }
.np-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--hairline);
}
.np-head b { font-family: var(--font-display); font-size: .98rem; }
.np-head a { font-size: .8rem; font-weight: 700; color: var(--primary-ink); text-decoration: none; }
.np-head a:hover { text-decoration: underline; }
.np-list { max-height: min(430px, 62vh); overflow-y: auto; }
.np-item {
  position: relative; display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 30px 11px 14px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--hairline); transition: background .12s;
}
.np-item:last-child { border-bottom: 0; }
.np-item:hover { background: var(--surface-2); }
.np-ico {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2); margin-top: 1px;
}
.np-ico.t-pago { background: var(--ok-soft, #e7f3ec); color: var(--ok-ink, #1c7a4d); }
.np-ico.t-anotacion, .np-ico.t-clase { background: rgba(31, 94, 255, .1); color: var(--primary-ink); }
.np-ico.t-vencimiento { background: var(--amber-soft); color: var(--amber-ink); }
.np-body { display: block; min-width: 0; line-height: 1.35; }
.np-body b { display: block; font-size: .84rem; font-weight: 700; }
.np-txt { display: block; font-size: .8rem; color: var(--ink-2); margin-top: 1px; }
.np-time { display: block; font-size: .73rem; font-weight: 600; color: var(--primary-ink); margin-top: 3px; }
.np-dot {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
  opacity: 0; transition: opacity .15s;
}
/* Las que estaban sin leer al abrir el panel quedan resaltadas hasta que se navegan */
.np-item.nueva { background: rgba(31, 94, 255, .06); }
.np-item.nueva:hover { background: rgba(31, 94, 255, .1); }
.np-item.nueva .np-dot { opacity: 1; }
.np-vacio { padding: 26px 14px; text-align: center; font-size: .84rem; color: var(--muted); }

/* ---------- Ficha rápida del alumno (modal de solo vista) ---------- */
.person.clickable { cursor: pointer; }
.person.clickable:hover .pname { color: var(--primary-ink); }
.cumple-ico { display: inline-flex; color: #c2410c; animation: cumple-pop .5s var(--ease); }
@keyframes cumple-pop { 0% { transform: scale(.4) rotate(-14deg); } 70% { transform: scale(1.18); } 100% { transform: none; } }
.fmodal { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.fmodal-scrim {
  position: absolute; inset: 0; background: rgba(20, 22, 26, .42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .22s var(--ease);
}
.fmodal-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96);
  width: min(430px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px;
  box-shadow: var(--shadow-2); padding: 22px 22px 20px;
  opacity: 0; transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.fmodal.open { pointer-events: auto; }
.fmodal.open .fmodal-scrim { opacity: 1; }
.fmodal.open .fmodal-box { opacity: 1; transform: translate(-50%, -50%); }
.fmodal-x {
  position: absolute; right: 12px; top: 12px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.fmodal-x:hover { background: var(--surface-2); color: var(--ink); }
.fmodal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fmodal-head b { font-family: var(--font-display); font-size: 1.12rem; }
.fmodal-rows { border-top: 1px solid var(--hairline); }
.fm-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: .88rem;
}
.fm-row span { color: var(--muted); flex: none; }
.fm-row b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.fmodal-actions { display: flex; gap: 10px; margin-top: 16px; }
.fmodal-actions .btn-primary { flex: 1; justify-content: center; }
@media (max-width: 480px) {
  .fmodal-box { padding: 18px 16px 16px; }
}
@media (max-width: 720px) {
  .notif-menu { position: static; }
  .notif-pop { right: 8px; left: 8px; width: auto; top: 56px; }
}

/* Scrim: nunca [hidden] — opacity + pointer-events (lección aprendida) */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 22, 26, .38);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* Drawer: oculto fuera de pantalla, entra al tocar la botonera */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  width: 292px; max-width: 86vw;
  display: flex; flex-direction: column; padding: 18px 16px 16px;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  transform: translateX(-103%);
  transition: transform .28s var(--ease);
  overflow-y: auto;
}
body.nav-open .drawer { transform: none; box-shadow: 30px 0 70px rgba(20, 22, 26, .18); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.drawer-head .sp { flex: 1; }
.drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 0; background: none; color: var(--muted);
  transition: background .15s, color .15s;
}
.drawer-close:hover { background: var(--glass); color: var(--ink); }

.brand { display: flex; align-items: center; gap: 11px; }
.brand svg { flex: none; }
.brand b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: .73rem; margin-top: -2px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.side-sec {
  font-size: .68rem; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; padding: 14px 12px 6px;
  display: flex; align-items: center; gap: 8px;
}
.side-sec::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }
.sidenav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  color: var(--ink-2); font-weight: 600; font-size: .92rem;
  isolation: isolate;
  transition: color .14s;
}
/* barrido azul: entra desde la izquierda con borde de luz al frente y sale por la derecha */
.sidenav a:not(.on)::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(90deg, rgba(31, 94, 255, .11), rgba(31, 94, 255, .24) 88%, rgba(31, 94, 255, .46));
  transform: scaleX(0); transform-origin: right center;
  transition: transform .32s var(--ease);
}
.sidenav a:not(.on):hover::after { transform: scaleX(1); transform-origin: left center; }
.sidenav a svg { flex: none; opacity: .6; transition: opacity .14s, transform .18s var(--ease); }
.sidenav a:hover { color: var(--ink); }
.sidenav a:hover svg { opacity: 1; transform: translateX(1px) scale(1.06); }
.sidenav a.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.sidenav a.on::before {
  content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3.5px; border-radius: 0 4px 4px 0; background: var(--primary);
}
.sidenav a.on svg { opacity: 1; }

.side-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.side-user .su-info { flex: 1; min-width: 0; line-height: 1.25; }
.side-user .su-info b { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .su-info small { color: var(--muted); font-size: .72rem; }
.su-out {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  padding: 7px; border-radius: 10px; display: inline-flex;
}
.su-out:hover { background: var(--danger-soft); color: var(--danger-ink); }

.content { padding: 18px 26px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Cards y grids ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1); padding: 22px; margin-bottom: 20px;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .sp { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

/* Hero: bloque tinta con la foto fundida — el punto de drama sobre el papel */
.hero {
  border-radius: 22px; overflow: hidden; position: relative;
  color: #fff; padding: 28px 28px 24px; margin-bottom: 18px;
  background: var(--grad-hero);
  box-shadow: var(--shadow-2);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(17, 19, 24, .95) 12%, rgba(17, 19, 24, .62) 55%, rgba(17, 19, 24, .3)),
    var(--hero-img);
  background-size: cover; background-position: center 30%;
  filter: saturate(.75);
  pointer-events: none;
}
/* Segunda foto del hero: fundido cruzado lento entre --hero-img y --hero-img-b */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(90deg, rgba(17, 19, 24, .95) 12%, rgba(17, 19, 24, .62) 55%, rgba(17, 19, 24, .3)),
    var(--hero-img-b, none);
  background-size: cover; background-position: center 30%;
  filter: saturate(.75);
  opacity: 0; transition: opacity 2.4s ease-in-out;
  pointer-events: none;
}
.hero.fase-b::before { opacity: 1; }
.hero.sin-fundido::before { transition: none; }
@media (prefers-reduced-motion: reduce) { .hero::before { transition: none; } }
.hero > * { position: relative; z-index: 2; }
/* Bienvenida animada dentro del hero */
.hero-anim {
  position: absolute; right: 24px; bottom: 20px; width: 112px; height: 112px;
  border-radius: 16px; overflow: hidden; z-index: 1;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  transition: opacity 2.4s ease-in-out;
}
/* Lottie por fase del rotador de fotos (data-fases): se funde junto con la foto */
.hero-anim.oculta { opacity: 0; }
@media (max-width: 900px) { .hero-anim { display: none; } }
.hero .saludo { font-size: .82rem; opacity: .8; font-weight: 500; letter-spacing: .01em; }
.hero h1 { color: #fff; margin: 2px 0 18px; font-size: 1.8rem; font-weight: 600; }
.hero .big {
  font-family: var(--font-display);
  font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.05;
}
.hero .sub { font-size: .8rem; opacity: .85; }

/* Stat tiles */
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-1);
  padding: 16px 18px 14px; display: flex; flex-direction: column-reverse; gap: 4px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--hairline-strong); box-shadow: var(--shadow-lift); }
a.stat { color: inherit; }
.stat .k { font-family: var(--font-display); font-size: 2.15rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .78rem; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .l::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-strong); flex: none; }
.stat.tinted-ok .l::before { background: var(--ok); }
.stat.tinted-warn .l::before { background: var(--amber); }
.stat.tinted-bad .l::before { background: var(--danger); }
.stat .d { font-size: .75rem; font-weight: 700; }
.stat .d.up { color: var(--ok-ink); }
.stat .d.down { color: var(--danger-ink); }

/* Chips de estado */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  white-space: nowrap; border: 1px solid transparent;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.activo { background: var(--ok-soft); color: var(--ok-ink); }
.chip.por_vencer { background: var(--amber-soft); color: var(--amber-ink); }
.chip.vencido { background: var(--danger-soft); color: var(--danger-ink); }
.chip.inactivo { background: var(--surface-2); color: var(--muted); }
.chip.sin_paquete { background: var(--magenta-soft); color: var(--magenta-ink); }
.chip.aprobado { background: var(--ok-soft); color: var(--ok-ink); }
.chip.anulado { background: var(--surface-2); color: var(--muted); }
.chip.ingreso { background: var(--ok-soft); color: var(--ok-ink); }
.chip.egreso { background: var(--magenta-soft); color: var(--magenta-ink); }

/* ---------- Botones: pill, CTA tinta negra ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-display); font-size: .89rem; font-weight: 500; letter-spacing: .01em;
  background: var(--surface); color: var(--ink);
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .15s, border-color .15s, color .15s;
  text-align: center;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn-primary {
  background: var(--cta); color: #fff; border-color: var(--cta);
  box-shadow: var(--glow-cta);
}
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); box-shadow: var(--glow-cta-hover); }
.btn-ghost { background: transparent; border: 1.5px solid var(--hairline-strong); color: var(--ink-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.btn-wpp { background: #e7f8ec; color: #0b7a35; border-color: transparent; }
.btn-sm { padding: 9px 16px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Formularios ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f span { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--hairline-strong); background: var(--surface);
  font-family: var(--font); font-size: .95rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.inp::placeholder { color: var(--muted); }
.inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 94, 255, .14); }
.frow { display: flex; gap: 12px; }
.frow > * { flex: 1; }

/* Combobox con búsqueda (Cobrar → alumno) */
.ac { position: relative; }
.ac-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2); overflow: hidden; max-height: 290px; overflow-y: auto;
}
.ac.open .ac-list { display: block; }
.ac-item {
  display: block; width: 100%; text-align: left; padding: 11px 14px; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--hairline);
  font: inherit; color: var(--ink);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.sel { background: var(--surface-2); color: var(--primary-ink, var(--primary)); }
.ac-empty { padding: 12px 14px; color: var(--muted); font-size: .9rem; }

/* Agenda de clases (vista Clases) */
.day-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 14px; }
.day-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer;
  min-width: 86px; padding: 10px 14px; border-radius: 16px; font: inherit;
  background: var(--surface); border: 1px solid var(--hairline-strong); color: var(--ink);
  transition: border-color .15s, box-shadow .2s var(--ease), background .15s;
}
.day-chip small { font-size: .72rem; font-weight: 700; color: var(--ink-2); text-transform: capitalize; }
.day-chip b { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.day-chip .dc-n { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.day-chip:hover { border-color: var(--ink); box-shadow: var(--shadow-lift); }
.day-chip.activo { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-chip.activo small, .day-chip.activo .dc-n { color: rgba(255, 255, 255, .72); }
.day-chip.hoy:not(.activo) { border-color: var(--primary); }
.day-panel { display: none; }
.day-panel.visible { display: block; }
.day-title { margin: 4px 0 12px; color: var(--ink-2); font-size: .95rem; text-transform: capitalize; }
.clases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.clase-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 16px 18px;
  transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease);
}
.clase-card:hover { border-color: var(--ink); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.clase-card.llena { background: color-mix(in srgb, var(--surface) 96%, var(--chart-2)); }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-hora { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cc-nombre { font-weight: 800; margin-top: 2px; }
.cc-lugar { color: var(--muted); font-size: .85rem; }
.cc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.cc-ring { position: relative; width: 64px; height: 64px; }
.cc-rtxt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cc-rtxt b { font-family: var(--font-display); font-size: 1.05rem; }
.cc-rtxt small { color: var(--muted); font-size: .75rem; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* ---------- Tablas ---------- */
.tblwrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th {
  text-align: left; font-size: .72rem; color: var(--muted); font-weight: 700;
  padding: 10px 13px; border-bottom: 1px solid var(--hairline-strong); white-space: nowrap;
  background: var(--surface-2);
}
.tbl th:first-child { border-radius: 9px 0 0 9px; }
.tbl th:last-child { border-radius: 0 9px 9px 0; }
.tbl td { padding: 12px 13px; border-bottom: 1px solid var(--hairline); vertical-align: middle; transition: background .12s; }
.tbl tbody tr:hover td, .tbl tr:hover td { background: #faf9f5; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl tr.anulado td { color: var(--muted); }
.tbl tr.anulado .monto { text-decoration: line-through; }

/* ---------- Listas de personas ---------- */
.person {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px;
  margin: 0 -10px; border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--hairline);
  transition: background .12s;
}
.person:hover { background: #faf9f5; }
.person:last-child { border-bottom: 0; }
/* Notificación sin leer: fondo tenue + punto azul junto al título */
.person.no-leida { background: color-mix(in srgb, #ffffff 94%, var(--primary)); }
.person.no-leida:hover { background: color-mix(in srgb, #ffffff 90%, var(--primary)); }
.person.no-leida .pname::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); margin-right: 7px; vertical-align: 2px;
}
@keyframes bell-pulso { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }
.bell .dot.pulso { animation: bell-pulso .5s var(--ease); }

/* Selector segmentado de secciones (Configuración) */
.seg {
  display: flex; gap: 6px; padding: 6px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
  width: max-content; max-width: 100%; overflow-x: auto;
}
.seg button {
  border: 0; background: none; padding: 9px 18px; border-radius: 999px;
  font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); background: var(--glass); }
.seg button.activo { background: var(--cta); color: #fff; }
.cfg-panel { display: none; }
.cfg-panel.visible { display: block; }

/* Visor de comprobante (modal con iframe) */
.cmodal { position: fixed; inset: 0; z-index: 80; display: none; }
.cmodal.abierto { display: block; }
.cm-scrim { position: absolute; inset: 0; background: rgba(20, 22, 26, .48); backdrop-filter: blur(3px); }
.cm-box {
  position: absolute; left: 50%; top: 3.5vh; transform: translateX(-50%);
  width: min(640px, 94vw); height: 92vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2);
}
.cm-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.cm-bar b { font-family: var(--font-display); }
.cm-bar .sp { flex: 1; }
.cm-x {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--ink); font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.cm-x:hover { border-color: var(--ink); }
.cm-box iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
@media (max-width: 720px) {
  .cm-box { left: 0; top: 0; transform: none; width: 100%; height: 100%; border-radius: 0; }
}
.person .pinfo { flex: 1; min-width: 0; }
.person .pname { font-weight: 700; font-size: .93rem; }
.person .pmeta { font-size: .78rem; color: var(--muted); }
.avatar-s {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; font-family: var(--font-display);
  color: var(--primary-ink); background: var(--primary-soft);
}
.person:nth-child(3n) .avatar-s { background: var(--surface-2); color: var(--ink-2); }
.person:nth-child(3n+2) .avatar-s { background: var(--magenta-soft); color: var(--magenta-ink); }

/* ---------- Flash ---------- */
.flash {
  padding: 13px 16px 13px 14px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; margin-bottom: 16px;
  border-left: 4px solid; animation: rise .3s var(--ease) both;
}
.flash.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger); }

/* ---------- Estados vacíos ---------- */
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .eico {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px;
  background: var(--primary-soft); display: flex; align-items: center; justify-content: center;
  color: var(--primary-ink); font-size: 1.6rem;
}
.empty b { color: var(--ink-2); display: block; margin-bottom: 4px; }
.empty p { font-size: .85rem; margin: 0 0 14px; }

/* ---------- Gráficos SVG (colores desde tokens, ver chart-bars*.ejs) ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.chart .val { font-size: 10px; font-weight: 700; fill: var(--ink-2); font-family: var(--font); }
.chart .cgrid { stroke: var(--chart-grid); }
.chart .cbase { stroke: var(--chart-axis); }
.chart .aline-a { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .aline-b { fill: none; stroke: var(--chart-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .adot-a { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.chart .adot-b { fill: var(--chart-2); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; gap: 16px; font-size: .76rem; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.legend .sw-a { background: var(--chart-1); }
.legend .sw-b { background: var(--chart-2); }

/* Anillo de progreso (clases restantes) */
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { transform: rotate(-90deg); }
.ring .rtxt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .rtxt b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.ring .rtxt small { font-size: .68rem; color: var(--muted); font-weight: 600; }

/* ---------- Login ---------- */
.login-wrap { display: flex; min-height: 100vh; background: var(--bg); }
/* En desktop el login es FIJO: todo entra en una pantalla, sin scroll ni zoom */
@media (min-width: 901px) {
  .login-wrap { height: 100vh; min-height: 0; overflow: hidden; }
}
.login-form-col {
  flex: 0 0 480px; display: flex; flex-direction: column;
  padding: clamp(14px, 3vh, 30px) 52px clamp(12px, 2.4vh, 22px);
  position: relative; overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
}
.login-form-col .brand { padding: 0; }
.login-mid { margin: auto 0; padding: clamp(8px, 2vh, 18px) 0; }
.login-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px; margin-bottom: clamp(8px, 1.8vh, 16px);
  border: 1px solid var(--hairline-strong); background: var(--bg);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-2);
}
.login-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.login-form-col h1 { font-size: clamp(1.3rem, 2.4vh + .55rem, 1.8rem); font-weight: 600; margin-bottom: 6px; }
.login-form-col .sub { color: var(--muted); font-size: .92rem; line-height: 1.55; margin-bottom: clamp(12px, 2.8vh, 30px); }
.inp-wrap { position: relative; display: block; }
.inp-ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  display: inline-flex; color: var(--muted); pointer-events: none;
  transition: color .15s;
}
.inp-wrap:focus-within .inp-ico { color: var(--primary-ink); }
.inp-wrap .inp { padding-left: 44px; }
.inp-wrap .inp.has-eye { padding-right: 46px; }
/* Botón "ver contraseña": alterna los dos íconos con la clase .mostrando */
.inp-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.inp-eye:hover { color: var(--ink); background: rgba(20, 22, 26, .05); }
.inp-eye svg:last-child { display: none; }
.inp-eye.mostrando svg:first-child { display: none; }
.inp-eye.mostrando svg:last-child { display: inline; }
.login-alt { margin-top: 14px; font-size: .86rem; color: var(--muted); }
.login-alt a { color: var(--primary-ink); font-weight: 600; text-decoration: none; }
.login-alt a:hover { text-decoration: underline; }
.login-form-col .inp { padding-top: clamp(10px, 1.6vh, 13px); padding-bottom: clamp(10px, 1.6vh, 13px); border-radius: 14px; background: #fbfaf7; }
.login-form-col label.f { margin-bottom: clamp(10px, 1.9vh, 16px); }
.btn-login { margin-top: 6px; padding-top: clamp(11px, 1.6vh, 13px); padding-bottom: clamp(11px, 1.6vh, 13px); font-size: .92rem; }
.login-foot {
  margin-top: auto; padding-top: clamp(10px, 2vh, 18px); font-size: .76rem; color: var(--muted);
  border-top: 1px solid var(--hairline); line-height: 1.45;
}
/* Promos del login: solo en móvil (el desktop está calibrado para entrar sin scroll) */
.login-promos { display: none; }
.login-img-col { flex: 1; position: relative; overflow: hidden; }
.login-img-col img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
/* Pase de fotos del login (solo cuando la columna tiene .rotando; 2FA/recupero usan una sola) */
.login-img-col.rotando img { opacity: 0; transition: opacity 2.4s ease-in-out; }
.login-img-col.rotando img.al-frente { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .login-img-col.rotando img { transition: none; } }
.login-img-col::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(20, 22, 26, .04), rgba(20, 22, 26, .62));
}
/* Transición realista: el blanco del formulario se funde suavemente en la foto */
.login-img-col::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 240px; z-index: 1;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, .82) 22%, rgba(255, 255, 255, .45) 52%, rgba(255, 255, 255, .15) 78%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
.login-quote {
  position: absolute; z-index: 2; bottom: 44px; left: 44px; right: 44px; color: #fff;
}
.login-quote b { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; display: block; margin-bottom: 6px; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.login-quote span { font-size: .9rem; opacity: .9; text-shadow: 0 1px 10px rgba(0,0,0,.55); }

/* ---------- Check-in (toma de lista) ---------- */
.check-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2);
  border: 1px solid var(--hairline);
  transition: background .15s, border-color .15s;
}
.check-row.presente { background: var(--ok-soft); border-color: #bfe3cb; }
.check-row.ausente { background: var(--danger-soft); border-color: #efc4c4; }
.check-row .cname { flex: 1; font-weight: 700; font-size: .95rem; }
.check-btns { display: flex; gap: 8px; }
.check-btns button {
  width: 46px; height: 46px; border-radius: 13px; border: 1.5px solid var(--hairline-strong);
  background: var(--surface); color: var(--ink);
  font-size: 1.15rem; cursor: pointer; font-family: var(--font);
  transition: transform .12s var(--ease), background .15s, border-color .15s;
}
.check-btns button:active { transform: scale(.92); }
.check-btns button.sel-p { background: var(--ok); border-color: var(--ok); color: #fff; }
.check-btns button.sel-a { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Paquetes (portal alumno) ---------- */
.pack-card {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s var(--ease);
}
.pack-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow-lift); }
.pack-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--cta);
}
.pack-card .precio { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.pack-card .det { color: var(--ink-2); font-size: .85rem; margin: 4px 0 16px; }

/* ---------- Fotos decorativas en cards ---------- */
.photo-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 150px; color: #fff; display: flex; align-items: flex-end; box-shadow: var(--shadow-1); }
.photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(17, 19, 24, .85)); }
.photo-card .pc-txt { position: relative; z-index: 1; padding: 16px; font-weight: 700; }
.photo-card .pc-txt small { display: block; font-weight: 500; opacity: .85; font-size: .78rem; }

.footer-ds { text-align: center; font-size: .76rem; color: var(--muted); padding: 26px 16px 18px; }
.footer-ds a { color: var(--primary-ink); font-weight: 700; }

/* ---------- Footer con marca de agua ---------- */
.footer {
  position: relative; overflow: hidden; margin-top: 30px;
  border-top: 1px solid var(--hairline);
  padding: 36px 20px 26px; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(20, 22, 26, .025));
}
.footer .fw {
  position: absolute; right: -34px; bottom: -52px; opacity: .06;
  pointer-events: none; transform: rotate(-8deg);
}
/* Las dos marcas, una al lado de la otra */
.f-marcas {
  display: flex; align-items: center; justify-content: center;
  gap: 26px; flex-wrap: wrap; margin-bottom: 18px;
}
.f-marca { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.f-marca .f-mtxt { text-align: left; line-height: 1.3; }
.f-marca b { display: block; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.01em; }
.f-marca small { display: block; font-size: .73rem; color: var(--muted); }
a.f-marca { transition: transform .15s var(--ease); }
a.f-marca:hover { transform: translateY(-1px); }
a.f-marca:hover b { color: var(--primary-ink); }
.f-sep { width: 1px; height: 38px; background: var(--hairline-strong); }
@media (max-width: 520px) { .f-sep { display: none; } .f-marcas { gap: 16px; } }
/* Móvil: la marca de agua acompaña siempre (fija en la esquina, detrás de todo),
   así se ve sin tener que llegar al pie de la página */
.fw-fixed { display: none; }
@media (max-width: 720px) {
  .footer { padding: 30px 16px 22px; }
  .footer .fw { display: none; }
  .fw-fixed {
    display: block; position: fixed; right: -18px; bottom: 66px; z-index: 3;
    opacity: .055; transform: rotate(-8deg); pointer-events: none;
  }
  .fw-fixed svg { width: 150px; height: 150px; }
}
/* Logo D´Agostini Sistemas: monograma D´S dibujado (partial logo-ds.ejs), hermano del de Entrena */
.f-marca svg { flex: none; }
.footer .f-cred {
  font-size: .74rem; color: var(--muted); padding-top: 14px;
  border-top: 1px solid var(--hairline); max-width: 440px; margin: 0 auto;
}
.footer .f-cred a { color: var(--primary-ink); font-weight: 700; }

/* ---------- Banner de promoción ---------- */
.promo {
  display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap;
  border-radius: var(--radius); overflow: hidden; position: relative;
  color: #fff; padding: 22px 24px; margin-bottom: 20px;
  background: var(--grad-hero); box-shadow: var(--shadow-2);
}
.promo::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(17, 19, 24, .94) 20%, rgba(17, 19, 24, .55)), var(--promo-img);
  background-size: cover; background-position: center; filter: saturate(.75);
  pointer-events: none;
}
.promo > * { position: relative; z-index: 1; }
.promo .promo-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; margin-bottom: 6px;
  border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
}
.promo b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; display: block; }
.promo .promo-sub { font-size: .84rem; opacity: .85; }

/* ---------- Avatares ilustrados ---------- */
.avatar-s.pic { padding: 0; overflow: hidden; background: var(--surface-2); border: 1px solid var(--hairline); }
.avatar-s.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Animaciones Lottie ---------- */
.flash-anim { width: 26px; height: 26px; display: inline-block; vertical-align: -8px; margin-right: 8px; flex: none; }
.empty .eico svg { width: 100%; height: 100%; }
.card-anim { width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; }

/* ---------- Loader de navegación ---------- */
#loadbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120;
  transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--cta), var(--primary) 55%, #7aa8ff);
}
html.navigating #loadbar { animation: loadbar 1.4s ease-out forwards; }
@keyframes loadbar { 0% { transform: scaleX(0); } 55% { transform: scaleX(.72); } 100% { transform: scaleX(.93); } }
#loadrunner {
  position: fixed; right: 18px; bottom: 18px; width: 62px; height: 62px; z-index: 120;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-lift), 0 0 0 1px var(--hairline);
  padding: 6px; opacity: 0; pointer-events: none; transition: opacity .18s;
}
html.navigating #loadrunner { opacity: 1; }

/* ---------- Aparición al desplazarse (IntersectionObserver) ---------- */
.rvl { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.rvl.in { opacity: 1; transform: none; }

/* ============================================================
   Comprobante de pago — papel real: perforado, sello y QR
   ============================================================ */
.rec-page { max-width: 520px; margin: 26px auto 60px; padding: 0 16px; }
.rec-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.receipt {
  position: relative; background: #fff; border: 1px solid var(--hairline);
  border-radius: 6px; box-shadow: var(--shadow-2);
  padding: 30px 32px 26px;
  font-variant-numeric: tabular-nums;
}
/* Borde perforado superior e inferior, como ticket troquelado */
.receipt::before, .receipt::after {
  content: ''; position: absolute; left: 0; right: 0; height: 10px;
  background-image: radial-gradient(circle at 8px 0, transparent 5px, #fff 5.5px);
  background-size: 16px 10px; background-repeat: repeat-x;
}
.receipt::before { top: -9px; transform: rotate(180deg); filter: drop-shadow(0 -1px 1px rgba(20,22,26,.06)); }
.receipt::after { bottom: -9px; filter: drop-shadow(0 1px 1px rgba(20,22,26,.06)); }
.rec-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--hairline-strong); }
.rec-head .rh-info { flex: 1; }
.rec-head .rh-info b { font-family: var(--font-display); font-size: 1.15rem; display: block; }
.rec-head .rh-info small { color: var(--muted); font-size: .76rem; }
.rec-num { text-align: right; }
.rec-num b { font-family: var(--font-display); font-size: .95rem; display: block; letter-spacing: .03em; }
.rec-num small { color: var(--muted); font-size: .74rem; }
.rec-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 16px 0 10px; }
.rec-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: .9rem; }
.rec-row .rl { color: var(--muted); }
.rec-row .rv { font-weight: 600; text-align: right; }
.rec-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; padding: 14px 0 4px; border-top: 1px dashed var(--hairline-strong);
}
.rec-total .rl { font-weight: 700; font-size: .9rem; }
.rec-total .rv { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.rec-foot {
  display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--hairline-strong);
}
.rec-foot img { width: 88px; height: 88px; flex: none; image-rendering: pixelated; }
.rec-foot .rf-txt { font-size: .74rem; color: var(--muted); line-height: 1.5; }
.rec-ds { text-align: center; font-size: .7rem; color: var(--muted); margin-top: 16px; }
/* Sello de estado */
.rec-stamp {
  position: absolute; top: 92px; right: 26px; transform: rotate(9deg);
  border: 2.5px solid var(--ok); color: var(--ok);
  border-radius: 8px; padding: 4px 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .06em;
  opacity: .85; pointer-events: none;
}
.rec-stamp.anulado { border-color: var(--danger); color: var(--danger); }
@media print {
  .topbar, .drawer, .scrim, .rec-actions, .footer-ds, .footer, .fw-fixed, #loadbar, #loadrunner { display: none !important; }
  body { background: #fff; }
  .rec-page { margin: 0 auto; max-width: none; }
  .receipt { box-shadow: none; border: 0; }
}

/* ---------- Microinteracciones ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes ringIn { from { stroke-dashoffset: 302; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes areaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* La aparición del contenido la maneja el sistema .rv (scroll reveal) desde shell-bottom */

.chart .amount, .chart .aline-a, .chart .aline-b, .chart .afill {
  animation: areaIn .6s var(--ease) both; animation-delay: .15s;
}
.ring circle:nth-of-type(2) { animation: ringIn .8s var(--ease) both; }

.skeleton {
  border-radius: 10px; color: transparent !important; pointer-events: none;
  background: linear-gradient(90deg, var(--surface-2) 40%, #eae7df 50%, var(--surface-2) 60%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.tr { text-align: right; } .muted { color: var(--muted); font-size: .82rem; }
.wide-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Responsive — el drawer es la única navegación en todos los tamaños
   ============================================================ */
@media (max-width: 900px) {
  .content { padding: 12px 16px 48px; }
  .topbar { padding: 11px 14px; }
  .topbar .tt { display: none; }
  .grid.c2 { grid-template-columns: 1fr; }
  .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; }
  .frow { flex-direction: column; gap: 0; }

  /* Los campos con menos de 16px provocan zoom automático al tocarlos en iOS/Android:
     en móvil TODOS los inputs van a 16px */
  .inp, select.inp, textarea.inp { font-size: 16px; }

  /* Login mobile: hero de foto con la cita encima + tarjeta de formulario superpuesta.
     Todo tiene que entrar en una pantalla de celular común sin desplazarse. */
  .login-wrap { flex-direction: column; min-height: 100vh; min-height: 100dvh; }
  .login-img-col { order: -1; flex: none; height: 30vh; height: clamp(170px, 30dvh, 300px); }
  .login-img-col::after { background: linear-gradient(180deg, rgba(20,22,26,.14) 0%, rgba(20,22,26,.04) 42%, rgba(20,22,26,.68) 100%); }
  .login-quote { bottom: 40px; left: 22px; right: 22px; }
  .login-quote b { font-size: 1.12rem; margin-bottom: 3px; }
  .login-quote span { font-size: .8rem; }
  .login-form-col {
    flex: 1; padding: 18px 22px 20px; border-right: 0;
    margin-top: -22px; border-radius: 24px 24px 0 0;
    position: relative; z-index: 2;
    box-shadow: 0 -14px 34px rgba(20, 22, 26, .16);
  }
  .login-form-col::after { display: none; }
  .login-img-col::before { display: none; }
  .login-form-col h1 { font-size: 1.22rem; margin-bottom: 4px; }
  .login-form-col .sub { font-size: .86rem; margin-bottom: 12px; }
  .login-form-col .login-tag { margin-bottom: 8px; }
  .login-form-col label.f { margin-bottom: 10px; }
  .login-form-col .inp { padding-top: 11px; padding-bottom: 11px; }
  .login-foot { padding-top: 10px; font-size: .72rem; }
  .login-foot br + br { display: none; }
  #loadrunner { width: 52px; height: 52px; right: 12px; bottom: 12px; }
  .login-mid { margin: 0; padding: 10px 0 0; }
  .login-form-col .brand { padding-bottom: 0; }
  /* Carrusel de promos: aprovecha el blanco entre el formulario y el pie */
  .login-promos {
    display: block; margin: 14px 0 4px; padding: 14px 16px 12px;
    border: 1px solid var(--hairline); border-radius: 16px;
    background: linear-gradient(180deg, #fff, rgba(31, 94, 255, .04));
  }
  .lp-slides { position: relative; min-height: 64px; }
  .lp-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease-in-out; display: flex; gap: 12px; align-items: center; }
  .lp-slide.al-frente { opacity: 1; }
  /* Ícono con color propio por promo: le da vida al cartel */
  .lp-ico {
    flex: none; width: 42px; height: 42px; border-radius: 13px;
    display: grid; place-items: center; color: #fff;
    box-shadow: 0 4px 12px rgba(20, 22, 26, .18);
  }
  .lp-ico svg { width: 20px; height: 20px; }
  .lp-ico img { width: 24px; height: 24px; display: block; }
  .lp-ico.c-azul  { background: linear-gradient(135deg, #1f5eff, #4b94ff); }
  .lp-ico.c-mp    { background: #00b1ea; }
  .lp-ico.c-verde { background: linear-gradient(135deg, #0f8a3d, #22b45a); }
  .lp-ico.c-ambar { background: linear-gradient(135deg, #d97706, #f6a821); }
  .lp-ico.c-tinta { background: linear-gradient(135deg, #262a32, #0f1115); }
  .lp-txt { min-width: 0; }
  .lp-slide b {
    display: block; font-family: var(--font-display); font-size: .95rem;
    letter-spacing: -.01em; margin-bottom: 3px;
  }
  .lp-slide span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.45; }
  .lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
  .lp-dots { display: flex; gap: 5px; }
  .lp-dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--hairline-strong); transition: background .3s, transform .3s;
  }
  .lp-dots i.on { background: var(--primary); transform: scale(1.2); }
  .hero { padding: 20px 18px 16px; }
  .hero h1 { font-size: 1.3rem; }
  .hero .big { font-size: 1.7rem; }
  .stat .k { font-size: 1.45rem; }
  .receipt { padding: 22px 20px 20px; }
}
@media (max-width: 480px) {
  .grid.c4 { grid-template-columns: 1fr 1fr; }
  .grid.c3 { grid-template-columns: 1fr 1fr; }
}

/* ============ Móvil: reestructura (desktop queda intacto) ============ */
@media (max-width: 720px) {
  /* Filas de personas: nombre en una línea con elipsis; chips y botones bajan a una segunda fila */
  .person { flex-wrap: wrap; row-gap: 9px; padding: 13px 0; }
  .person .pinfo { flex: 1 1 46%; min-width: 0; }
  .person .pname, .person .pmeta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Tablas: celdas de una sola línea, desplazamiento horizontal limpio */
  .tblwrap { -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
  .tbl th, .tbl td { white-space: nowrap; }
  .tbl td { max-width: 230px; overflow: hidden; text-overflow: ellipsis; padding: 11px 10px; }
  table.tbl { font-size: .84rem; }

  /* Encabezados de card con filtros: el formulario baja a su propia fila a lo ancho */
  .card-head { flex-wrap: wrap; row-gap: 10px; }
  .card-head form { flex: 1 1 100%; order: 10; }
  .card-head form .inp { flex: 1 1 110px; }
  .card-head form .muted { display: none; }

  /* Botoneras: grilla pareja de dos columnas; el CTA principal ocupa el ancho completo */
  .wide-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .wide-actions .btn { width: 100%; justify-content: center; }
  .wide-actions > .btn-primary:first-child { grid-column: 1 / -1; }
  .wide-actions form .btn, .wide-actions details summary.btn { width: 100%; justify-content: center; }

  /* Paquetes del alumno: tarjetas a lo ancho completo */
  .pack-card { grid-column: 1 / -1; }

  /* Filtro de alumnos: buscador a lo ancho, botones parejos */
  .filter-form > .inp { flex: 1 1 100%; }
  .filter-form .btn { flex: 1; justify-content: center; }

  /* Hero del dashboard: estadísticas con aire y sin choques con el borde */
  .hero-stats { gap: 10px 26px !important; }
  .hero .sub { font-size: .74rem; }

  /* Formularios: botón de envío a lo ancho (tap cómodo) */
  .card form > .btn-block, .card form > .btn-primary:last-of-type:not(.btn-sm) { width: 100%; justify-content: center; }
}
