/* AccesoFit · app del dueño. Celular primero; en computadora se centra. */
:root {
  --fondo: #0A0A0A;
  --fondo-2: #101011;
  --panel: #151516;
  --panel-2: #1c1c1e;
  --borde: #26262a;
  --borde-fuerte: #34343a;
  --texto: #F5F5F5;
  --texto-2: #B4B9C2;
  --texto-3: #8A909B;
  --rojo: #DC2626;
  --rojo-claro: #EF4444;
  --verde: #22C55E;
  --ambar: #F59E0B;
  --azul: #3B82F6;
  --violeta: #A78BFA;
  --radio: 18px;
  --barra: 68px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  min-height: 100vh; overscroll-behavior-y: contain;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.oculto { display: none !important; }

/* ── Carga ── */
.cargando-inicial { min-height: 100vh; display: grid; place-items: center; }
.giro { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--borde-fuerte); border-top-color: var(--rojo); animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ── Entrar ── */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px 20px; position: relative; overflow: hidden; }
.entrar::before { content: ""; position: absolute; inset: -30% -40% auto -40%; height: 70%; background: radial-gradient(closest-side, rgba(220,38,38,.28), transparent 70%); pointer-events: none; }
.entrar .caja { position: relative; width: 100%; max-width: 380px; }
.marca { display: flex; align-items: center; gap: 12px; }
.marca img { width: 44px; height: 44px; border-radius: 12px; }
.marca b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.marca small { display: block; color: var(--texto-3); font-size: 13px; font-weight: 500; }
.entrar h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 34px; }
.entrar p.sub { color: var(--texto-2); margin-top: 8px; }
.campo { display: block; margin-top: 18px; }
.campo span { display: block; font-size: 14px; color: var(--texto-2); font-weight: 600; margin-bottom: 7px; }
.campo input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--borde-fuerte);
  background: var(--panel); font-size: 16px; outline: none; transition: border-color .2s;
}
.campo input:focus { border-color: var(--rojo); }
.con-ojo { position: relative; }
.con-ojo input { padding-right: 84px; }
.ojo {
  position: absolute; right: 6px; top: 6px; height: 40px; min-width: 70px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--texto-2); font-weight: 700; font-size: 14px; cursor: pointer;
}
.ojo:focus-visible { outline: 2px solid var(--rojo); }
.boton {
  width: 100%; height: 54px; border: 0; border-radius: 14px; margin-top: 24px; font-weight: 700; font-size: 16.5px;
  background: linear-gradient(180deg, var(--rojo-claro), var(--rojo)); box-shadow: 0 12px 30px -12px rgba(220,38,38,.8);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.boton:disabled { opacity: .6; }
.boton.secundario { background: var(--panel-2); box-shadow: none; border: 1px solid var(--borde-fuerte); }
.error { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(220,38,38,.12); border: 1px solid rgba(220,38,38,.35); color: #fecaca; font-size: 14.5px; }
.nota { margin-top: 18px; color: var(--texto-3); font-size: 13.5px; text-align: center; }

/* ── Armazón ── */
.armazon { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--barra) + var(--seguro-abajo) + 16px); }
.cabeza {
  position: sticky; top: 0; z-index: 20; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: rgba(10,10,10,.86); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--borde); display: flex; align-items: center; gap: 12px;
}
.cabeza img { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.cabeza .titulo { flex: 1; min-width: 0; }
.cabeza .gimnasio { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; max-width: 100%; }
.cabeza .gimnasio svg { width: 16px; height: 16px; flex: none; color: var(--texto-3); }
.frescura { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--texto-3); margin-top: 2px; }
.frescura i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.frescura.ambar i { background: var(--ambar); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.frescura.rojo i { background: var(--rojo-claro); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.icono-boton { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--borde-fuerte); background: var(--panel); display: grid; place-items: center; flex: none; }
.icono-boton svg { width: 20px; height: 20px; }
.icono-boton.girando svg { animation: giro .8s linear infinite; }

.contenido { padding: 16px; display: grid; gap: 14px; }
.aviso-red { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35); color: #fde68a; font-size: 13.5px; }

/* ── Barra de pestañas ── */
.pestanas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--barra) + var(--seguro-abajo)); padding-bottom: var(--seguro-abajo);
  background: rgba(14,14,15,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--borde);
  display: flex; justify-content: center;
}
.pestanas .dentro { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); }
.pestanas button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--texto-3); font-size: 11.5px; font-weight: 600; position: relative; }
.pestanas button svg { width: 23px; height: 23px; }
.pestanas button.activa { color: var(--texto); }
.pestanas button.activa svg { color: var(--rojo-claro); }
.pestanas .globo { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* ── Tarjetas ── */
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; }
.tarjeta.destacada { background: radial-gradient(120% 140% at 0% 0%, rgba(220,38,38,.22), transparent 55%), var(--panel); border-color: rgba(220,38,38,.35); }
.etiqueta { color: var(--texto-3); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cifra { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.cifra.media { font-size: 28px; }
.desglose { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--borde); font-size: 13.5px; color: var(--texto-2); }
.chip b { color: var(--texto); font-weight: 700; }
.chip i { width: 8px; height: 8px; border-radius: 2px; display: block; }
.fila-mes { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--borde); color: var(--texto-2); font-size: 15px; }
.fila-mes b { color: var(--texto); font-size: 18px; font-variant-numeric: tabular-nums; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; padding: 14px 12px; text-align: left; }
.mini .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini .t { color: var(--texto-3); font-size: 12.5px; font-weight: 600; margin-top: 2px; line-height: 1.25; }
.mini.boton-mini { cursor: pointer; color: inherit; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; }

.seccion-titulo { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px -4px; }
.seccion-titulo h2 { font-size: 17px; font-weight: 800; }
.seccion-titulo button { background: none; border: 0; color: var(--rojo-claro); font-weight: 700; font-size: 14px; padding: 4px; }

.lista { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.renglon { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--borde); }
.renglon:first-child { border-top: 0; }
.renglon .inicial { width: 38px; height: 38px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--borde-fuerte); display: grid; place-items: center; font-weight: 800; color: var(--texto-2); flex: none; font-size: 15px; }
.renglon .inicial.ok { border-color: rgba(34,197,94,.5); color: var(--verde); }
.renglon .inicial.no { border-color: rgba(239,68,68,.5); color: var(--rojo-claro); }
.renglon .medio { flex: 1; min-width: 0; }
.renglon .nombre { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.renglon .detalle { color: var(--texto-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.renglon .detalle.dos { white-space: normal; }
.renglon .derecha { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.renglon .derecha b { display: block; }
.renglon .derecha small { color: var(--texto-3); font-size: 12.5px; }
.vacio { padding: 22px 16px; color: var(--texto-3); text-align: center; font-size: 14.5px; }

.pastilla { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pastilla.verde { background: rgba(34,197,94,.13); color: #86efac; }
.pastilla.ambar { background: rgba(245,158,11,.14); color: #fcd34d; }
.pastilla.rojo { background: rgba(239,68,68,.14); color: #fca5a5; }
.pastilla.gris { background: var(--panel-2); color: var(--texto-2); }
.pastilla.azul { background: rgba(59,130,246,.15); color: #93c5fd; }

.llamar { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--borde-fuerte); background: var(--panel-2); display: grid; place-items: center; flex: none; text-decoration: none; }
.llamar svg { width: 18px; height: 18px; color: var(--verde); }

.cajon { display: flex; align-items: center; gap: 14px; }
.cajon .icono { width: 46px; height: 46px; border-radius: 14px; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); display: grid; place-items: center; color: var(--verde); flex: none; }
.cajon .icono svg { width: 24px; height: 24px; }
.cajon .texto { flex: 1; }
.cajon .texto small { color: var(--texto-3); font-size: 13px; }

/* ── Dinero ── */
.segmentos { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; padding: 4px; gap: 4px; }
.segmentos button { border: 0; background: none; height: 38px; border-radius: 10px; font-weight: 700; font-size: 14.5px; color: var(--texto-2); }
.segmentos button.activo { background: var(--panel-2); color: var(--texto); box-shadow: inset 0 0 0 1px var(--borde-fuerte); }
.navegador { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.navegador h2 { font-size: 18px; font-weight: 800; text-align: center; flex: 1; }
.navegador button:disabled { opacity: .3; }
.cambio { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 14px; font-weight: 700; }
.cambio.sube { color: #86efac; }
.cambio.baja { color: #fca5a5; }
.cambio small { color: var(--texto-3); font-weight: 500; }
.grafica { margin-top: 18px; height: 150px; display: flex; align-items: flex-end; gap: 3px; }
.grafica .col { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; min-width: 0; position: relative; }
.grafica .col span { display: block; width: 100%; }
.grafica .col span:last-of-type { border-radius: 4px 4px 0 0; }
.grafica .col.vacia::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--borde-fuerte); border-radius: 2px; }
.ejes { display: flex; gap: 3px; margin-top: 6px; }
.ejes span { flex: 1; text-align: center; font-size: 10.5px; color: var(--texto-3); min-width: 0; overflow: visible; white-space: nowrap; display: flex; justify-content: center; }
.leyenda { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; color: var(--texto-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.barra-h { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.barra-h span { display: block; height: 100%; border-radius: 4px; background: var(--rojo); }
.renglon-barra { padding: 12px 16px; border-top: 1px solid var(--borde); }
.renglon-barra:first-child { border-top: 0; }
.renglon-barra .arriba { display: flex; justify-content: space-between; font-size: 15px; }
.renglon-barra .arriba b { font-variant-numeric: tabular-nums; }

/* ── Socios ── */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.filtros::-webkit-scrollbar { display: none; }
.filtros button { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borde-fuerte); background: var(--panel); font-weight: 700; font-size: 14px; color: var(--texto-2); display: inline-flex; align-items: center; gap: 7px; }
.filtros button b { color: var(--texto); }
.filtros button.activo { background: var(--texto); color: #111; border-color: var(--texto); }
.filtros button.activo b { color: #111; }
.buscar { position: relative; }
.buscar input { width: 100%; height: 46px; padding: 0 14px 0 42px; border-radius: 14px; border: 1px solid var(--borde-fuerte); background: var(--panel); outline: none; font-size: 16px; }
.buscar input:focus { border-color: var(--rojo); }
.buscar svg { position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; color: var(--texto-3); }

/* ── Cortes ── */
.corte .encabezado { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.corte .cuando { font-weight: 800; font-size: 16px; }
.corte .quien { color: var(--texto-3); font-size: 13.5px; }
.corte .numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.corte .numeros div { background: var(--panel-2); border-radius: 12px; padding: 10px; }
.corte .numeros small { display: block; color: var(--texto-3); font-size: 12px; font-weight: 600; }
.corte .numeros b { font-size: 16px; font-variant-numeric: tabular-nums; }
.corte .pie { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--texto-3); gap: 10px; }
.corte .notas { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); color: #fde68a; font-size: 14px; }

/* ── Alertas ── */
.alerta { display: flex; gap: 12px; align-items: flex-start; }
.alerta .punto { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.alerta .punto svg { width: 20px; height: 20px; }
.alerta.rojo .punto { background: rgba(239,68,68,.14); color: var(--rojo-claro); }
.alerta.ambar .punto { background: rgba(245,158,11,.14); color: var(--ambar); }
.alerta.gris .punto { background: rgba(255,255,255,.08); color: var(--texto-2); }
.alerta h3 { font-size: 15.5px; font-weight: 800; }
.alerta p { color: var(--texto-2); font-size: 14px; margin-top: 3px; }
.alerta small { color: var(--texto-3); font-size: 12.5px; display: block; margin-top: 4px; }
.todo-bien { text-align: center; padding: 34px 18px; }
.todo-bien .icono { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: rgba(34,197,94,.12); color: var(--verde); }
.todo-bien .icono svg { width: 30px; height: 30px; }
.todo-bien h3 { font-size: 18px; }
.todo-bien p { color: var(--texto-2); margin-top: 6px; font-size: 14.5px; }

/* ── Hoja (menú y selector) ── */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: aparecer .15s ease; }
.hoja { width: 100%; max-width: 560px; background: var(--panel); border-radius: 22px 22px 0 0; border: 1px solid var(--borde-fuerte); border-bottom: 0; padding: 10px 16px calc(18px + var(--seguro-abajo)); animation: subir .2s ease; }
.hoja .asa { width: 40px; height: 5px; border-radius: 3px; background: var(--borde-fuerte); margin: 0 auto 14px; }
.hoja h3 { font-size: 17px; font-weight: 800; margin: 0 4px 10px; }
.hoja .opcion { width: 100%; text-align: left; padding: 14px 12px; border: 0; border-radius: 12px; background: none; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.hoja .opcion:active, .hoja .opcion.actual { background: var(--panel-2); }
.hoja .opcion svg { width: 20px; height: 20px; color: var(--texto-3); }
.hoja .opcion.peligro { color: #fca5a5; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(40px); opacity: .5; } }

@media (min-width: 600px) {
  .armazon { border-left: 1px solid var(--borde); border-right: 1px solid var(--borde); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── App de socios (pantalla completa desde el menú) ── */
.pantalla { position: fixed; inset: 0; z-index: 40; background: var(--fondo); overflow-y: auto; padding-bottom: calc(24px + var(--seguro-abajo)); }
.cabeza-p { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--fondo); border-bottom: 1px solid var(--borde); }
.cabeza-p h2 { font-size: 19px; font-weight: 800; }
.cuerpo-p { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.formulario { padding-top: 6px; }
.formulario .ayuda { color: var(--texto-3); font-size: 14px; margin-top: 8px; }
.campo textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--borde-fuerte);
  background: var(--panel); font-size: 16px; outline: none; resize: vertical; min-height: 110px; font-family: inherit;
}
.campo textarea:focus, .campo input:focus { border-color: var(--rojo); }
.formulario .campo input[type="date"] { color-scheme: dark; }
.fila-h { display: grid; grid-template-columns: 1fr 1fr 42px; gap: 8px; margin-top: 10px; align-items: center; }
.fila-h input { min-width: 0; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--borde-fuerte); background: var(--panel); font-size: 15px; outline: none; }
.fila-h input:focus { border-color: var(--rojo); }
