/* Horus Fitness · portal de clientes */
:root {
  --bg: #F1F2EE; --panel: #FFFFFF; --ink: #101B2B; --muted: #5D6977; --line: #E1E4DE;
  --chip: #EBEDE7; --field: #F7F8F5;
  --ok: #0B8A6F; --ok-soft: #E3F2EC; --no: #D9811C; --no-soft: #FBF0E1; --bad: #C0392B; --bad-soft: #FBE9E7;
  --pe: #BCC6D1; --head: #0D1724;
  --s1: #2A78D6; --s2: #E5682E; --grid: #E8EAE4;
  --shadow: 0 1px 2px rgba(16,27,43,.05), 0 10px 28px -16px rgba(16,27,43,.18);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1215; --panel: #171B20; --ink: #EEF1F4; --muted: #A3ADB8; --line: #2A3038;
    --chip: #222830; --field: #12161A;
    --ok: #34B892; --ok-soft: #13291F; --no: #E59A3F; --no-soft: #2E2416; --bad: #E5675A; --bad-soft: #321A18;
    --pe: #4A5562; --head: #080C11; --s1: #4C93EA; --s2: #EE7A44; --grid: #232930;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1215; --panel: #171B20; --ink: #EEF1F4; --muted: #A3ADB8; --line: #2A3038;
  --chip: #222830; --field: #12161A;
  --ok: #34B892; --ok-soft: #13291F; --no: #E59A3F; --no-soft: #2E2416; --bad: #E5675A; --bad-soft: #321A18;
  --pe: #4A5562; --head: #080C11; --s1: #4C93EA; --s2: #EE7A44; --grid: #232930;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 "Archivo", "Bahnschrift", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ok); }
h1 { font-size: 26px; line-height: 1.15; margin: 0; font-stretch: 90%; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 15px; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* Encabezado */
.topbar {
  background: var(--head); color: #fff; position: sticky; top: 0; z-index: 20;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #0B8A6F, #2FBF4E 60%, #D9811C) 1;
}
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 52px; height: auto; display: block; flex: none; filter: drop-shadow(0 0 6px rgba(47, 211, 208, .35)); }
.brand-word { font-weight: 800; font-size: 20px; font-stretch: 88%; letter-spacing: .06em; white-space: nowrap;
  background: linear-gradient(90deg, #2a8cff, #2fd3d0 55%, #3be89a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-word b { font-weight: 800; }
.brand small { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: #93A1B0; text-transform: uppercase; margin-left: 4px; }
.topnav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .topnav button {
  color: #DCE3EA; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.topnav a:hover, .topnav button:hover { background: rgba(255,255,255,.14); }
.topnav .who { color: #fff; background: rgba(47,191,78,.16); border-color: rgba(47,191,78,.4); }
.topnav form { margin: 0; }

.wrap { max-width: 1120px; width: 100%; margin: 0 auto; padding: 18px 16px 12px; flex: 1; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }

/* Pestañas tipo interruptor */
.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; position: sticky; top: 58px; z-index: 10;
  backdrop-filter: blur(10px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; border: 0; background: transparent; padding: 9px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(16,27,43,.14); }
.tabs.sub { position: static; background: transparent; padding: 0; gap: 6px; }
.tabs.sub button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); }
.tabs.sub button[aria-selected="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); box-shadow: none; }

/* Tarjetas y cuadrícula */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cardhead h2 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid > .card { margin-bottom: 0; }
.grid > * { min-width: 0; }
.stack > * + * { margin-top: 14px; }
@media (min-width: 900px) {
  .two { grid-template-columns: 1fr 1fr; }
  .side { grid-template-columns: 380px 1fr; align-items: start; }
}

/* Cifras */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .tiles.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tile .val { font-size: 34px; font-weight: 800; font-stretch: 78%; letter-spacing: -.025em; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .val small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.tile .sub.good { color: var(--ok); font-weight: 600; }
.tile .sub.warnc { color: var(--no); font-weight: 600; }

.chartbox { position: relative; height: 240px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }

/* Avisos */
.note { background: var(--ok-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 0; }
.warn { background: var(--no-soft); border: 1px solid var(--no); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 14px; }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 0 0 12px; }
.empty { color: var(--muted); font-size: 14px; padding: 28px 10px; text-align: center; }
.coach { white-space: pre-line; }
ul.tips { margin: 4px 0 0; padding-left: 18px; } ul.tips li { margin: 3px 0; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 9px 14px;
  border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* Formularios */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .form.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.form label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 10px;
  padding: 9px 11px; font-size: 15px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ok); outline-offset: 0; border-color: transparent; }
.form .full { grid-column: 1 / -1; }
.chk { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 14px !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--ink) !important; font-weight: 500 !important; cursor: pointer; }
.chk input { width: 19px; height: 19px; accent-color: var(--ok); flex: none; margin: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 14px; font-weight: 600; background: var(--field); }
.pill input { width: 17px; height: 17px; accent-color: var(--ok); margin: 0; }
.pill:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }

/* Tablas */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: middle; }
th { background: var(--chip); font-weight: 700; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
tbody tr:hover { background: color-mix(in srgb, var(--chip) 55%, transparent); }
tr:last-child td { border-bottom: none; }
td.n, th.n { text-align: right; }
td.wrap { white-space: normal; min-width: 160px; }
tr.grouprow th { background: var(--field); color: var(--ink); }

/* Chips y estados */
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.chip.m-entrenamiento { background: #E6EEFB; color: #1F5FAE; }
.chip.m-dieta { background: var(--ok-soft); color: var(--ok); }
.chip.m-medidas { background: var(--no-soft); color: #A85F0E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.m-entrenamiento { background: #18263A; color: #7FB0F0; } :root:not([data-theme="light"]) .chip.m-medidas { color: var(--no); } }
:root[data-theme="dark"] .chip.m-entrenamiento { background: #18263A; color: #7FB0F0; } :root[data-theme="dark"] .chip.m-medidas { color: var(--no); }
.chip.admin { background: var(--ink); color: var(--panel); }
.state-ok { color: var(--ok); font-weight: 700; }
.state-pend { color: var(--no); font-weight: 700; }
.state-off { color: var(--bad); font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.daychips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.daychips::-webkit-scrollbar { display: none; }
.daychips button { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.daychips button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }

/* Alimentación */
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.totals div { background: var(--chip); border-radius: 10px; padding: 8px 6px; text-align: center; min-width: 0; }
.totals b { display: block; font-size: 19px; font-weight: 800; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.totals span { font-size: 11.5px; color: var(--muted); }
.meal { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.meal .mh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.meal .mt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.meal .mn { font-weight: 700; margin: 2px 0 6px; }
.meal ul { margin: 0; padding-left: 18px; } .meal li { margin: 2px 0; }
.meal .prep, .meal .alt { font-size: 13px; color: var(--muted); margin-top: 6px; }
.kc { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* Rutina */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week button { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 2px; cursor: pointer; text-align: center; font-size: 11px; overflow: hidden; line-height: 1.25; min-width: 0; text-overflow: ellipsis; }
.week button b { display: block; font-size: 13px; }
.week button[aria-pressed="true"] { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset; }
.week .rest { color: var(--muted); }
.block { margin-top: 12px; }
.block h4 { margin: 0 0 6px; font-size: 14px; color: var(--ok); }
.ex { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ex:last-child { border-bottom: none; }
.ex .en { font-weight: 600; }
.ex .ed { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; white-space: nowrap; }
.ex .ei { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.ex a.vid { font-size: 12.5px; font-weight: 700; }
.badge { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; font-weight: 600; }

/* Editores del administrador */
.editor-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--panel); }
.editor-item .ehead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-item .ehead b { font-size: 14px; }
.items { display: grid; gap: 6px; margin-top: 8px; }
.itemrow { display: grid; grid-template-columns: minmax(0, 1fr) 84px 64px 34px; gap: 6px; align-items: center; }
.itemrow .kcal { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.exrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 34px; gap: 6px; align-items: start; border-top: 1px dashed var(--line); padding-top: 8px; }
.exrow .more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 700px) { .exrow .more { grid-template-columns: 1fr; } }
.icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.savebar { position: sticky; bottom: 0; z-index: 15; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); margin: 14px -16px 0; padding: 10px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.savebar .status { font-size: 13px; color: var(--muted); margin-right: auto; }
.savebar .status.dirty { color: var(--no); font-weight: 700; }
.cred { border: 2px solid var(--ok); }
.cred code { font-size: 18px; background: var(--chip); padding: 3px 9px; border-radius: 7px; letter-spacing: .04em; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* Usuarios */
.users td .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.users td .uname { font-weight: 800; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }

/* Ingreso */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth h1 { margin-bottom: 4px; }
.auth form { display: grid; gap: 12px; margin-top: 16px; }
.auth label { display: grid; gap: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Aviso flotante */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
.toast.on { opacity: 1; }
.toast.err { background: var(--bad); color: #fff; }
.loading { padding: 40px; text-align: center; color: var(--muted); }


@media (max-width: 900px) {
  .topbar-in { padding: 8px 12px; flex-wrap: wrap; }
  .brand small { display: none; }
  .wrap { padding: 14px 12px 10px; }
  .tabs { top: 0; position: relative; }
  .savebar { margin: 14px -12px 0; padding: 10px 12px; }
  h1 { font-size: 22px; }
  .tile .val { font-size: 30px; }
}
@media (max-width: 520px) {
  .itemrow { grid-template-columns: minmax(0, 1fr) 72px 34px; }
  .itemrow .kcal { display: none; }
  .totals b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .topbar, .tabs, .savebar, .btn, .intro { display: none !important; }
  body { background: #fff; }
  .card, .tile { box-shadow: none; }
}

/* Ajustes tras la revisión en celular y escritorio */
.form .pill, .field .pill { flex-direction: row; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); font-weight: 600; gap: 7px; }
.field small, .form label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.topnav .who { color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em; border: 1px solid rgba(47,191,78,.4); background: rgba(47,191,78,.16); white-space: nowrap; }
.row select, .row input[type=text] { width: auto; flex: 1 1 160px; min-width: 0; }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.copyrow select { width: auto; }
.users td .acts { flex-wrap: nowrap; }
@media (max-width: 1100px) { .users td .acts { flex-wrap: wrap; } }
@media (max-width: 520px) {
  .tabs { flex-wrap: wrap; border-radius: 16px; }
  .tabs button { flex: 1 1 auto; padding: 8px 10px; font-size: 13.5px; }
  .copyrow { margin-left: 0; }
}

/* Página de inicio con la animación del logo */
.login-grid { display: grid; gap: 16px; max-width: 1040px; margin: 1vh auto 0; align-items: center; }
.login-grid .auth { margin: 0 auto; width: 100%; }
.intro { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid #142331;
  background: #05080c; box-shadow: var(--shadow); }
.intro-video { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain; margin: 0 auto; background: #05080c; }
.intro-title { text-align: center; padding: 6px 12px 18px; margin-top: -8px; }
.intro-title b { display: block; font-weight: 800; font-size: clamp(26px, 5vw, 40px); letter-spacing: .08em; font-stretch: 90%;
  background: linear-gradient(90deg, #2a8cff, #2fd3d0 55%, #3be89a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(47, 211, 208, .45)); }
.intro-title span { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .3em; color: #5fe3c6; }
.intro-toggle { position: absolute; right: 10px; top: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(5,8,12,.6);
  color: #cfe9e3; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.intro-toggle:hover { background: rgba(47, 211, 208, .18); }
@media (min-width: 900px) {
  .login-grid { grid-template-columns: 1.15fr .85fr; margin-top: 3vh; }
  .intro-video { max-height: 68vh; }
}
@media (max-width: 520px) { .brand-logo { width: 42px; } .brand-word { font-size: 17px; } }

/* Página pública de planes */
.plans-hero { text-align: center; max-width: 760px; margin: 2vh auto 18px; }
.plans-hero h1 { font-size: clamp(26px, 4.4vw, 40px); }
.plans-hero p { color: var(--muted); margin: 10px auto 16px; max-width: 620px; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.plans { display: grid; gap: 14px; align-items: stretch; margin-bottom: 14px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan { display: flex; flex-direction: column; position: relative; margin-bottom: 0; padding: 20px; }
.plan h2 { font-size: 22px; margin: 0; }
.plan.featured { border: 2px solid var(--ok); }
.plan-tag { position: absolute; top: -12px; left: 20px; background: var(--ok); color: #fff; font-size: 11.5px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.price { margin: 12px 0 6px; display: flex; align-items: baseline; gap: 6px; }
.price b { font-size: 40px; font-weight: 800; font-stretch: 80%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 8px 0 18px; flex: 1; }
.checks li { padding: 6px 0 6px 26px; position: relative; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.checks li:last-child { border-bottom: 0; }
.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.btn-block { display: flex; width: 100%; }
.plans-more { margin-top: 14px; }
.extras { list-style: none; padding: 0; margin: 0; }
.extras li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.extras li:last-child { border-bottom: 0; }
.extras b { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Horario según hora de entrenamiento y suplementos */
.trainbar { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.trainbar label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.trainbar select { width: auto; min-width: 190px; }
.trainbar .btn { margin-top: 8px; }
.trainbar p { margin: 6px 0 0; }
.trainrow { border: 1px dashed var(--ok); background: var(--ok-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.trainrow .tt { font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 8px; }
.meal .tm { color: var(--ink); font-variant-numeric: tabular-nums; }
.meal .mtag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--chip); color: var(--ink); letter-spacing: .03em; }
.meal.pre .mtag, .meal.post .mtag { background: var(--ok-soft); color: var(--ok); }
.meal.pre, .meal.post { border-color: var(--ok); }
.supl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.schip { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--no-soft); color: var(--ink); border: 1px solid var(--line); }
.supl-gen { font-size: 13.5px; background: var(--no-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.supl-list { display: grid; gap: 8px; }
@media (min-width: 760px) { .supl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.supl { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.supl span { font-size: 13.5px; color: var(--muted); }
.nw { white-space: nowrap; }

/* Botón modo claro / oscuro */
.topnav .theme-btn { font-size: 12px; white-space: nowrap; }
/* Clientes: tabla a todo el ancho y formulario de nuevo cliente debajo */
@media (min-width: 900px) {
  .newuser .form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Comidas con opción 2: pestañas en el celular, lado a lado en pantallas anchas */
.opttabs { display: flex; gap: 6px; margin: 8px 0; }
.opttabs button { flex: 1; border: 1px solid var(--line); background: var(--chip); color: var(--muted); border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.opttabs button span { font-weight: 500; margin-left: 4px; }
.opttabs button[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.opts { display: grid; gap: 10px; }
.opt { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.opt.sel { border: 1px solid var(--ok); }
.opt .optlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); }
.opt .optlbl .ok { color: var(--ok); text-transform: none; letter-spacing: 0; }
.opt .macros { margin-top: 6px; }
.opt:not(.sel) { display: none; }
@media (min-width: 760px) {
  .opts { grid-template-columns: 1fr 1fr; }
  .opt:not(.sel) { display: block; opacity: .8; }
}
/* Pre-entreno en un día sin entrenamiento */
.meal.omitted { opacity: .6; border-style: dashed; }
.meal.omitted .mn { text-decoration: line-through; }

/* Ficha: entreno por día */
.daygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
@media (min-width: 760px) { .daygrid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.daygrid label { font-size: 11px; }

/* Barra «¿Entrenas hoy?»: interruptor grande Entreno / Descanso */
.trainbar { border-width: 2px; padding: 12px; }
.trainbar.on { border-color: var(--ok); background: var(--ok-soft); }
.trainbar.off { border-color: var(--pe); }
.trainbar .tbq { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.tbtoggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tbtoggle button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 800; font-size: 15px; cursor: pointer; }
.tbtoggle button[data-tmode="train"][aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.tbtoggle button[data-tmode="rest"][aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.trainbar label.tbhora { margin-top: 10px; font-size: 13px; }
.trainbar label.tbhora select { flex: 1 1 140px; min-width: 0; font-size: 16px; font-weight: 700; }
@media (min-width: 760px) { .tbtoggle { max-width: 420px; } .trainbar label.tbhora select { flex: 0 1 200px; } }

/* Indicaciones del coach plegables */
.coachnotes { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.coachnotes summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.coachnotes summary::-webkit-details-marker { display: none; }
.coachnotes .chev { transition: transform .2s; color: var(--muted); }
.coachnotes[open] .chev { transform: rotate(180deg); }
.coachnotes ul.tips { margin: 0; padding: 0 14px 12px 32px; }

/* Lista de compras plegable */
.foldcard summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.foldcard summary::-webkit-details-marker { display: none; }
.foldcard summary h2 { margin: 0; }
.foldcard .chev { transition: transform .2s; color: var(--muted); font-size: 18px; }
.foldcard[open] .chev { transform: rotate(180deg); }
.foldcard[open] summary { margin-bottom: 10px; }
