/* ═══════════════════════════════════════════════════════════════
   LCDR Gym — La Casa del Rayo
   Sistema visual: grafito + carmesí del salón + amarillo "rayo".
   El sello de la marca es el corte diagonal (como un rayo) que
   aparece solo en encabezados y en la portada.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Superficies */
  --graphite: #1b1c20;
  --graphite-2: #232529;
  --graphite-3: #2c2f34;
  --line: #383b42;
  --line-soft: #2e3036;
  --oxblood: #4a1016;
  --oxblood-2: #5e141c;

  /* Marca y estados */
  --crimson: #e2323f;
  --crimson-hi: #ff4f5b;
  --crimson-lo: #b31f2b;
  --bolt: #ffc93c;
  --ok: #3dd68c;
  --info: #5aa9ff;
  --danger: #ff5a67;
  --violet: #b591ff;

  /* Texto */
  --chalk: #f3f0eb;
  --text: #e6e3de;
  --muted: #a3a5ab;
  --faint: #74777e;

  /* Tipografía */
  --f-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --f-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-cond: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;

  /* Radios: grandes para contenedores, medianos para controles, pequeños para etiquetas */
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  --sidebar-w: 256px;
  --topbar-h: 58px;
  --bottombar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--graphite);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video, canvas { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }
.ic-xl { width: 40px; height: 40px; stroke-width: 1.6; }

/* ───────────────────────── Estructura ───────────────────────── */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--oxblood) 0%, #2a0b0f 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  display: none; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 22px 12px; text-decoration: none; }
.brand img { width: 30px; height: auto; filter: drop-shadow(0 0 10px rgba(226,50,63,.7)); }
.brand-name { font-family: var(--f-display); font-size: 1.75rem; letter-spacing: .06em; line-height: 1; color: var(--chalk); }
.brand-sub { display: block; font-family: var(--f-body); font-size: .74rem; letter-spacing: 0; color: rgba(255,255,255,.55); margin-top: 3px; }

.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; }
.nav-group { margin-top: 10px; }
.nav-group-label { font-family: var(--f-cond); font-weight: 600; font-size: .78rem; color: rgba(255,255,255,.45); padding: 0 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0;
  color: rgba(255,255,255,.78); text-decoration: none; border-radius: var(--r-md);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: rgba(0,0,0,.28); color: #fff; box-shadow: inset 3px 0 0 var(--bolt); }
.nav-link.is-active .ic { color: var(--bolt); }

.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px; border-radius: var(--r-md); }
.me:hover { background: rgba(255,255,255,.06); }
.me-name { font-weight: 600; font-size: .92rem; color: #fff; line-height: 1.2; }
.me-role { font-size: .78rem; color: rgba(255,255,255,.55); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--crimson); color: #fff;
  font-family: var(--f-display); font-size: 1.15rem; letter-spacing: .04em; text-decoration: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: rgba(27,28,32,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .brand { padding: 0; gap: 8px; }
.topbar .brand img { width: 20px; }
.topbar .brand-name { font-size: 1.45rem; }
.topbar-back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: 50%; color: var(--chalk); text-decoration: none; }
.topbar-back:hover { background: var(--graphite-3); }
.topbar-title { font-family: var(--f-cond); font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .avatar { width: 34px; height: 34px; font-size: 1rem; }

.main { padding: 18px 16px calc(var(--bottombar-h) + var(--safe-b) + 28px); max-width: 1220px; margin: 0 auto; }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  height: calc(var(--bottombar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(24,25,29,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
}
.bb-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); text-decoration: none; font-size: .72rem; font-weight: 600;
  background: none; border: 0; cursor: pointer; position: relative;
}
.bb-item .ic { width: 22px; height: 22px; }
.bb-item.is-active { color: var(--chalk); }
.bb-item.is-active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--crimson); }
.bb-item.is-active .ic { color: var(--crimson-hi); }

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .bottombar { display: none; }
  .content { margin-left: var(--sidebar-w); }
  .main { padding: 30px 40px 60px; }
}

/* Hoja "Más" (navegación completa en celular) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 86vh; overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b));
  background: var(--graphite-2); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
  transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.sheet { visibility: hidden; transition: transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s linear .25s; }
.sheet.is-open { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 1024px) { .sheet, .sheet-backdrop { display: none; } }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 12px; }
.sheet .nav-group-label { color: var(--muted); }
.sheet .nav-link { color: var(--text); padding: 12px; }
.sheet .nav-link.is-active { background: var(--graphite-3); }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }

/* ───────────────────────── Encabezado de página ───────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(2.1rem, 6vw, 3rem);
  letter-spacing: .02em; line-height: .95; margin: 0; color: var(--chalk);
}
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 8px; }
.crumb:hover { color: var(--chalk); }

/* El rayo: banda diagonal de marca para portadas */
.bolt-band {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--oxblood) center/cover no-repeat;
  isolation: isolate;
}
.bolt-band::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(20,6,8,.94) 0%, rgba(40,8,12,.82) 48%, rgba(74,16,22,.25) 100%);
}
.bolt-band::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 6%; width: 46px; z-index: -1;
  background: var(--crimson); opacity: .85;
  clip-path: polygon(60% 0, 100% 0, 45% 52%, 78% 52%, 0 100%, 30% 48%, 0 48%);
  filter: drop-shadow(0 0 18px rgba(226,50,63,.8));
}

/* ───────────────────────── Tarjetas y grillas ───────────────────────── */
.card { background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > * { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-title { font-family: var(--f-cond); font-weight: 600; font-size: 1.15rem; margin: 0; color: var(--chalk); display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--crimson-hi); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 16px 18px 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-side { grid-template-columns: minmax(0, 1fr) 360px; } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 16px; }
.tr { text-align: right; } .tc { text-align: center; }
.nowrap { white-space: nowrap; }
.hide-sm { display: none; }
@media (min-width: 720px) { .hide-sm { display: initial; } .show-sm-only { display: none !important; } }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 14px 16px; text-decoration: none; display: block; }
a.stat:hover { border-color: var(--line); }
.stat-value { font-family: var(--f-display); font-size: 2.3rem; line-height: 1; color: var(--chalk); letter-spacing: .02em; }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat-ok .stat-value { color: var(--ok); }
.stat-bad .stat-value { color: var(--danger); }
.stat-bolt .stat-value { color: var(--bolt); }

/* Accesos rápidos */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 112px;
  background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  text-decoration: none; transition: border-color .15s, background .15s;
}
.tile:hover { border-color: var(--crimson-lo); background: #26282d; }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(226,50,63,.14); color: var(--crimson-hi); }
.tile-ic.t-bolt { background: rgba(255,201,60,.13); color: var(--bolt); }
.tile-ic.t-ok { background: rgba(61,214,140,.13); color: var(--ok); }
.tile-ic.t-info { background: rgba(90,169,255,.13); color: var(--info); }
.tile-ic.t-violet { background: rgba(181,145,255,.14); color: var(--violet); }
.tile-name { font-weight: 600; color: var(--chalk); line-height: 1.2; }
.tile-desc { color: var(--muted); font-size: .85rem; line-height: 1.3; margin-top: -6px; }

.section-label { font-family: var(--f-cond); font-weight: 600; color: var(--muted); font-size: .95rem; margin: 26px 0 10px; }

/* ───────────────────────── Botones ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--f-cond); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  transition: background .15s, border-color .15s, transform .08s;
  background: var(--graphite-3); color: var(--chalk); border-color: var(--line);
}
.btn:hover { background: #34373d; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn-primary:hover { background: var(--crimson-hi); border-color: var(--crimson-hi); }
.btn-bolt { background: var(--bolt); border-color: var(--bolt); color: #1d1606; }
.btn-bolt:hover { background: #ffd666; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--graphite-3); color: var(--chalk); }
.btn-danger { background: transparent; border-color: rgba(255,90,103,.45); color: var(--danger); }
.btn-danger:hover { background: rgba(255,90,103,.12); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .92rem; border-radius: 10px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.btn-icon.btn-sm { width: 36px; min-height: 36px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────────────────────── Formularios ───────────────────────── */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.form-grid.cols-2-sm { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .span-2 { grid-column: span 2; }
  .span-all { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .9rem; color: var(--text); }
.hint { font-size: .82rem; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--graphite); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--chalk); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a5ab' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(226,50,63,.22); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[readonly] { color: var(--muted); background: var(--graphite-2); }
input[type=date].input, input[type=month].input { min-width: 0; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
input[type=file].input { padding: 9px; }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: 8px; padding: 6px 12px; background: var(--graphite-3); color: var(--chalk); font-weight: 600; cursor: pointer; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 42px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--crimson); cursor: pointer; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.unit { position: relative; }
.unit > .input { padding-right: 46px; }
.unit > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .88rem; pointer-events: none; }

/* Selector numérico − / + */
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--graphite); }
.stepper button { width: 46px; border: 0; background: var(--graphite-3); color: var(--chalk); font-size: 1.3rem; cursor: pointer; }
.stepper button:active { background: var(--crimson); }
.stepper input { flex: 1; min-width: 0; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--chalk); outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { flex: 1 1 180px; }
.filters .btn { flex: none; }

/* Segmentado */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--graphite); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg a, .seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-family: var(--f-cond); cursor: pointer; }
.seg .is-active { background: var(--graphite-3); color: var(--chalk); }

/* ───────────────────────── Tablas (se vuelven fichas en celular) ───────────────────────── */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-family: var(--f-cond); font-weight: 600; color: var(--muted); font-size: .88rem; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
.cell-title { font-weight: 600; color: var(--chalk); }
.cell-sub { font-size: .82rem; color: var(--faint); }

@media (max-width: 719px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { background: var(--graphite); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; }
  .tbl-cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); color: var(--faint); font-size: .85rem; text-align: left; flex: none; }
  .tbl-cards td[data-label=""]::before, .tbl-cards td:not([data-label])::before { display: none; }
  .tbl-cards td.primary { display: block; text-align: left; font-size: 1.02rem; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
  .tbl-cards td.primary::before { display: none; }
  .tbl-cards td.actions { justify-content: flex-end; padding-top: 8px; }
  .tbl-cards td.actions::before { display: none; }
  .tbl-cards .num { text-align: right; }
  .card-flush .tbl-cards { padding: 12px; }
}

/* ───────────────────────── Etiquetas ───────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--graphite-3); color: var(--text); white-space: nowrap; }
.pill-ok { background: rgba(61,214,140,.14); color: var(--ok); }
.pill-bad { background: rgba(255,90,103,.14); color: var(--danger); }
.pill-bolt { background: rgba(255,201,60,.14); color: var(--bolt); }
.pill-info { background: rgba(90,169,255,.14); color: var(--info); }
.pill-crimson { background: rgba(226,50,63,.18); color: var(--crimson-hi); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ───────────────────────── Avisos ───────────────────────── */
.toasts { position: fixed; z-index: 90; left: 12px; right: 12px; top: calc(var(--topbar-h) + 10px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; top: 20px; width: 380px; } }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--r-md); background: #2a2c31; border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); animation: toastIn .25s ease-out;
}
.toast .ic { margin-top: 1px; }
.toast-success { border-color: rgba(61,214,140,.45); } .toast-success .ic { color: var(--ok); }
.toast-error { border-color: rgba(255,90,103,.5); } .toast-error .ic { color: var(--danger); }
.toast-info .ic { color: var(--info); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--graphite); }
.notice .ic { margin-top: 2px; }
.notice-info { border-color: rgba(90,169,255,.35); } .notice-info > .ic { color: var(--info); }
.notice-ok { border-color: rgba(61,214,140,.4); } .notice-ok > .ic { color: var(--ok); }
.notice-bad { border-color: rgba(255,90,103,.45); } .notice-bad > .ic { color: var(--danger); }
.notice-bolt { border-color: rgba(255,201,60,.4); } .notice-bolt > .ic { color: var(--bolt); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic-xl { color: var(--faint); margin-bottom: 8px; }
.empty h3 { margin: 0 0 4px; color: var(--chalk); font-family: var(--f-cond); font-weight: 600; font-size: 1.15rem; }
.empty p { margin: 0 auto 16px; max-width: 40ch; }

/* ───────────────────────── Diálogos ───────────────────────── */
dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0;
  background: var(--graphite-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
dialog.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: popIn .2s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-family: var(--f-cond); font-weight: 600; font-size: 1.2rem; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; max-height: calc(100vh - 170px); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 18px 18px; flex-wrap: wrap; }
@media (max-width: 639px) {
  dialog.modal { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); }
  dialog.modal[open] { animation: sheetUp .22s ease-out; }
  .modal-foot .btn { flex: 1; }
}
@keyframes sheetUp { from { transform: translateY(40%); opacity: .4; } }
dialog.modal-video { width: min(960px, calc(100vw - 16px)); background: #000; }
dialog.modal-video .modal-body { padding: 0; max-height: none; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 639px) { dialog.modal-video { margin: auto; border-radius: var(--r-lg); width: calc(100vw - 16px); } }

/* ───────────────────────── Progreso ───────────────────────── */
.bar { height: 10px; background: var(--graphite-3); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--crimson); transition: width .4s ease; }
.bar-bolt > span { background: var(--bolt); }

/* Acordeón */
details.acc { background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
details.acc + details.acc { margin-top: 10px; }
details.acc > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .chev { margin-left: auto; transition: transform .2s; color: var(--faint); }
details.acc[open] > summary .chev { transform: rotate(180deg); }
details.acc > .acc-body { padding: 0 16px 16px; }

/* Paginación */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; text-decoration: none; background: var(--graphite-2); border: 1px solid var(--line-soft); font-weight: 600; }
.pager .is-active { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.pager .is-disabled { opacity: .35; }

/* Buscador con lista (selector de personas) */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; max-height: 290px; overflow-y: auto;
  background: #2a2c31; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 6px; display: none;
}
.combo.is-open .combo-list { display: block; }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; }
.combo-opt:hover, .combo-opt.is-hl { background: var(--graphite-3); }
.combo-opt .avatar { width: 30px; height: 30px; font-size: .9rem; }
.combo-empty { padding: 12px; color: var(--faint); }

/* ───────────────────────── Ingreso ───────────────────────── */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr;
  background: var(--graphite);
}
.auth-visual {
  position: relative; min-height: 260px; background: var(--oxblood) center/cover no-repeat;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 62% 100%, 0 88%);
  display: flex; align-items: flex-end; padding: 26px 24px 54px;
}
.auth-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,6,8,.25), rgba(20,6,8,.85)); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-mark { display: flex; align-items: center; gap: 12px; }
.auth-mark img { width: 34px; filter: drop-shadow(0 0 14px rgba(255,79,91,.9)); }
.auth-mark .brand-name { font-size: 2.2rem; }
.auth-tagline { font-family: var(--f-display); font-size: clamp(2.6rem, 9vw, 5.2rem); line-height: .9; color: #fff; margin: 14px 0 0; letter-spacing: .01em; }
.auth-form-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 8px 20px 40px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-family: var(--f-cond); font-weight: 600; font-size: 1.5rem; margin: 0 0 4px; color: var(--chalk); }
.auth-form > p { margin: 0 0 22px; color: var(--muted); }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 52px; }
.pass-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 10px; }
.pass-toggle:hover { color: var(--chalk); }
.auth-foot { margin-top: 28px; color: var(--faint); font-size: .8rem; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.15fr 1fr; }
  .auth-visual { min-height: 100vh; clip-path: polygon(0 0, 100% 0, 82% 46%, 92% 46%, 70% 100%, 0 100%); padding: 48px 34% 56px 48px; align-items: flex-end; }
  .auth-tagline { font-size: clamp(3rem, 5vw, 4.6rem); }
  .auth-form-wrap { align-items: center; padding: 40px; }
}

/* Ad (solo web) */
.ad-slot { margin-top: 24px; min-height: 0; }

/* Utilidades de impresión/movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ───────────────────────── Portadas y listas ───────────────────────── */
.hero { min-height: 220px; display: flex; align-items: flex-end; }
.hero-in { padding: 26px 22px 22px; max-width: 640px; }
.hero-date { margin: 0; color: rgba(255,255,255,.75); font-weight: 500; }
.hero-date::first-letter { text-transform: uppercase; }
.hero-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.6rem, 9vw, 4.2rem); line-height: .92; margin: 4px 0 6px; color: #fff; }
.hero-sub { margin: 0; color: rgba(255,255,255,.82); }
@media (min-width: 1024px) { .hero { min-height: 250px; } .hero-in { padding: 34px 34px 28px; } }

.people { list-style: none; margin: 0; padding: 0; }
.people li a { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; text-decoration: none; }
.people li a:hover { background: var(--graphite-3); }
.people .avatar, .tbl .avatar, .combo-opt .avatar { width: 34px; height: 34px; font-size: 1rem; background: var(--graphite-3); color: var(--chalk); box-shadow: none; }
@media (max-width: 719px) {
  .card-flush:has(> .table-wrap > .tbl-cards) { background: none; border: 0; }
  .card-flush:has(> .table-wrap > .tbl-cards) > .table-wrap > .tbl-cards { padding: 0; }
  .card-flush.plan-group:has(.tbl-cards) { background: var(--graphite-2); border: 1px solid var(--line-soft); }
  .card-flush.plan-group .tbl-cards { padding: 12px !important; }
  .filters .field { flex: 1 1 140px; }
}

.note-mini { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.note-mini:last-child { border-bottom: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── Planes ───────────────────────── */
.plan-group { margin-bottom: 16px; }
@media (min-width: 720px) {
  .tbl-plan { table-layout: fixed; }
  .tbl-plan th:nth-child(1) { width: 36%; } .tbl-plan th:nth-child(2) { width: 16%; }
  .tbl-plan th:nth-child(n+3):nth-child(-n+6) { width: 8%; } .tbl-plan th:last-child { width: 16%; }
}
.vid-spacer { display: inline-block; width: 36px; flex: none; }
@media (max-width: 719px) { .vid-spacer { display: none; } }
.plan-group .avatar { background: var(--graphite-3); color: var(--chalk); box-shadow: none; }
.plan-rows .plan-row + .plan-row { margin-top: 12px; }
.plan-row { border-left: 3px solid var(--crimson); }
.plan-row-head { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 10px; }
.plan-row-n { font-family: var(--f-cond); font-weight: 600; color: var(--muted); }
.add-row { border-style: dashed; min-height: 52px; }
.sticky-actions {
  position: sticky; bottom: calc(var(--bottombar-h) + var(--safe-b) + 8px); z-index: 20; margin-top: 18px;
  display: flex; gap: 10px; padding: 10px; border-radius: var(--r-lg);
  background: rgba(35,37,41,.94); backdrop-filter: blur(10px); border: 1px solid var(--line);
}
.sticky-actions .btn-primary { flex: 1; }
@media (min-width: 1024px) { .sticky-actions { bottom: 16px; } .sticky-actions .btn-primary { flex: none; } }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; color: var(--muted); }
.steps li strong { color: var(--chalk); }

/* ───────────────────────── Ejercicios ───────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--graphite-2); border: 1px solid var(--line-soft); text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--muted); }
.chip span { color: var(--faint); font-weight: 500; }
.chip.is-active { background: var(--chalk); color: var(--graphite); border-color: var(--chalk); }
.chip.is-active span { color: #555; }
.ej-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .ej-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .ej-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1300px) { .ej-grid { grid-template-columns: repeat(4, 1fr); } }
.ej-card { background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ej-thumb { position: relative; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--oxblood), #2a0b0f); display: block; width: 100%; }
.ej-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; transition: opacity .2s; }
.ej-thumb:hover img { opacity: 1; }
.ej-thumb[disabled] { cursor: default; }
.ej-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(226,50,63,.92); color: #fff; box-shadow: 0 6px 22px rgba(0,0,0,.5); }
.ej-thumb[disabled] .ej-play { background: rgba(0,0,0,.4); color: var(--muted); }
.ej-play .ic { fill: currentColor; }
.ej-thumb[disabled] .ej-play .ic { fill: none; }
.ej-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ej-body h3 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--chalk); line-height: 1.25; flex: 1; }

/* ───────────────────────── Medidas y progreso ───────────────────────── */
.sum-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .sum-grid { grid-template-columns: repeat(4, 1fr); } }
.sum-card { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--graphite-2); border: 1px solid var(--line-soft); cursor: pointer; color: inherit; transition: border-color .15s, background .15s; }
.sum-card[aria-pressed="true"] { border-color: var(--crimson); background: #2a2124; box-shadow: inset 0 0 0 1px var(--crimson); }
.sum-label { color: var(--muted); font-size: .86rem; }
.sum-value { font-family: var(--f-display); font-size: 2rem; line-height: 1.05; color: var(--chalk); }
.sum-value small { font-family: var(--f-body); font-size: .8rem; color: var(--faint); }
.sum-delta { font-size: .82rem; font-weight: 600; color: var(--faint); display: inline-flex; align-items: center; gap: 4px; }
.sum-delta.is-good { color: var(--ok); }
.sum-delta.is-bad { color: var(--danger); }
.chart-box { position: relative; height: 320px; }
@media (min-width: 1024px) { .chart-box { height: 380px; } }

/* ───────────────────────── Nutrición ───────────────────────── */
.day-badge { width: 48px; height: 52px; flex: none; border-radius: 12px; background: var(--graphite-3); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.day-badge span { font-family: var(--f-display); font-size: 1.6rem; color: var(--chalk); }
.day-badge small { font-size: .72rem; color: var(--muted); }
.day-kcal { font-family: var(--f-display); font-size: 1.6rem; color: var(--chalk); line-height: 1; margin-bottom: 4px; white-space: nowrap; }
.day-kcal small { font-family: var(--f-body); font-size: .75rem; color: var(--faint); }
.food-list { list-style: none; margin: 0; padding: 0; }
.food-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
@media (max-width: 560px) { details.acc > summary .cell-sub { display: none; } }

/* ───────────────────────── Bitácora ───────────────────────── */
.notes { columns: 1; column-gap: 14px; }
@media (min-width: 760px) { .notes { columns: 2; } }
@media (min-width: 1200px) { .notes { columns: 3; } }
.note { break-inside: avoid; margin-bottom: 14px; background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 14px 16px; }
.note-text { white-space: pre-wrap; margin: 10px 0; color: var(--text); line-height: 1.55; }
.note footer { display: flex; align-items: center; gap: 6px; }
.note-actions { display: flex; gap: 4px; }

/* ───────────────────────── Tablero de video ───────────────────────── */
.upload-progress { margin-top: 14px; display: grid; gap: 6px; }
.ej-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.ttl-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: rgba(0,0,0,.65); color: #fff; }
.tb-layout { display: grid; gap: 16px; }
@media (min-width: 1100px) { .tb-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.tb-stage { position: relative; background: #000; border-radius: var(--r-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; max-height: 78vh; }
.tb-stage video { display: block; max-width: 100%; max-height: 78vh; }
.tb-stage canvas { position: absolute; left: 0; top: 0; pointer-events: none; touch-action: none; }
.tb-stage.is-drawing video { pointer-events: none; }
.tb-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.tb-toolbar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.tb-colors { display: flex; gap: 6px; }
.tb-color { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.tb-color.is-active { border-color: var(--chalk); transform: scale(1.1); }
.tb-width { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tb-width input { accent-color: var(--crimson); width: 100px; }
.tb-status { color: var(--muted); }
.tb-status.is-saving { color: var(--bolt); }
.tb-status.is-error { color: var(--danger); }
.assign-list { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; }
.assign-item { padding: 8px 6px; border-radius: 8px; }
.assign-item:hover { background: var(--graphite-3); }
.tb-notes-view { white-space: pre-wrap; line-height: 1.6; margin: 0; }

/* ───────────────────────── Área del atleta ───────────────────────── */
.hero-client { min-height: 280px; }
.glance { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.glance:hover { border-color: var(--line); }
.glance-head { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--chalk); }
.glance-head .tile-ic { width: 36px; height: 36px; border-radius: 10px; }
.glance-num { font-family: var(--f-display); font-size: 2.8rem; line-height: 1; color: var(--chalk); }
.glance-num small { font-family: var(--f-body); font-size: .9rem; color: var(--faint); }
.txt-ok { color: var(--ok); font-weight: 600; } .txt-bad { color: var(--danger); font-weight: 600; }
.ring { --p: 0; --c: var(--crimson); width: 132px; height: 132px; margin: 4px auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--graphite-3) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--graphite-2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring strong { font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--chalk); }
.ring small { font-size: .74rem; color: var(--muted); }

.day-strip { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.ds-arrow { width: 36px; height: 56px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); text-decoration: none; flex: none; }
.ds-arrow:hover { background: var(--graphite-2); color: var(--chalk); }
.ds-day { flex: 1; min-width: 0; height: 62px; border-radius: 14px; background: var(--graphite-2); border: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; position: relative; }
.ds-day small { font-size: .72rem; color: var(--faint); text-transform: capitalize; }
.ds-day strong { font-family: var(--f-display); font-size: 1.5rem; line-height: 1; font-weight: 400; color: var(--chalk); }
.ds-day.is-today small { color: var(--bolt); }
.ds-day.is-active { background: var(--crimson); border-color: var(--crimson); }
.ds-day.is-active small { color: rgba(255,255,255,.85); }
.ds-dot { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--bolt); }
.ds-day.is-active .ds-dot { background: #fff; }
.ds-pick { position: relative; overflow: hidden; flex: none; }
.ds-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (max-width: 420px) { .ds-day:nth-child(2), .ds-day:nth-child(8) { display: none; } }

.session { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 15; background: rgba(35,37,41,.96); backdrop-filter: blur(10px); margin-bottom: 8px; }
@media (min-width: 1024px) { .session { top: 12px; } }
.session-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.session-clock { font-family: var(--f-display); font-size: 2.8rem; line-height: 1; color: var(--chalk); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.session.is-running .session-clock { color: var(--bolt); }
.rest { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255,201,60,.1); border: 1px solid rgba(255,201,60,.35); }
.rest-time { font-family: var(--f-display); font-size: 2.4rem; line-height: 1; color: var(--bolt); }

.ex-list { display: grid; gap: 10px; }
@media (min-width: 900px) { .ex-list { grid-template-columns: 1fr 1fr; } }
.ex { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--graphite-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); transition: opacity .2s, border-color .2s; }
.ex.is-done { border-color: rgba(61,214,140,.4); }
.ex.is-done h3 { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }
.ex-check { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: none; color: transparent; cursor: pointer; display: grid; place-items: center; margin-top: 2px; }
.ex-check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #0c2a1b; }
.ex-main { flex: 1; min-width: 0; }
.ex-main h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; color: var(--chalk); line-height: 1.25; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .92rem; }
.ex-meta strong { color: var(--chalk); font-weight: 700; }
.ex-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.set { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--graphite); color: var(--muted); font-weight: 700; cursor: pointer; }
.set.is-on { background: var(--bolt); border-color: var(--bolt); color: #1d1606; }
.ex-video { flex: none; color: var(--crimson-hi); }

/* Medidas del atleta */
.mgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .mgrid { grid-template-columns: repeat(4, 1fr); } }
.mcell { background: var(--graphite); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mcell strong { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1.05; color: var(--chalk); }
.mcell strong small { font-family: var(--f-body); font-size: .78rem; color: var(--faint); }
.trophy { color: var(--bolt); }

/* Registro de comidas */
.nutri-top { grid-template-columns: 1fr; }
@media (min-width: 900px) { .nutri-top { grid-template-columns: 1.3fr 1fr; } }
.kcal-row { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.kcal-big { font-family: var(--f-display); font-size: 3.6rem; line-height: .9; color: var(--chalk); }
.kcal-mid { font-family: var(--f-display); font-size: 1.9rem; line-height: 1; color: var(--text); }
.macros { display: grid; gap: 12px; }
.macro .bar { margin-top: 6px; }
.donut-box { position: relative; height: 240px; }
.coach-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255,201,60,.08); border: 1px solid rgba(255,201,60,.3); }
.coach-note > .ic { color: var(--bolt); margin-top: 2px; }
.coach-note p { color: var(--text); white-space: pre-wrap; }
.af-picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--graphite); border: 1px solid var(--crimson-lo); }
.af-est { padding: 12px 14px; border-radius: var(--r-md); background: var(--graphite); border: 1px dashed var(--line); color: var(--muted); }
.af-est strong { color: var(--chalk); font-size: 1.15rem; }
.meal-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.meal-pick label { cursor: pointer; }
.meal-pick input { position: absolute; opacity: 0; pointer-events: none; }
.meal-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 999px; background: var(--graphite); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--muted); }
.meal-pick input:checked + span { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.meal-pick input:focus-visible + span { outline: 2px solid var(--bolt); outline-offset: 2px; }
.af-opt-kcal { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.combo-group { padding: 8px 10px 4px; font-size: .78rem; color: var(--faint); font-weight: 600; }
.meal { margin-top: 18px; }
.meal-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.meal-head h2 { margin: 0; font-family: var(--f-cond); font-weight: 600; font-size: 1.15rem; color: var(--chalk); }
.meal-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--graphite-2); color: var(--bolt); }
.meal-empty { margin: 8px 0 0; }
.meal .food-list li:first-child { border-top: 0; }
.ej-body .pill { align-self: flex-start; }
@media (max-width: 559px) {
  .ej-card { flex-direction: row; align-items: stretch; }
  .ej-thumb { width: 128px; flex: none; aspect-ratio: auto; min-height: 96px; }
  .ej-play { width: 38px; height: 38px; }
  .ej-play .ic { width: 18px; height: 18px; }
  .ej-body { padding: 10px 12px; gap: 6px; }
  .ttl-badge { font-size: .7rem; left: 4px; bottom: 4px; }
}
.card-head .btn-group { flex-wrap: nowrap; flex: none; }
.card-head > .row { flex: 1; min-width: 0; }
@media (max-width: 719px) { .tbl-cards tbody { padding-top: 1px; } .tbl-cards tr:first-child { margin-top: 1px; } }
