/* ==========================================================================
   Nivel UP · Portal
   Un solo CSS para las tres zonas. Mobile-first: las familias entran desde el
   móvil, así que ese es el caso base y el escritorio solo ensancha.
   Usa los tokens de marca de tokens.css.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: 16px;                 /* 16px base: evita el zoom automático de iOS */
  color: var(--ink, #16243f);
  background: var(--cream-2, #eef3fb);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--azul); }

/* Accesibilidad: foco siempre visible al navegar con teclado */
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }

.oculto { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   1. Estructura de página (portal: familias / monitores)
   ========================================================================== */
.pt { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.pt__bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--white, #fff);
  border-bottom: 1px solid var(--line, #e3e9f3);
}
.pt__bar img { height: 26px; width: auto; }
.pt__bar .titulo { font-family: var(--font-display, "Outfit", sans-serif); font-weight: 700; font-size: 16px; line-height: 1.1; }
.pt__bar .titulo small { display: block; font-family: inherit; font-weight: 600; font-size: 12px; color: var(--azul-deep); }
.pt__bar .sep { margin-left: auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--cream-2, #eef3fb); color: var(--body, #4a586e);
  border: none; cursor: pointer; font-size: 18px; text-decoration: none;
}
.icon-btn:active { background: var(--line); }

.pt__main {
  flex: 1; width: 100%; max-width: 680px; margin: 0 auto;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 96px);
}
@media (min-width: 720px) { .pt__main { padding-bottom: 40px; } }

/* Barra inferior tipo app */
.pt__nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: var(--white); border-top: 1px solid var(--line);
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
}
.pt__nav a, .pt__nav button {
  flex: 1; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer; text-decoration: none;
  color: var(--muted, #8090a4); font-family: inherit; font-size: 11.5px; font-weight: 600;
  padding: 6px 2px; border-radius: 12px;
  white-space: nowrap;             /* que la etiqueta no se parta en dos líneas */
  line-height: 1.2;
}
.pt__nav i { font-size: 21px; line-height: 1; }
.pt__nav .activo { color: var(--azul-deep); }
.pt__nav .activo i { color: var(--azul); }

/* Pantallas muy estrechas: reduce un punto la etiqueta antes que romperla. */
@media (max-width: 360px) {
  .pt__nav a, .pt__nav button { font-size: 10.5px; }
  .pt__nav i { font-size: 20px; }
}

/* Tablet y escritorio: barra flotante con icono y texto EN LÍNEA, que queda
   mucho más limpia que la disposición en columna del móvil. */
@media (min-width: 720px) {
  .pt__nav {
    position: sticky; bottom: 20px;
    width: max-content; max-width: 100%;
    margin: 24px auto; padding: 7px;
    gap: 4px; justify-content: center;
    border-radius: 999px; border: 1px solid var(--line);
    box-shadow: var(--sh-card, 0 22px 44px -24px rgba(22,36,63,.22));
  }
  .pt__nav a, .pt__nav button {
    flex: 0 0 auto;                /* cada opción ocupa lo que necesita */
    flex-direction: row; gap: 9px;
    min-height: 44px; padding: 10px 18px;
    font-size: 14.5px; border-radius: 999px;
  }
  .pt__nav i { font-size: 19px; }
  .pt__nav a:hover { background: var(--cream-2); color: var(--ink); }
  .pt__nav .activo { background: var(--c-academia-bg, #e7efff); color: var(--azul-deep); }
}

/* ==========================================================================
   2. Cabeceras y textos
   ========================================================================== */
.saludo { margin: 4px 0 18px; }
.saludo h1 { font-family: var(--font-display); font-size: 24px; margin: 0 0 4px; line-height: 1.15; }
.saludo p { margin: 0; color: var(--muted); }
.subtitulo { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 2px 10px; }
.meta { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.volver { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 12px; min-height: 32px; }

/* ==========================================================================
   3. Tarjetas y listas
   ========================================================================== */
.tarjeta {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r, 18px); padding: 18px;
  box-shadow: var(--sh-soft, 0 14px 30px -16px rgba(22,36,63,.18));
  margin-bottom: 14px;
}
.tarjeta--plana { box-shadow: none; }

.fila {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 12px;
  min-height: 72px; text-decoration: none; color: inherit;
}
.fila:active { transform: scale(.995); }
.fila__ic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--c-academia-bg, #e7efff); color: var(--azul-deep);
}
.fila__tx { min-width: 0; flex: 1; }
.fila__tx strong { display: block; font-size: 16px; }
.fila__tx span { color: var(--muted); font-size: 14px; }
.fila__chev { color: var(--muted); font-size: 20px; flex: 0 0 auto; }

/* ==========================================================================
   4. Botones
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 20px;
  font-family: inherit; font-weight: 700; font-size: 16px;
  border: none; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.99); }
.btn--principal { background: var(--coral, #2fa84f); color: #fff; }
.btn--principal:hover { background: var(--coral-deep); }
.btn--azul { background: var(--azul); color: #fff; }
.btn--secundario { background: var(--white); color: var(--body); border: 1.5px solid var(--line); }
.btn--secundario:hover { border-color: var(--azul); color: var(--azul); }
.btn--peligro { background: #fff; color: #c0392b; border: 1.5px solid #f0c8c2; }
.btn--bloque { width: 100%; }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn[disabled], .btn--off { opacity: .55; pointer-events: none; }

.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ==========================================================================
   5. Formularios (targets grandes, 16px para no disparar el zoom en iOS)
   ========================================================================== */
.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--sh-soft); }
.campo { margin-bottom: 16px; }
.campo > label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
/* Ojo: se excluyen casillas y radios, porque `appearance: none` les quita el
   tick nativo y parecen no funcionar. */
.campo input:not([type="checkbox"]):not([type="radio"]),
.campo select, .campo textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); appearance: none; -webkit-appearance: none;
}
.campo select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238090a4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 42px;
}
.campo textarea { min-height: 92px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(46,107,240,.15);
}
.campo .ayuda { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.campo .errores { color: #c0392b; font-size: 13.5px; margin: 6px 0 0; padding: 0; list-style: none; }
/* Casilla: apariencia nativa (se ve el tick), grande y con el color de marca.
   Toda la fila es clicable, no solo el cuadradito. */
.campo--check { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.campo--check input[type="checkbox"] {
  width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; margin: 1px 0 0;
  appearance: auto; -webkit-appearance: checkbox;
  accent-color: var(--azul);
  cursor: pointer;
}
.campo--check label { font-weight: 600; margin: 0; cursor: pointer; line-height: 1.35; }
.grupo-campos { margin: 22px 0 12px; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
@media (min-width: 620px) {
  .form-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ==========================================================================
   5 bis. Wizard de inscripción (para quién → qué actividad → confirmar)
   ========================================================================== */
.pasos { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.paso {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.paso__n {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--line); color: var(--white);
}
.paso--activo { color: var(--azul-deep); }
.paso--activo .paso__n { background: var(--azul); }
.paso--hecho .paso__n { background: var(--verde); }
.paso__linea { flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 10px; }
@media (max-width: 460px) {
  .paso span.texto { display: none; }   /* en móvil solo los números */
  .paso__linea { min-width: 16px; }
}

/* Tarjeta seleccionable (elegir hijo o actividad) */
.opcion {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 12px;
  min-height: 76px; text-decoration: none; color: inherit; text-align: left;
  font-family: inherit; font-size: 16px; cursor: pointer;
}
.opcion:hover { border-color: var(--azul); }
.opcion:active { transform: scale(.995); }
.opcion__av {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
  background: var(--c-academia-bg, #e7efff); color: var(--azul-deep);
}

/* ==========================================================================
   6. Avisos y estados
   ========================================================================== */
.avisos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.aviso { padding: 13px 16px; border-radius: 12px; font-weight: 600; font-size: 14.5px; }
.aviso--ok { background: var(--c-deportes-bg, #e8f5de); color: var(--verde-deep); }
.aviso--error { background: #fdecea; color: #c0392b; }
.aviso--info { background: var(--c-academia-bg, #e7efff); color: var(--azul-deep); }
/* Para lo que hay que leer antes de confirmar algo irreversible (una baja). */
.aviso--warn { background: #fff6e5; color: #8a5a00; font-weight: 500; }
.aviso--warn strong { font-weight: 700; }
.aviso--warn li { margin-bottom: 5px; line-height: 1.45; }

.etiqueta { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.et--confirmada { background: var(--c-deportes-bg); color: var(--verde-deep); }
.et--reservada { background: var(--c-musica-bg, #f0f6dd); color: #7a5c00; }
.et--lista_espera { background: var(--c-academia-bg); color: var(--azul-deep); }
.et--caducada, .et--baja { background: #f1eee9; color: var(--muted); }
.et--medico { background: #fdecea; color: #c0392b; }
/* Baja: discreta a propósito, pero con altura suficiente para el dedo. */
.enlace-baja {
  display: inline-flex; align-items: center; min-height: 44px;
  margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.enlace-baja:hover, .enlace-baja:focus-visible { color: #c0392b; }
.et--plazas { background: var(--cream-2); color: var(--azul-deep); }
.et--completo { background: #fdecea; color: #c0392b; }

/* ==========================================================================
   7. Login y registro
   ========================================================================== */
.acceso {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 16px calc(env(safe-area-inset-bottom) + 24px);
  background: linear-gradient(150deg, var(--azul-ink) 0%, var(--azul-deep) 100%);
}
.acceso__caja {
  background: var(--white); border-radius: 24px; padding: 30px 22px;
  width: 100%; max-width: 420px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5);
}
.acceso__caja img { height: 34px; margin-bottom: 14px; }
.acceso__caja h1 { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
.acceso__caja .sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.enlace-centro { display: block; text-align: center; margin-top: 18px; color: var(--azul-deep); font-weight: 600; text-decoration: none; }

/* ==========================================================================
   8. Panel de gestión (escritorio, pero usable en móvil)
   ========================================================================== */
.gs { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.gs__side {
  background: var(--azul-ink); color: #dbe6ff; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.gs__side img { height: 28px; }
.gs__nav { display: flex; flex-direction: column; gap: 3px; }
.gs__nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 12px; color: #c9d8f5; font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.gs__nav a:hover { background: rgba(255,255,255,.09); }
.gs__nav a.activo { background: var(--azul); color: #fff; }
.gs__nav .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7e95c9; margin: 14px 12px 4px; }
.gs__pie { margin-top: auto; font-size: 13px; color: #9fb6e8; display: flex; flex-direction: column; gap: 8px; }
.gs__main { min-width: 0; display: flex; flex-direction: column; }
.gs__top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 24px; background: var(--white); border-bottom: 1px solid var(--line);
}
.gs__top h1 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.gs__top .ruta { font-size: 13px; color: var(--muted); }
.gs__cont { padding: 24px; max-width: 1200px; width: 100%; }

@media (max-width: 900px) {
  .gs { grid-template-columns: 1fr; }
  .gs__side { position: static; height: auto; }
  .gs__nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .gs__nav .grupo { flex-basis: 100%; margin: 6px 4px 0; }
  .gs__top, .gs__cont { padding: 14px 16px; }
}

/* Tablas: en móvil scrollean en horizontal en vez de recortarse */
.tabla-caja { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; -webkit-overflow-scrolling: touch; box-shadow: var(--sh-soft); }
table.datos { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.datos th, table.datos td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.datos th { background: var(--cream, #f7faff); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--body); }
table.datos tr:last-child td { border-bottom: none; }
table.datos .envuelve { white-space: normal; min-width: 180px; }
.tabla-vacia { padding: 40px 20px; text-align: center; color: var(--muted); }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-soft); }
.kpi b { display: block; font-family: var(--font-display); font-size: 30px; color: var(--azul-deep); line-height: 1; }
.kpi span { display: block; color: var(--muted); font-weight: 600; font-size: 13px; margin-top: 7px; }

/* Barra de ocupación de un grupo */
.ocupacion { display: flex; align-items: center; gap: 10px; }
.ocupacion__barra { flex: 1; min-width: 70px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ocupacion__relleno { height: 100%; background: var(--verde); border-radius: 999px; }
.ocupacion__relleno.lleno { background: #c0392b; }
