/* =========================================================================
   Hércules Academy — App / Backend (panel admin · portal familias · entrenadores)
   Depende de los tokens de site.css. Azul Hércules + oro, Saira Condensed + Inter.
   Premium, sobrio y 100% adaptable a móvil.
   ========================================================================= */

/* ---------- Barra superior de app ---------- */
.app-nav { position: sticky; top: 0; z-index: var(--z-sticky); background: linear-gradient(100deg, var(--brand-950), var(--brand-900)); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--sh-md); }
.app-nav__in { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.2rem; padding-block: .7rem; flex-wrap: wrap; }
.app-nav .brand { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; text-transform: uppercase; display: flex; align-items: center; gap: .6rem; }
.app-nav nav, .app-nav__links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.app-nav a { color: rgba(255,255,255,.82); font-weight: 600; font-size: .95rem; transition: color .15s var(--ease-out); }
.app-nav a:hover { color: #fff; }
.app-nav a[href*="logout"] { color: var(--gold); }

.wrap { max-width: 1040px; margin-inline: auto; padding: clamp(1.3rem,4vw,2.4rem) var(--gutter) 5rem; }
.wrap--narrow { max-width: 460px; }

.page-head h1 { font-family: var(--font-display); font-size: clamp(2rem,5vw,2.9rem); color: var(--ink); text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.page-head p { color: var(--ink-soft); margin-top: .5rem; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.3rem,3vw,1.9rem); box-shadow: var(--sh-sm); margin-top: 1.3rem; }
.card > h2 { font-family: var(--font-body); font-weight: 800; font-size: 1.22rem; color: var(--ink); display: flex; align-items: center; gap: .6rem; letter-spacing: 0; }
.card > h2:first-child { margin-top: 0; }
.card__step { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .95rem; flex: 0 0 auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 680px){ .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- Formularios ---------- */
label.lbl, .lbl { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .4rem; color: var(--ink); }
.req { color: var(--bad); }
.inp, select.inp, textarea.inp {
  width: 100%; padding: .8rem .95rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; color: var(--ink); background: #fff; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.inp:focus, select.inp:focus, textarea.inp:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
textarea.inp { min-height: 92px; resize: vertical; }
.hint { font-size: .82rem; color: var(--ink-mute); margin-top: .35rem; }

.alert { border-radius: var(--r-md); padding: .9rem 1.1rem; margin-top: 1rem; font-weight: 500; }
.alert--err { background: oklch(0.96 0.04 25); color: oklch(0.45 0.16 25); }
.alert--ok { background: oklch(0.95 0.05 150); color: oklch(0.38 0.12 150); }
.alert--info { background: var(--brand-050); color: var(--brand-700); }

.file { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 1.1rem; text-align: center; cursor: pointer; display: block; transition: .15s var(--ease-out); }
.file:hover { border-color: var(--brand); background: var(--brand-050); }
.file input { display: none; }
.file__name { display: block; margin-top: .4rem; font-size: .85rem; color: var(--brand); font-weight: 600; }

/* ---------- Jugadores (inscripción) ---------- */
.kid { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem; margin-bottom: 1rem; }
.kid__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.kid__top b { font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase; }
.kid__rm { background: none; border: 0; color: var(--bad); font-weight: 600; cursor: pointer; }

.pricebar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(13,38,82,.08); padding: .9rem var(--gutter); z-index: var(--z-sticky); }
.pricebar__in { max-width: 1040px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pricebar .tot { font-family: var(--font-display); font-size: 2rem; color: var(--brand); line-height: 1; }
.pricebar small { color: var(--ink-mute); }

.iban { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--brand-050); border-radius: var(--r-md); padding: .9rem 1.1rem; font-family: ui-monospace, monospace; font-size: 1.02rem; font-weight: 600; color: var(--brand-700); flex-wrap: wrap; }
.copybtn { background: var(--brand); color: #fff; border: 0; border-radius: var(--r-pill); padding: .5rem 1rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: transform .12s var(--ease-out), background .15s var(--ease-out); }
.copybtn:hover { background: var(--brand-700); }
.copybtn:active { transform: scale(.95); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .5rem 1rem; border-radius: var(--r-pill); font-weight: 600; cursor: pointer; color: var(--ink-soft); font-size: .9rem; transition: all .2s var(--ease-out); }
.seg button.is-on { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }

.weekpick { display: flex; flex-wrap: wrap; gap: .5rem; }
.weekpick label { cursor: pointer; }
.weekpick input { position: absolute; opacity: 0; pointer-events: none; }
.weekpick span { display: inline-flex; flex-direction: column; gap: 2px; padding: .55rem .8rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); font-weight: 600; font-size: .88rem; transition: all .2s var(--ease-out); }
.weekpick span small { font-weight: 500; color: var(--ink-mute); font-size: .76rem; }
.weekpick input:checked + span { border-color: var(--brand); background: var(--brand-050); color: var(--brand); }
.weekpick input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Estadísticas ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
@media (max-width: 760px){ .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem; }
.stat b { font-family: var(--font-display); font-size: 2.1rem; color: var(--ink); display: block; line-height: 1; }
.stat span { color: var(--ink-mute); font-size: .85rem; margin-top: .25rem; display: block; }
.stat.is-pending b { color: var(--gold-600); }
.stat.is-ok b { color: var(--good); }

/* ---------- Tablas (con scroll en móvil) ---------- */
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-sm); }
table.tbl th, table.tbl td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-size: .94rem; }
table.tbl th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--brand-050); }
@media (max-width: 680px){
  table.tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; box-shadow: none; }
}

.badge { display: inline-block; padding: .25rem .65rem; border-radius: var(--r-pill); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge--pending { background: var(--gold-050); color: var(--gold-600); }
.badge--approved { background: oklch(0.93 0.06 150); color: oklch(0.4 0.12 150); }
.badge--rejected { background: oklch(0.94 0.05 25); color: oklch(0.48 0.16 25); }

.tabbar { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.2rem 0; }
.tabbar a { padding: .5rem 1rem; border-radius: var(--r-pill); font-weight: 600; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); transition: all .15s var(--ease-out); }
.tabbar a:hover { border-color: var(--brand-300); color: var(--brand); }
.tabbar a.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }

.login-box { max-width: 420px; margin: 9vh auto 0; }
.photo-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }

/* ---------- App entrenadores / portal (móvil) ---------- */
.kidlist { display: grid; gap: .7rem; }
.kidrow { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .8rem 1rem; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
a.kidrow:hover { border-color: var(--brand-300); box-shadow: var(--sh-sm); }
.kidrow__info { flex: 1; min-width: 0; }
.kidrow__info b { display: block; color: var(--ink); }
.kidrow__info span { color: var(--ink-mute); font-size: .85rem; }
.iconbtn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--brand); }
.iconbtn:hover { background: var(--brand-050); }
.stars { display: inline-flex; gap: .2rem; }
.stars button { background: none; border: 0; cursor: pointer; font-size: 1.6rem; color: var(--line-strong); padding: 0; transition: color .12s var(--ease-out), transform .12s var(--ease-out); }
.stars button:hover { transform: scale(1.12); }
.stars button.on { color: var(--gold); }

/* Avatar entrenador */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.5); flex: 0 0 auto; }
.avatar--lg { width: 84px; height: 84px; border-width: 3px; border-color: var(--line); }

/* Foco accesible global en la app */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
