/* ===== Baseline Report — Design System ===== */
:root {
  --verde: #00471B;
  --verde-claro: #0a6b2c;
  --crema: #f5f5dc;
  --gris: #f3f3f3;
  --gris-borde: #e6e6e6;
  --texto: #14181c;
  --texto-suave: #5c6670;
  --blanco: #ffffff;
  --sombra: 0 2px 8px rgba(0,0,0,0.08);
  --sombra-fuerte: 0 6px 20px rgba(0,0,0,0.14);
  --radio: 16px;
  --radio-sm: 10px;
  --nav-h: 64px;
  --header-h: 104px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--gris);
  color: var(--texto);
  line-height: 1.55;
  overscroll-behavior-y: none;
}

/* ===== Header ===== */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--verde);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  gap: .6rem;
  box-shadow: var(--sombra);
}
.app-header img { height: 92px; width: auto; }
.app-header .title { font-weight: 700; font-size: 1.05rem; letter-spacing: .5px; }
.app-header .back {
  position: absolute; left: 8px; bottom: 0; height: var(--header-h);
  display: none; align-items: center; justify-content: center;
  width: 44px; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer;
}
.app-header.has-back .back { display: flex; }

/* ===== Layout ===== */
.app-main {
  padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 20px);
  max-width: 720px; margin: 0 auto;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 1.35rem; font-weight: 700; margin: 4px 0 4px; }
.section-sub { color: var(--texto-suave); font-size: .95rem; margin-bottom: 18px; }

/* ===== Grid de bloques ===== */
.bloques-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.bloque-card {
  --c: var(--verde);
  position: relative; overflow: hidden;
  border-radius: var(--radio); padding: 18px 16px 16px;
  background: var(--blanco); box-shadow: var(--sombra);
  cursor: pointer; border: 1px solid var(--gris-borde);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 120px; display: flex; flex-direction: column; justify-content: space-between;
}
.bloque-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--c);
}
.bloque-card:active { transform: scale(.97); }
.bloque-card .emoji { font-size: 1.8rem; }
.bloque-card .b-nombre { font-weight: 700; font-size: 1.05rem; margin-top: 8px; }
.bloque-card .b-desc { font-size: .8rem; color: var(--texto-suave); }
.bloque-card .b-count {
  align-self: flex-start; margin-top: 10px;
  font-size: .72rem; font-weight: 700; color: #fff; background: var(--c);
  padding: 2px 10px; border-radius: 999px;
}

/* ===== Lista de ejercicios ===== */
.ejercicio-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-left: 5px solid var(--c, var(--verde));
  border-radius: var(--radio-sm); padding: 14px 14px; margin-bottom: 10px;
  cursor: pointer; box-shadow: var(--sombra);
  transition: transform .12s ease;
}
.ejercicio-item:active { transform: scale(.99); }
.ejercicio-item .e-info { flex: 1; min-width: 0; }
.ejercicio-item .e-titulo { font-weight: 600; font-size: .98rem; }
.ejercicio-item .e-obj { font-size: .82rem; color: var(--texto-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ejercicio-item .chevron { color: var(--texto-suave); font-size: 1.2rem; }
.ejercicio-item .e-video-badge { font-size: .8rem; }

/* ===== Ficha de ejercicio ===== */
.ficha-hero {
  --c: var(--verde);
  background: var(--c); color: #fff; border-radius: var(--radio);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--sombra);
}
.ficha-hero .badge {
  display: inline-block; background: rgba(255,255,255,.2); font-size: .72rem;
  font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; letter-spacing: .5px;
}
.ficha-hero h1 { font-size: 1.4rem; line-height: 1.3; }

.ficha-video {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radio); overflow: hidden; margin-bottom: 16px;
  box-shadow: var(--sombra); background: #000;
}
.ficha-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.campo {
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio); padding: 16px; margin-bottom: 12px; box-shadow: var(--sombra);
}
.campo .campo-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .95rem; margin-bottom: 6px;
}
.campo .campo-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--verde)); }
.campo p { font-size: .95rem; color: #2a2f34; }

.btn-add-sesion {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  background: var(--verde); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 20px; font-weight: 700; font-family: inherit; font-size: .95rem;
  box-shadow: var(--sombra-fuerte); cursor: pointer; z-index: 40;
  display: flex; align-items: center; gap: 8px;
}
.btn-add-sesion:active { transform: scale(.96); }

/* ===== Estado vacío ===== */
.empty {
  text-align: center; color: var(--texto-suave); padding: 60px 20px;
}
.empty .big { font-size: 3rem; margin-bottom: 10px; }

/* ===== Inicio / Hub (tarjetas con foto) ===== */
.hub-b { padding: 6px 0 20px; display: flex; flex-direction: column; gap: 14px; }
.hub-photo {
  position: relative; overflow: hidden; cursor: pointer;
  height: 160px; border-radius: var(--radio); box-shadow: var(--sombra);
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end; transition: transform .12s ease;
}
.hub-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.68) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,0) 100%);
}
.hub-photo:active { transform: scale(.99); }
.hub-photo-txt { position: relative; z-index: 1; padding: 14px 16px; color: #fff; }
.hub-photo-tit { display: block; font-size: 1.3rem; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hub-photo-sub { display: block; font-size: .82rem; opacity: .92; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hub-perfil { text-align: center; margin-top: 10px; }
.hub-perfil a { color: var(--texto-suave); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: underline; }

body.sin-nav .bottom-nav { display: none; }
.bottom-nav a[hidden] { display: none; }
body.sin-nav .app-main { padding-bottom: calc(24px + var(--safe-bottom)); }

/* ===== Buscador de zapatillas ===== */
.zapa-dos { display: flex; gap: 12px; }
.zapa-dos label { flex: 1; }
.zapa-opciones { display: flex; flex-direction: column; gap: 10px; }
.zapa-op {
  font-family: inherit; font-size: 1.05rem; font-weight: 700; color: var(--verde);
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm);
  padding: 16px; cursor: pointer; box-shadow: var(--sombra); text-align: left;
}
.zapa-op:active { transform: scale(.99); }
.zapa-pos-lista { display: flex; flex-direction: column; gap: 10px; }
.zapa-pos {
  position: relative; overflow: hidden; cursor: pointer;
  height: 100px; border-radius: var(--radio-sm); box-shadow: var(--sombra);
  background-size: cover; background-position: center; display: flex; align-items: flex-end;
}
.zapa-pos::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,0) 70%); }
.zapa-pos:active { transform: scale(.99); }
.zapa-pos-lbl { position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: 1.2rem; padding: 12px 16px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.zapa-arq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.zapa-arq-card {
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm);
  overflow: hidden; cursor: pointer; box-shadow: var(--sombra);
}
.zapa-arq-card:active { transform: scale(.98); }
.zapa-arq-foto { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #fff; display: block; }
.zapa-arq-desc { padding: 10px 12px; font-weight: 600; font-size: .86rem; line-height: 1.4; }
.zapa-arq .chevron { color: var(--texto-suave); font-size: 1.3rem; }
.zapa-filtros { display: flex; gap: 8px; margin-bottom: 14px; }
.zapa-sel {
  flex: 1; min-width: 0; font-family: inherit; font-size: .82rem; color: var(--texto);
  background: var(--gris); border: 1px solid var(--gris-borde); border-radius: 10px; padding: 8px 6px;
}
.zapa-sel:focus { outline: none; border-color: var(--verde); }
.zapa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zapa-card {
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm);
  overflow: hidden; cursor: pointer; box-shadow: var(--sombra);
}
.zapa-card:active { transform: scale(.98); }
.zapa-card img { width: 100%; height: 130px; object-fit: cover; background: #fff; display: block; }
.zapa-card-body { padding: 10px 12px; }
.zapa-card-nombre { font-weight: 700; font-size: .9rem; }
.zapa-card-meta { font-size: .78rem; color: var(--texto-suave); margin: 2px 0 4px; }
.zapa-nota { font-size: .82rem; font-weight: 700; color: var(--verde); }
.zapa-detalle-img { width: 100%; border-radius: var(--radio); overflow: hidden; background: #fff; margin-bottom: 14px; box-shadow: var(--sombra); }
.zapa-detalle-img img { width: 100%; height: auto; display: block; max-height: 280px; object-fit: contain; }
.zapa-nota-big { color: var(--verde); }
.zapa-specs { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.zapa-spec { display: flex; justify-content: space-between; background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm); padding: 12px 14px; }
.zapa-spec span { color: var(--texto-suave); font-size: .9rem; }
.zapa-spec b { font-size: .9rem; }

/* ===== Noticias y Reviews ===== */
.noticia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.noticia-card {
  cursor: pointer; background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); overflow: hidden; box-shadow: var(--sombra);
}
.noticia-card:active { transform: scale(.98); }
.noticia-img { width: 100%; height: 110px; object-fit: cover; background: var(--gris); display: block; }
.noticia-body { padding: 10px 12px; }
.noticia-tipo { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.noticia-tipo.noticia { background: #e6f0fb; color: #1D6FB8; }
.noticia-tipo.review { background: var(--crema); color: var(--verde); }
.noticia-tit { font-weight: 700; font-size: .95rem; margin: 5px 0 3px; line-height: 1.3; }
.noticia-fecha { font-size: .78rem; color: var(--texto-suave); }
.noticia-hero { width: 100%; border-radius: var(--radio); overflow: hidden; margin-bottom: 12px; box-shadow: var(--sombra); }
.noticia-hero img { width: 100%; height: 200px; object-fit: cover; display: block; }

/* ===== Administración ===== */
.admin-cards { display: flex; flex-direction: column; gap: 12px; }
.admin-card {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio);
  padding: 16px 18px; box-shadow: var(--sombra);
}
.admin-card:active { transform: scale(.99); }
.admin-card-emoji { font-size: 1.9rem; flex: 0 0 auto; }
.admin-card-info { flex: 1; min-width: 0; }
.admin-card-tit { font-weight: 700; font-size: 1.05rem; }
.admin-card-sub { font-size: .8rem; color: var(--texto-suave); }
.admin-card .chevron { color: var(--texto-suave); font-size: 1.3rem; }
.adm-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--blanco); border: 1px solid var(--gris-borde); border-left: 5px solid var(--c, var(--verde));
  border-radius: var(--radio-sm); padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--sombra);
}
.adm-row-info { flex: 1; min-width: 0; cursor: pointer; }
.adm-btn { background: var(--gris); border: 0; border-radius: 8px; width: 40px; height: 40px; cursor: pointer; font-size: 1rem; flex: 0 0 auto; }
.adm-btn.danger { background: #fbe9e9; }
.adm-thumb { width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover; border-radius: 8px; background: #fff; }
.img-subir { display: flex; align-items: center; gap: 12px; margin-top: -4px; }
.img-up-btn { cursor: pointer; display: inline-flex; align-items: center; flex: 0 0 auto; }
.img-prev { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--gris-borde); background: #fff; }

/* ===== Redes sociales ===== */
.sociales { text-align: center; margin-top: 22px; }
.sociales-tit { font-size: .8rem; color: var(--texto-suave); font-weight: 600; margin-bottom: 10px; }
.sociales-iconos { display: flex; justify-content: center; gap: 14px; }
.social-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--verde); color: #fff; transition: transform .12s ease;
}
.social-btn:active { transform: scale(.92); }
.social-btn svg { width: 22px; height: 22px; }

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--blanco); border-top: 1px solid var(--gris-borde);
  display: flex; justify-content: space-around; align-items: stretch;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--texto-suave); font-size: .68rem; font-weight: 600;
}
.bottom-nav a .ico { font-size: 1.25rem; line-height: 1; }
.bottom-nav a { font-size: .64rem; }
.bottom-nav a.active { color: var(--verde); }

/* ===== Leyenda de niveles ===== */
.leyenda {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 20px; padding: 12px 14px; background: var(--blanco);
  border: 1px solid var(--gris-borde); border-radius: var(--radio-sm);
  font-size: .8rem; color: var(--texto-suave);
}
.leyenda-tit { font-weight: 700; color: var(--texto); }
.leyenda-item { display: inline-flex; align-items: center; gap: 6px; }
.leyenda-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ===== Enlace de información del bloque ===== */
.info-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--crema); border-left: 5px solid var(--c, var(--verde));
  border-radius: var(--radio-sm); padding: 13px 14px; margin-bottom: 14px;
  cursor: pointer; font-weight: 600; box-shadow: var(--sombra);
}
.info-link:active { transform: scale(.99); }
.info-link .chevron { color: var(--texto-suave); font-size: 1.2rem; }

/* ===== Badges de la ficha ===== */
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ficha-hero .badge { margin-bottom: 0; }
.ficha-hero .badge.nivel { background: #000; color: #fff; }

/* ===== Recursos ===== */
.rec-grupo { font-size: 1.05rem; font-weight: 700; margin: 18px 0 10px; }
.recurso-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--sombra);
}
.recurso-item a { color: var(--texto); text-decoration: none; font-weight: 600; flex: 1; min-width: 0; }
.recurso-item .rec-ext { color: var(--texto-suave); }
.rec-admin { display: flex; gap: 6px; }
.rec-admin button { background: var(--gris); border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: .95rem; }
.rec-vacio { color: var(--texto-suave); font-size: .9rem; padding: 4px 2px 8px; }

/* ===== Montar entreno: cabecera y buscador ===== */
.ent-cabecera { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.ent-nombre-input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 1.05rem; font-weight: 700;
  border: 0; border-bottom: 2px solid var(--gris-borde); background: transparent;
  padding: 8px 2px; color: var(--texto);
}
.ent-nombre-input:focus { outline: none; border-bottom-color: var(--verde); }
.ent-fecha-input {
  flex: 0 0 auto; width: 140px; font-family: inherit; font-size: .8rem; color: var(--texto-suave);
  background: var(--gris); border: 1px solid var(--gris-borde); border-radius: 999px;
  padding: 7px 12px;
}
.ent-fecha-input:focus { outline: none; border-color: var(--verde); }

.buscador-wrap { position: relative; margin-bottom: 18px; }
.buscador-input {
  width: 100%; font-family: inherit; font-size: .95rem; color: var(--texto);
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: 999px;
  padding: 12px 16px;
}
.buscador-input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0,71,27,.1); }
.buscador-resultados { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.busc-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); padding: 10px 12px; cursor: pointer; box-shadow: var(--sombra);
}
.busc-item:active { transform: scale(.99); }
.busc-punto { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.busc-info { flex: 1; min-width: 0; }
.busc-titulo { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busc-bloque { font-size: .78rem; color: var(--texto-suave); }
.busc-add { color: var(--verde); font-weight: 700; font-size: 1.3rem; flex: 0 0 auto; }
.busc-vacio { color: var(--texto-suave); font-size: .85rem; padding: 8px 4px; }

.ent-lista-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ent-lista-cab span { font-size: .85rem; font-weight: 700; color: var(--texto-suave); }
.ent-vaciar { background: none; border: 0; color: #C8102E; font-weight: 700; font-size: .82rem; cursor: pointer; }
.ent-vacio {
  text-align: center; color: var(--texto-suave); font-size: .9rem;
  padding: 24px 16px; background: var(--gris); border-radius: var(--radio-sm);
}

/* ===== Montar entreno ===== */
.entreno-lista { display: flex; flex-direction: column; gap: 10px; }
.entreno-item {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-left: 5px solid var(--c, var(--verde));
  border-radius: var(--radio-sm); padding: 10px 12px; box-shadow: var(--sombra);
}
.ent-top { display: flex; align-items: center; gap: 10px; }
.ent-bottom { display: flex; align-items: center; gap: 8px; padding-left: 36px; }
.ent-dur-wrap { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--texto-suave); white-space: nowrap; }
.ent-dur {
  width: 52px; font-family: inherit; font-size: .9rem; text-align: center;
  border: 1px solid var(--gris-borde); border-radius: 8px; padding: 5px 4px; color: var(--texto);
}
.ent-dur:focus { outline: none; border-color: var(--verde); }
.ent-nota {
  flex: 1; min-width: 0; font-family: inherit; font-size: .85rem; color: var(--texto);
  border: 1px solid var(--gris-borde); border-radius: 8px; padding: 6px 10px; background: var(--gris);
}
.ent-nota:focus { outline: none; border-color: var(--verde); background: var(--blanco); }
.ses-nota { font-size: .82rem; color: var(--texto-suave); font-style: italic; margin-top: 3px; }
.ent-orden {
  flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--gris);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; color: var(--texto-suave);
}
.ent-info { flex: 1; min-width: 0; cursor: pointer; }
.ent-acciones { display: flex; gap: 4px; }
.ent-acciones button {
  background: var(--gris); border: 0; border-radius: 8px; width: 30px; height: 30px;
  cursor: pointer; font-size: .8rem; color: var(--texto); display: flex; align-items: center; justify-content: center;
}
.ent-acciones button:disabled { opacity: .35; }

/* ===== Sesiones ===== */
.sesion-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); padding: 14px; margin-bottom: 10px;
  cursor: pointer; box-shadow: var(--sombra);
}
.sesion-card:active { transform: scale(.99); }
.ses-nombre { font-weight: 700; font-size: 1rem; }
.ses-meta { font-size: .82rem; color: var(--texto-suave); margin-top: 2px; }
.ses-estado {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--crema); color: var(--verde);
}
.ses-estado.completada { background: #e8f5ec; color: #1D8A4E; }
.ses-estado.planificada { background: var(--gris); color: var(--texto-suave); }

/* ===== Filtros de Explorar ===== */
.explorar-filtros { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.explorar-filtros .seg { flex-wrap: wrap; }
.chip-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.expl-count { font-size: .82rem; font-weight: 700; color: var(--texto-suave); margin-bottom: 10px; }

/* ===== Estadísticas ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card {
  background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm);
  padding: 16px 12px; text-align: center; box-shadow: var(--sombra);
}
.stat-num { font-size: 1.7rem; font-weight: 700; color: var(--verde); line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--texto-suave); margin-top: 3px; }
.stat-racha {
  background: var(--crema); color: var(--verde); border-radius: var(--radio-sm);
  padding: 12px 14px; font-size: 1rem; text-align: center; margin-bottom: 16px; font-weight: 600;
}
.stat-racha b { font-size: 1.2rem; }
.stat-seccion-tit { font-weight: 700; font-size: 1rem; margin-bottom: 10px; }
.barra-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.barra-label { width: 42%; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-track { flex: 1; height: 14px; background: var(--gris); border-radius: 999px; overflow: hidden; }
.barra-fill { height: 100%; border-radius: 999px; min-width: 2px; transition: width .4s ease; }
.barra-num { font-size: .8rem; font-weight: 700; color: var(--texto-suave); width: 26px; text-align: right; }

/* ===== Filtros de sesiones ===== */
.ses-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ses-stats-btn { padding: 8px 12px; font-size: .8rem; flex: 0 0 auto; }

.ses-filtros { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; font-family: inherit; font-size: .76rem; font-weight: 600;
  padding: 8px 4px; border-radius: 999px; border: 1px solid var(--gris-borde);
  background: var(--blanco); color: var(--texto-suave); cursor: pointer; white-space: nowrap;
}
.seg-btn.active { background: var(--verde); color: #fff; border-color: var(--verde); }
.ses-fechas { display: flex; gap: 10px; }
.ses-fechas label {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--texto-suave); font-weight: 600;
}
.ses-fechas input {
  flex: 1; min-width: 0; font-family: inherit; font-size: .78rem; color: var(--texto);
  background: var(--gris); border: 1px solid var(--gris-borde); border-radius: 10px; padding: 6px 8px;
}
.ses-fechas input:focus { outline: none; border-color: var(--verde); }
.filtro-limpiar { background: none; border: 0; color: var(--verde); font-weight: 700; font-size: .82rem; cursor: pointer; }

/* ===== Badge del nav ===== */
.bottom-nav a { position: relative; }
.nav-badge {
  position: absolute; top: 6px; left: 50%; margin-left: 4px;
  background: #C8102E; color: #fff; font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== Botones ===== */
.btn {
  font-family: inherit; font-weight: 700; font-size: .95rem;
  border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--verde); color: #fff; }
.btn-sec { background: var(--crema); color: var(--verde); }
.btn-ghost { background: var(--gris); color: var(--texto-suave); }
.btn-danger { background: #fbe9e9; color: #c8102e; }
.btn-peligro { background: #c8102e; color: #fff; }

.zona-peligro { border: 1px solid #f0cdcd; border-radius: 14px; padding: 14px; background: #fdf6f6; }
.campo-label.peligro { color: #c8102e; }
.campo-label.peligro .dot { background: #c8102e; }
.peligro-txt { font-size: 13px; color: var(--texto-suave); margin: 0 0 6px; line-height: 1.5; }

/* Sincronizaciones (admin, solo en test) */
.sync-card { background: #fff; border: 1px solid var(--gris-borde); border-radius: 14px; padding: 14px; margin-bottom: 6px; }
.sync-bloque { background: #fff; border: 1px solid var(--gris-borde); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.sync-bloque-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sync-bloque-tit { font-weight: 700; font-size: 15px; }
.sync-bloque-acc { display: flex; gap: 8px; margin-top: 10px; }
.sync-bloque-acc .btn { flex: 1; }
.sync-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.sync-badge.ok { background: #e8f5ec; color: var(--verde); }
.sync-badge.dif { background: #fff3e0; color: #b26a00; }
.sync-hist { background: #fafbf9; border: 1px solid var(--gris-borde); border-radius: 14px; padding: 4px 12px; }
.sync-hist-row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--gris-borde); }
.sync-hist-row:last-child { border-bottom: 0; }
.sync-hist-fecha { color: var(--texto-suave); font-size: 11px; }

/* Analíticas (admin) */
.an-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.an-card { background: var(--crema); border-radius: 14px; padding: 14px 10px; text-align: center; }
.an-card-num { font-size: 22px; font-weight: 800; color: var(--verde); }
.an-card-lbl { font-size: 11px; color: var(--texto-suave); margin-top: 2px; }
.an-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 4px 0; background: #fafbf9; border: 1px solid var(--gris-borde); border-radius: 14px; }
.an-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 3px; }
.an-bar-num { font-size: 9px; color: var(--texto-suave); height: 12px; }
.an-bar { width: 100%; max-width: 22px; background: var(--verde); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .3s; }
.an-bar-lbl { font-size: 10px; color: var(--texto-suave); text-transform: uppercase; }
.an-ruta { margin-bottom: 10px; }
.an-ruta-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.an-ruta-top b { color: var(--verde); }
.an-ruta-track { height: 8px; background: var(--gris); border-radius: 5px; overflow: hidden; }
.an-ruta-fill { height: 100%; background: var(--verde); border-radius: 5px; }

/* Aviso de cookies */
.cookie-bar {
  position: fixed; left: 12px; right: 12px; z-index: 900;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; line-height: 1.45; color: var(--texto); max-width: 640px; margin: 0 auto;
}
.cookie-bar a { color: var(--verde); font-weight: 600; cursor: pointer; }
.cookie-bar .btn { flex-shrink: 0; padding: 10px 18px; }
@media (max-width: 460px) { .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; } }

.admin-actions { display: flex; gap: 10px; margin-top: 4px; }
.admin-actions .btn { flex: 1; }
.admin-on {
  background: #e8f5ec; color: var(--verde); font-weight: 700;
  padding: 12px; border-radius: 12px; text-align: center;
}

/* ===== Modo entrenar en vivo ===== */
.live {
  position: fixed; inset: 0; z-index: 300; background: var(--verde); color: #fff;
  display: flex; flex-direction: column; overflow-y: auto;
  padding: calc(16px + var(--safe-top)) 18px calc(16px + var(--safe-bottom));
}
.live[hidden] { display: none; }
body.en-live { overflow: hidden; }
.live-descanso { background: #0E5A6B; }
.live-top { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .9rem; opacity: .95; }
.live-x { background: rgba(255,255,255,.2); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.live-progress { height: 5px; background: rgba(255,255,255,.25); border-radius: 999px; margin: 10px 0; overflow: hidden; }
.live-progress > div { height: 100%; background: #fff; transition: width .3s ease; }
.live-timer { font-size: 3.6rem; font-weight: 700; text-align: center; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.live-ej { flex: 1; }
.live-badges { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.live-badges .badge { display: inline-block; background: rgba(255,255,255,.22); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.live-ej h1 { font-size: 1.5rem; text-align: center; margin-bottom: 14px; line-height: 1.25; }
.live-campo { background: rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.live-campo b { display: block; font-size: .85rem; margin-bottom: 4px; }
.live-campo p { font-size: .95rem; line-height: 1.5; }
.live-nota { background: rgba(255,255,255,.24); }
.live-controls { display: flex; gap: 10px; margin-top: 14px; position: sticky; bottom: 0; padding-top: 8px; }
.live-btn { font-family: inherit; font-weight: 700; font-size: 1rem; padding: 14px 16px; border-radius: 14px; border: 0; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; }
.live-btn:disabled { opacity: .4; }
.live-btn-main { flex: 1; background: #fff; color: var(--verde); }
.live-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.live-fase-label { font-size: 1.2rem; font-weight: 700; letter-spacing: 3px; opacity: .9; }
.live-prox { font-size: 1rem; opacity: .95; }
.live-fin-emoji { font-size: 4rem; }
.live-center h1 { font-size: 1.8rem; }

/* ===== Texto legal / privacidad ===== */
.legal h2 { font-size: 1rem; font-weight: 700; margin: 18px 0 6px; color: var(--verde); }
.legal p { font-size: .9rem; line-height: 1.6; margin-bottom: 8px; color: #2a2f34; }
.legal ul { margin: 4px 0 10px 18px; }
.legal li { font-size: .9rem; line-height: 1.55; margin-bottom: 5px; }
.legal-link { text-align: center; margin-top: 16px; }
.legal-link a { color: var(--texto-suave); font-size: .82rem; text-decoration: underline; cursor: pointer; }
.gate-legal { text-align: center; margin-top: 16px; }
.gate-legal a { color: var(--texto-suave); font-size: .8rem; text-decoration: underline; cursor: pointer; }
.gate-consent { font-size: .78rem; color: var(--texto-suave); text-align: center; margin-top: 10px; }
.gate-consent a { color: var(--verde); text-decoration: underline; cursor: pointer; }
.gate-legal-wrap { width: 100%; max-width: 640px; margin: 0 auto; }

/* ===== Pantalla de acceso (gate) ===== */
.gate {
  position: fixed; inset: 0; z-index: 200; background: #F2EFE2;
  overflow-y: auto; display: flex; align-items: center; justify-content: center;
  padding: calc(28px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
}
.gate[hidden] { display: none; }
body.gated { overflow: hidden; }
.gate-inner { width: 100%; max-width: 360px; text-align: center; }
.gate-logo { width: 150px; height: auto; margin: 0 auto 6px; display: block; }
.gate-title { font-size: 1.5rem; font-weight: 700; color: var(--verde); }
.gate-sub { color: var(--texto-suave); font-size: .92rem; margin-bottom: 16px; }
.gate-features { list-style: none; text-align: left; margin: 0 auto 20px; max-width: 300px; display: flex; flex-direction: column; gap: 8px; }
.gate-features li { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--texto); font-weight: 500; }
.gate-features li span { font-size: 1.1rem; width: 24px; text-align: center; flex: 0 0 24px; }
.gate-guest-btn { background: #fff; color: var(--verde); border: 2px solid var(--verde); }
.gate-form { text-align: left; }
.gate-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--texto-suave); font-size: .8rem; }
.gate-divider::before, .gate-divider::after { content: ""; flex: 1; height: 1px; background: var(--gris-borde); }

/* ===== Check "recordar sesión" ===== */
.check-row {
  display: flex; flex-direction: row !important; align-items: center; gap: 10px;
  font-weight: 500; font-size: .9rem; color: var(--texto-suave); cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px;
  padding: 0; margin: 0; border: 0; border-radius: 5px;
  accent-color: var(--verde); background: transparent;
}

/* ===== Gestión de usuarios ===== */
.user-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); padding: 12px; margin-bottom: 10px; box-shadow: var(--sombra);
}
.user-av {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  background: var(--verde); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-info { flex: 1; min-width: 0; }
.user-nombre { font-weight: 700; font-size: .95rem; }
.user-yo { color: var(--texto-suave); font-weight: 500; font-size: .8rem; }
.user-email { font-size: .8rem; color: var(--texto-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-rol {
  font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--gris); color: var(--texto-suave); white-space: nowrap;
}
.user-rol.admin { background: var(--crema); color: var(--verde); }
.user-btn { padding: 8px 10px; font-size: .78rem; flex: 0 0 auto; }

/* ===== Copias de seguridad ===== */
.backup-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--sombra);
}
.backup-fecha { font-weight: 700; font-size: .9rem; }
.backup-size { font-size: .78rem; color: var(--texto-suave); }
.backup-dl { padding: 8px 12px; font-size: .8rem; text-decoration: none; }

/* ===== Perfil / Auth ===== */
.campo:has(.perfil-avatar) { display: flex; align-items: center; gap: 14px; }
.perfil-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 52px;
  background: var(--verde); color: #fff; font-weight: 700; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.perfil-avatar img, .user-av img { width: 100%; height: 100%; object-fit: cover; }
.perfil-avatar.grande { width: 96px; height: 96px; flex: 0 0 96px; font-size: 2.4rem; }
.edit-avatar { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.edit-avatar-btns { display: flex; gap: 10px; }
.avatar-label { display: inline-flex; align-items: center; }
.user-av { overflow: hidden; }
.user-acciones { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.user-acciones .user-btn { width: 100%; }
.user-rol { display: inline-block; margin-top: 4px; }
.perfil-nombre { font-weight: 700; font-size: 1.05rem; }
.perfil-email { color: var(--texto-suave); font-size: .85rem; }
.perfil-rol {
  display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 700;
  background: var(--crema); color: var(--verde); padding: 2px 10px; border-radius: 999px;
}
.auth-switch { text-align: center; margin-top: 16px; color: var(--texto-suave); font-size: .9rem; }
.auth-switch a { color: var(--verde); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ===== Formularios ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--texto); }
.form input, .form textarea, .form select {
  font-family: inherit; font-size: .95rem; color: var(--texto);
  background: var(--blanco); border: 1px solid var(--gris-borde);
  border-radius: 12px; padding: 12px 14px; width: 100%; font-weight: 400;
}
.form textarea { resize: vertical; line-height: 1.5; }
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0,71,27,.12);
}
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-actions .btn { flex: 1; }

/* ===== Etiquetas (tags) ===== */
.form-tags { display: flex; flex-direction: column; gap: 8px; }
.tag-label { font-weight: 600; font-size: .9rem; color: var(--texto); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--gris-borde);
  background: var(--blanco); color: var(--texto-suave); cursor: pointer;
}
.tag-chip.active { background: var(--verde); color: #fff; border-color: var(--verde); }
.ficha-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ficha-tag {
  font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: var(--crema); color: var(--verde); border: 1px solid var(--gris-borde);
}

/* ===== Banner instalar app ===== */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  z-index: 60; background: var(--verde); color: #fff; border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--sombra-fuerte);
  display: flex; align-items: center; gap: 10px;
  max-width: 700px; margin: 0 auto;
  animation: fade .25s ease;
}
.install-banner .ib-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-banner .ib-txt b { font-size: .95rem; }
.install-banner .ib-txt span { font-size: .78rem; opacity: .95; }
.install-banner .ib-btn {
  flex: 0 0 auto; background: #fff; color: var(--verde); border: 0; border-radius: 10px;
  padding: 9px 14px; font-family: inherit; font-weight: 700; font-size: .85rem; cursor: pointer;
}
.install-banner .ib-x {
  flex: 0 0 auto; background: rgba(255,255,255,.2); border: 0; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .9rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px);
  transform: translate(-50%, 20px); opacity: 0;
  background: #14181c; color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: var(--sombra-fuerte); z-index: 100;
  transition: opacity .25s ease, transform .25s ease; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Desktop: centra y limita ancho como si fuera un móvil */
@media (min-width: 780px) {
  .bottom-nav { max-width: 720px; margin: 0 auto; border-radius: 18px 18px 0 0; }
}
