/* ENTRENO · dark, móvil primero, pensado para usarse de pie y con una mano */
:root {
  --bg: #0d1117; --panel: #161d27; --panel2: #1d2634; --line: #2a3546;
  --text: #e7edf5; --muted: #8b98ab; --accent: #b8f04a; --accent-dark: #86b62e;
  --danger: #ff6b6b; --ok: #4ade80; --warn: #ffd166; --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.error { color: var(--danger); font-size: .9rem; margin-top: 8px; }
button { font-family: inherit; }

/* Login */
.login { position: fixed; inset: 0; background: var(--bg); z-index: 50; display: flex; align-items: center; justify-content: center; }
.login-box { width: min(320px, 86vw); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.logo { font-size: 1.9rem; font-weight: 800; letter-spacing: .18em; color: var(--accent); }
.login-box input { padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1.05rem; text-align: center; }

/* Barra superior */
#topbar { position: sticky; top: 0; z-index: 10; padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(13,17,23,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#dia-titulo { font-size: 1.1rem; font-weight: 700; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.fase { color: #0d1117; background: var(--accent); border-color: var(--accent); }
.chip.deficit { color: var(--warn); border-color: #6b5b2a; }
.chip.off { color: var(--danger); border-color: #6b2a2a; }
.progreso { margin-top: 8px; }
.segbar { display: flex; gap: 3px; }
.segbar i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.segbar i.ok { background: var(--accent-dark); }
.segbar i.now { background: var(--accent); }
.progreso-txt { margin-top: 4px; font-size: .72rem; color: var(--muted); }

main { padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }

/* Bloques */
.bloque { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.bloque.activo { padding: 14px; border-color: #3a4a63; }
.bloque.colapsado { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; text-align: left; color: var(--text); font-size: .95rem; }
.bloque.colapsado .ic { font-size: 1rem; width: 22px; }
.bloque.colapsado .tit { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bloque.colapsado .sub { margin-left: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.bloque.colapsado.hecho { opacity: .55; }
.bloque.colapsado.hecho .ic { color: var(--ok); }
.cab { margin-bottom: 8px; }
.ahora { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .12em; color: var(--accent); margin-bottom: 3px; }
.cab h3 { font-size: 1.2rem; line-height: 1.25; }

.objetivo { background: var(--accent); color: #0d1117; font-weight: 800; font-size: 1.05rem;
  border-radius: 10px; padding: 10px 12px; margin: 10px 0 6px; }
.objetivo-msg { font-size: .9rem; color: var(--text); }
.proto-old { margin-top: 6px; font-size: .74rem; color: var(--muted); }
.nota-tec { font-size: .84rem; color: var(--muted); margin-top: 6px; }

/* Checklists (calentamiento y aproximaciones) */
.ticks { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.tick { display: flex; align-items: flex-start; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 11px 12px; }
.tick.on { opacity: .5; }
.tick.on .tick-txt b { text-decoration: line-through; }
.tick input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); margin-top: 1px; }
.tick-txt { font-size: .92rem; line-height: 1.35; }
.tick-txt i { display: block; font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.aprox-box { background: rgba(184,240,74,.05); border: 1px dashed #3f5220; border-radius: 12px; padding: 10px; margin: 10px 0; }
.aprox-cab { font-size: .68rem; font-weight: 800; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.aprox-box .ticks { margin: 0 0 6px; }
.mini-link { background: none; border: none; color: var(--muted); font-size: .82rem; text-decoration: underline; padding: 6px 0; }

/* Series */
.sets { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.set-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
.set-row .tag { font-weight: 800; color: var(--muted); min-width: 26px; }
.set-row .warn { color: var(--danger); }
.deshacer { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .78rem; padding: 8px 12px; }
.sep { text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin: 12px 0 8px; }
.hecho-msg { margin-top: 10px; font-size: .92rem; color: var(--ok); }

.campo-rir label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.rir-seg { display: flex; gap: 6px; }
.rir-seg button { flex: 1; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 800; font-size: 1.1rem; }
.rir-seg button.sel { background: var(--accent); color: #0d1117; border-color: var(--accent); }

.dos { display: flex; gap: 10px; margin-top: 12px; }
.dos .stepper { flex: 1; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper label { min-width: 32px; font-size: .78rem; color: var(--muted); }
.stepper button { width: 44px; height: 48px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 1.3rem; font-weight: 700; }
.stepper input { flex: 1; min-width: 0; width: 100%; height: 48px; text-align: center; font-size: 1.2rem; font-weight: 800; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .86rem; color: var(--muted); margin-top: 12px; }
.check input { width: 22px; height: 22px; accent-color: var(--danger); }

/* Escalas de bienestar: un toque por fila */
.escala { margin-bottom: 10px; }
.escala label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
.escala-btns { display: flex; gap: 3px; }
.escala-btns button { flex: 1; height: 42px; min-width: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); font-size: .82rem; font-weight: 700; padding: 0; }
.escala-btns button.sel { background: var(--accent); color: #0d1117; border-color: var(--accent); }

/* Barra de acción fija */
.barra-accion { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 0 12px; z-index: 15; pointer-events: none; }
.barra-accion:empty { display: none; }
.barra-accion > * { pointer-events: auto; }
.crono { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
  height: 56px; display: flex; align-items: center; font-weight: 800; font-size: .95rem; color: var(--muted); white-space: nowrap; }
.btn-registrar { flex: 1; height: 56px; border: none; border-radius: 14px; background: var(--accent); color: #0d1117;
  font-size: 1.05rem; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.btn-registrar.off { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.btn-registrar:disabled { opacity: .6; }

.btn-primary { width: 100%; padding: 15px; border: none; border-radius: var(--radius); background: var(--accent); color: #0d1117; font-size: 1.02rem; font-weight: 800; }
.btn-primary:active { background: var(--accent-dark); }
.btn-sec { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel2); color: var(--text); font-size: .96rem; font-weight: 700; }

.banner { border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; line-height: 1.45; border: 1px solid var(--line); background: var(--panel2); }
.banner.info { border-color: var(--accent-dark); }
.banner.warn { border-color: #6b5b2a; color: var(--warn); }
.banner.err { border-color: #6b2a2a; color: var(--danger); }
.banner.ok { border-color: #2a6b45; color: var(--ok); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h3 { font-size: 1.02rem; }
.input-txt { width: 100%; padding: 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: .95rem; }
select.input-txt { height: 50px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campo label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 5px; }
.campo input { width: 100%; height: 50px; text-align: center; font-size: 1.15rem; font-weight: 700; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 800; }
.seg button.sel { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.seg button:disabled { opacity: .45; }

.lista { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lista .item { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.lista .item .sp { margin-left: auto; }

.kpis { display: flex; gap: 8px; }
.kpi { flex: 1; background: var(--panel2); border-radius: 12px; padding: 10px 4px; text-align: center; }
.kpi .v { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.kpi .v .muted { font-size: .8rem; }
.kpi .l { font-size: .66rem; color: var(--muted); }

/* Semana */
.dia-fila { padding: 12px 14px; }
.dia-fila.hoy { border-color: var(--accent); }
.dia-fila .cab { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.dia-fila .fecha { font-size: .72rem; font-weight: 800; color: var(--muted); letter-spacing: .06em; min-width: 52px; }
.dia-fila .det { font-size: .84rem; color: var(--muted); line-height: 1.5; }
.badge-hoy { font-size: .62rem; font-weight: 800; background: var(--accent); color: #0d1117; border-radius: 4px; padding: 2px 5px; }
.est { margin-left: auto; font-size: .76rem; font-weight: 700; color: var(--muted); }
.est.ok { color: var(--ok); }
.est.now { color: var(--accent); }
.cardio-tag { margin-top: 6px; font-size: .76rem; color: var(--accent-dark); font-weight: 700; }

/* Tabs */
#tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: rgba(13,17,23,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 7px; background: none; border: none; color: var(--muted); font-size: 1.2rem; }
.tab span { font-size: .66rem; font-weight: 700; }
.tab.activa { color: var(--accent); }

.toast { position: fixed; bottom: calc(132px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 999px;
  font-size: .88rem; z-index: 40; max-width: 90vw; text-align: center; }

table.mtabla { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: 10px; }
table.mtabla th { text-align: left; color: var(--muted); font-size: .72rem; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.mtabla td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
