/* Panel del gimnasio (demo): mismos colores que la web, pensado primero para el celu */
:root {
  --negro: #0b0c0a; --sup: #131510; --sup-2: #1a1d16; --sup-3: #22261d;
  --texto: #f2f5ec; --mute: #a9b09f; --lima: #c8ff2e; --rojo: #ff6a3d; --amarillo: #ffd23f;
  --borde: rgba(200, 255, 46, .14); --borde-2: rgba(200, 255, 46, .3);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --letra: "Archivo", "Arial", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--letra); font-size: 16px; line-height: 1.5; color: var(--texto); background: var(--negro); -webkit-font-smoothing: antialiased; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--lima); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 999; padding: .6rem 1rem; background: var(--lima); color: var(--negro); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Barra de arriba */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; background: rgba(11, 12, 10, .96); border-bottom: 1px solid var(--borde); }
.volver { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; font-size: 1.3rem; border: 1px solid var(--borde); }
.top-tit { font-stretch: 125%; font-weight: 900; font-style: italic; font-size: 1.15rem; text-transform: uppercase; }
.top-tit span { color: var(--lima); }
.top-tit, .top-reset { white-space: nowrap; }
.chico-solo { display: none; }
@media (max-width: 420px) { .top-tit { font-size: 1rem; } .chico-oculto { display: none; } .chico-solo { display: inline; } .top { gap: .45rem; padding-inline: .75rem; } }
.top-demo { margin-left: auto; font-size: .76rem; font-weight: 600; color: var(--negro); background: var(--amarillo); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.top-reset { min-height: 44px; padding: .4rem .7rem; font-size: .82rem; font-weight: 600; color: var(--mute); border: 1px solid var(--borde); border-radius: 10px; }

/* Pestañas: abajo en el celu, arriba en la compu */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(19, 21, 16, .98); border-top: 1px solid var(--borde); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { min-height: 64px; display: grid; justify-items: center; align-content: center; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--mute); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--lima); }

.vista { width: min(1100px, 100% - 2rem); margin: 1.2rem auto 2rem; outline: none; }
.vista > section { animation: entra .35s var(--ease); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
.v-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.v-tit { font-stretch: 125%; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.7rem; line-height: 1.05; margin-bottom: 1rem; }
.v-head .v-tit { margin: 0; }
.v-tit span { color: var(--lima); }
.v-sub { color: var(--mute); margin: -.4rem 0 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; font-stretch: 125%; font-weight: 800; font-size: .86rem; text-transform: uppercase; transition: transform .2s, background .2s; }
.btn:active { transform: scale(.96); }
.btn-lima { background: var(--lima); color: var(--negro); }
.btn-line { border: 1px solid var(--borde-2); }
.btn-rojo { background: var(--rojo); color: #1a0700; }
.btn-wa { background: #25d366; color: #06210f; }
.btn-block { width: 100%; }
.link { color: var(--lima); font-weight: 600; font-size: .9rem; min-height: 44px; padding: 0 .3rem; }

/* Números del resumen */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { padding: .9rem; border-radius: 14px; background: var(--sup); border: 1px solid var(--borde); display: grid; gap: .1rem; }
.kpi p { font-size: .82rem; color: var(--mute); }
.kpi b { font-stretch: 125%; font-weight: 900; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .78rem; color: var(--mute); }
.kpi-alerta b { color: var(--rojo); }
.sube { color: var(--lima) !important; }
.baja { color: var(--rojo) !important; }

.caja { padding: 1rem; border-radius: 16px; background: var(--sup); border: 1px solid var(--borde); margin-bottom: .8rem; }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.c-tit { font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 1rem; margin-bottom: .7rem; }
.c-head .c-tit { margin: 0; }
.c-tit small { font-stretch: 100%; font-weight: 400; text-transform: none; color: var(--mute); font-size: .8rem; }
.dos { display: grid; gap: .8rem; }
.dos .caja { margin: 0; }
.dos { margin-bottom: .8rem; }

/* Gráficos (SVG que arma panel.js) */
.grafico svg { width: 100%; height: auto; overflow: visible; }
.grafico .barra { fill: url(#g-lima); }
.grafico .barra-actual { fill: var(--lima); }
.grafico text { fill: var(--mute); font-size: 10px; font-family: var(--letra); }
.grafico .valor { fill: var(--texto); font-weight: 600; }
.grafico .barra, .grafico .barra-actual { transform-box: fill-box; transform-origin: bottom; animation: crece .8s var(--ease) backwards; }
@keyframes crece { from { transform: scaleY(0); } }

/* Listas de socios, cobros e ingresos */
.filas { list-style: none; padding: 0; display: grid; gap: .45rem; }
.fila { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .3rem .8rem; padding: .75rem .85rem; border-radius: 12px; background: var(--sup-2); border: 1px solid transparent; transition: border-color .2s; }
.fila-btn { text-align: left; width: 100%; }
.fila-nombre { font-weight: 600; }
.fila-sub { grid-column: 1; font-size: .82rem; color: var(--mute); }
.fila-acc { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .4rem; align-items: center; }
.fila-monto { font-weight: 700; font-variant-numeric: tabular-nums; }
.filas-chicas .fila { padding: .6rem .8rem; }
.estado { display: inline-block; font-style: normal; font-size: .76rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: 1px; }
.e-vencida { background: rgba(255, 106, 61, .16); color: #ffb39a; }
.e-pronto { background: rgba(255, 210, 63, .14); color: #ffe08a; }
.e-ok { background: rgba(200, 255, 46, .12); color: var(--lima); }
.mini-btn { min-height: 40px; min-width: 44px; padding: .3rem .65rem; border-radius: 9px; font-size: .78rem; font-weight: 700; }
.mini-btn.wa { background: #25d366; color: #06210f; }
.mini-btn.cobrar { background: var(--lima); color: var(--negro); }
.vacio { color: var(--mute); text-align: center; padding: 1.5rem; }

.buscar input, .ingreso input, .campo input, .campo select { width: 100%; font: inherit; font-size: 16px; color: var(--texto); background: var(--sup); border: 1px solid var(--borde-2); border-radius: 12px; padding: .75rem 1rem; min-height: 48px; }
.buscar input:focus, .ingreso input:focus, .campo input:focus, .campo select:focus { outline: none; border-color: var(--lima); box-shadow: 0 0 0 3px rgba(200, 255, 46, .18); }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex-shrink: 0; min-height: 40px; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--borde); font-size: .86rem; font-weight: 600; color: var(--mute); }
.chips button em { font-style: normal; opacity: .75; margin-left: .15rem; }
.chips button[aria-pressed="true"] { background: var(--lima); color: var(--negro); border-color: var(--lima); }

/* Ingreso por DNI */
.ingreso { display: flex; gap: .5rem; }
.ingreso input { font-size: 1.2rem; font-weight: 600; }
.sugerencias { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .3rem; }
.sugerencias button { width: 100%; text-align: left; min-height: 44px; padding: .5rem .8rem; border-radius: 10px; background: var(--sup-2); }
.sugerencias small { color: var(--mute); margin-left: .4rem; }
.aviso { margin: .9rem 0; padding: 1.1rem; border-radius: 16px; animation: entra .3s var(--ease); }
.aviso h3 { font-stretch: 125%; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.4rem; line-height: 1.1; margin-bottom: .2rem; }
.aviso p { margin-bottom: .7rem; }
.aviso-ok { background: rgba(200, 255, 46, .12); border: 1px solid var(--lima); }
.aviso-ok h3 { color: var(--lima); }
.aviso-mal { background: rgba(255, 106, 61, .12); border: 1px solid var(--rojo); }
.aviso-mal h3 { color: var(--rojo); }
.aviso-acc { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Cobros */
.medios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .9rem; }
.medio { padding: .8rem; border-radius: 12px; background: var(--sup); border: 1px solid var(--borde); }
.medio p { font-size: .8rem; color: var(--mute); }
.medio b { font-stretch: 125%; font-weight: 900; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.medio-total { border-color: var(--lima); }

/* Ventana */
.hoja { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; }
.hoja-fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); animation: aparece .2s ease; }
.hoja-caja { position: relative; width: 100%; max-width: 560px; max-height: 90svh; overflow-y: auto; margin-inline: auto; padding: 1.4rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); background: var(--sup); border: 1px solid var(--borde-2); border-radius: 20px 20px 0 0; animation: sube .4s var(--ease); }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
.hoja-x { position: absolute; top: .5rem; right: .5rem; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; color: var(--mute); }
.h-tit { font-stretch: 125%; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.5rem; line-height: 1.1; padding-right: 2.5rem; margin-bottom: .3rem; }
.h-sub { color: var(--mute); margin-bottom: 1rem; }
.datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.datos p { padding: .6rem .7rem; border-radius: 10px; background: var(--sup-2); font-size: .9rem; }
.datos small { display: block; font-size: .74rem; color: var(--mute); }
.h-acc { display: grid; gap: .5rem; }
.h-acc-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.campo { display: grid; gap: .3rem; margin-bottom: .8rem; }
.campo label, .campo legend { font-weight: 600; font-size: .88rem; }
.opciones { display: flex; flex-wrap: wrap; gap: .4rem; border: 0; padding: 0; }
.opciones legend { width: 100%; margin-bottom: .35rem; }
.opciones input { position: absolute; opacity: 0; pointer-events: none; }
.opciones span { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .85rem; border-radius: 10px; border: 1px solid var(--borde-2); font-weight: 600; font-size: .9rem; cursor: pointer; }
.opciones input:checked + span { background: var(--lima); color: var(--negro); border-color: var(--lima); }
.opciones input:focus-visible + span { outline: 2px solid var(--lima); outline-offset: 2px; }
.msg-wa { white-space: pre-line; padding: .9rem 1rem; border-radius: 12px 12px 12px 4px; background: #1f2c25; border: 1px solid rgba(37, 211, 102, .35); margin-bottom: .6rem; font-size: .95rem; }
.nota { font-size: .8rem; color: var(--mute); margin: .5rem 0 .9rem; }
.historial { list-style: none; padding: 0; display: grid; gap: .3rem; margin-bottom: 1rem; font-size: .88rem; }
.historial li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border-radius: 8px; background: var(--sup-2); }
.historial span { color: var(--mute); }
.error { color: #ffb39a; font-size: .9rem; margin-bottom: .6rem; }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%); max-width: calc(100% - 2rem); padding: .75rem 1.1rem; border-radius: 12px; background: var(--lima); color: var(--negro); font-weight: 700; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .8); animation: sube .35s var(--ease); }

@media (hover: hover) {
  .fila-btn:hover { border-color: var(--borde-2); }
  .tabs button:hover { color: var(--texto); }
  .sugerencias button:hover { background: var(--sup-3); }
}
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dos { grid-template-columns: 1.2fr 1fr; }
  .medios { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hoja { align-items: center; padding: 1rem; }
  .hoja-caja { border-radius: 20px; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .tabs { position: sticky; top: 61px; bottom: auto; display: flex; justify-content: center; gap: .3rem; border-top: 0; border-bottom: 1px solid var(--borde); background: rgba(11, 12, 10, .96); padding: .3rem 0; }
  .tabs button { min-height: 48px; grid-auto-flow: column; gap: .5rem; padding: 0 1.1rem; border-radius: 10px; font-size: .92rem; }
  .tabs button[aria-current="page"] { background: rgba(200, 255, 46, .1); }
  .toast { bottom: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .vista > section, .grafico .barra, .grafico .barra-actual, .hoja-caja, .hoja-fondo, .aviso, .toast { animation: none; }
}
