/* ============================================================
   Cuaderno de entrenamiento — estilos
   Estética: cuaderno de coach. Papel cálido, tipografía editorial,
   un único acento oliva-lima sereno. Nada agresivo.
   ============================================================ */

:root {
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -16px rgba(0,0,0,.18);
}

/* ---------- Tema oscuro (por defecto) ---------- */
[data-theme="dark"] {
  --bg:        #0d0e11;
  --bg-soft:   #131419;
  --surface:   #181a20;
  --surface-2: #21242c;
  --border:    #2d323d;
  --border-soft: #23262f;
  --text:      #e9ebef;
  --text-2:    #a7adb9;
  --muted:     #6d7480;
  --accent:    #ff9e2c;
  --accent-dim:#ffb558;
  --accent-ink:#1a1206;
  --accent-wash:#2a1c0a;
  --clay:      #2dd4bf;       /* cardio (teal) */
  --clay-wash: #0f2b29;
  --rose:      #f06a6a;
  --warn:      #f2884e;       /* avisos / molestias */
  --warn-wash: #2f2113;
  --good:      #8fd36b;
  --good-wash: #1a2614;
}

/* ---------- Tema claro ---------- */
[data-theme="light"] {
  --bg:        #f6f7f9;
  --bg-soft:   #eef0f3;
  --surface:   #ffffff;
  --surface-2: #f1f3f6;
  --border:    #dde0e6;
  --border-soft:#e7e9ee;
  --text:      #1c1e24;
  --text-2:    #565b66;
  --muted:     #8a909c;
  --accent:    #f5851f;
  --accent-dim:#d96f0e;
  --accent-ink:#ffffff;
  --accent-wash:#fdeed9;
  --clay:      #0f9e8e;       /* cardio (teal) */
  --clay-wash: #d6f2ee;
  --rose:      #d24d4d;
  --warn:      #d2702e;
  --warn-wash: #f8e7d6;
  --good:      #4f8a30;
  --good-wash: #e3efd9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ============================================================
   Layout general
   ============================================================ */
.app { min-height: 100vh; }

.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
}

@media (min-width: 940px) {
  .app { padding-left: 248px; }
  .content { padding-top: var(--sp-7); }
}

/* ---------- Topbar (móvil) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  padding-top: max(var(--sp-3), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar__brand { display: flex; align-items: center; gap: var(--sp-2); margin-right: auto; }
.topbar__mark { color: var(--accent); font-size: 18px; }
.topbar__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.topbar__menu { background: none; border: none; width: 34px; height: 34px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.topbar__menu span { height: 2px; background: var(--text-2); border-radius: 2px; transition: .2s; }
.topbar__theme { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; }

@media (min-width: 940px) { .topbar { display: none; } }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  width: 248px; padding: var(--sp-5) var(--sp-4);
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.sidebar.open { transform: translateX(0); }
@media (min-width: 940px) { .sidebar { transform: none; } }

.sidebar__brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-6); }
.sidebar__mark { color: var(--accent); font-size: 26px; line-height: 1; }
.sidebar__title { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1; }
.sidebar__sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.topbar__logo { height: 22px; width: auto; display: block; }
.sidebar__logo { height: 30px; width: auto; display: block; }

/* ---------- Chat con el entrenador ---------- */
.chat { display: flex; flex-direction: column; gap: var(--sp-3); }
.chat__log {
  flex: 1; min-height: 48vh; max-height: 64vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-2);
}
.chat__msg {
  max-width: 82%; padding: 10px 14px; border-radius: var(--r-md);
  line-height: 1.5; font-size: 14.5px; word-wrap: break-word; overflow-wrap: anywhere;
}
.chat__msg--me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chat__msg--coach { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat__empty { margin: auto; max-width: 320px; text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.6; padding: var(--sp-6) var(--sp-3); }
.chat__bar { display: flex; gap: var(--sp-2); align-items: flex-end; }
.chat__input {
  flex: 1; resize: none; max-height: 140px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--r-md); padding: 12px 14px;
}
.chat__input:focus { outline: none; border-color: var(--accent); }
.chat__send { white-space: nowrap; }
.chat__cfg { align-self: center; background: none; border: 0; color: var(--text-2); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; }
.chat__typing { display: inline-flex; gap: 4px; align-items: center; }
.chat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: chatBlink 1.2s infinite both; }
.chat__typing span:nth-child(2) { animation-delay: .2s; }
.chat__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.sidebar__links { display: flex; flex-direction: column; gap: 2px; }
.sidebar__links a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 11px var(--sp-3); border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.sidebar__links a i { font-style: normal; width: 20px; text-align: center; color: var(--muted); font-size: 15px; }
.sidebar__links a:hover { background: var(--surface); color: var(--text); }
.sidebar__links a.active { background: var(--surface-2); color: var(--text); }
.sidebar__links a.active i { color: var(--accent); }
.sidebar__links a.cta { color: var(--accent-ink); background: var(--accent); margin: var(--sp-3) 0; font-weight: 600; }
.sidebar__links a.cta i { color: var(--accent-ink); }
.sidebar__links a.cta:hover { background: var(--accent-dim); color: var(--accent-ink); }

.sidebar__foot { margin-top: auto; padding: var(--sp-4) var(--sp-3) 0; }
.sidebar__phrase { font-size: 13px; color: var(--text-2); line-height: 1.45; padding-left: 11px; border-left: 2px solid var(--accent); }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .26s; }
.scrim.show { opacity: 1; pointer-events: auto; }
@media (min-width: 940px) { .scrim { display: none; } }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 35; width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); border: none;
  font-size: 30px; line-height: 1; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.fab:active { transform: scale(.92); }
@media (min-width: 940px) { .fab { display: none; } }

/* ============================================================
   Tipografía y bloques
   ============================================================ */
.page-head { margin-bottom: var(--sp-6); }
.page-head__kicker { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dim); font-weight: 600; }
.page-head h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 5vw, 36px); line-height: 1.08; margin-top: 6px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin-top: var(--sp-2); max-width: 56ch; }

.section-title { font-family: var(--font-display); font-size: 19px; font-weight: 500; margin: var(--sp-6) 0 var(--sp-4); display: flex; align-items: baseline; gap: var(--sp-3); }
.section-title small { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.card--pad-sm { padding: var(--sp-4); }
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Estado / coach banner ---------- */
.coach {
  display: flex; gap: var(--sp-4); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-5);
  position: relative; overflow: hidden;
}
.coach::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.coach__emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }
.coach__label { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-dim); font-weight: 600; }
.coach__title { font-family: var(--font-display); font-size: 21px; font-weight: 500; margin: 3px 0 5px; }
.coach__msg { color: var(--text-2); font-size: 14.5px; max-width: 60ch; }
.coach.is-warn::before { background: var(--warn); }
.coach.is-warn .coach__label { color: var(--warn); }
.coach.is-good::before { background: var(--good); }

/* ---------- Anillos de objetivo semanal ---------- */
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.goal {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
}
.ring { --p: 0; position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--border); }
.ring__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1); }
.ring--cardio .ring__fill { stroke: var(--clay); }
.ring__num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.goal__meta .goal__label { font-weight: 600; font-size: 14.5px; }
.goal__meta .goal__sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.goal__dots { display: flex; gap: 5px; margin-top: 8px; }
.goal__dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.goal__dots span.on { background: var(--accent); }
.goal--cardio .goal__dots span.on { background: var(--clay); }

/* ---------- Stat tiles ---------- */
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4); }
.stat__label { font-size: 12px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; font-weight: 600; }
.stat__value { font-family: var(--font-display); font-size: 30px; font-weight: 500; margin-top: 6px; line-height: 1; }
.stat__value small { font-family: var(--font-body); font-size: 14px; color: var(--text-2); font-weight: 500; }
.stat__hint { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }

/* ---------- Lista de entreno sugerido ---------- */
.suggest__list { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.suggest__row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px dashed var(--border-soft); }
.suggest__row:last-child { border-bottom: none; }
.suggest__bullet { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); color: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.suggest__name { font-weight: 500; font-size: 14.5px; }
.suggest__scheme { margin-left: auto; color: var(--text-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- Calendario semanal ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-2); }
@media (max-width: 620px) { .week { grid-template-columns: 1fr; gap: var(--sp-2); } }
.day {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: var(--sp-3); min-height: 116px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.day:hover { border-color: var(--border); }
.day.today { border-color: var(--accent); }
.day.today .day__name { color: var(--accent-dim); }
.day__top { display: flex; align-items: baseline; justify-content: space-between; }
.day__name { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.day__num { font-family: var(--font-display); font-size: 16px; }
.day__chip { font-size: 11.5px; padding: 3px 8px; border-radius: 20px; font-weight: 600; width: fit-content; }
.chip-fuerza { background: var(--good-wash); color: var(--good); }
.chip-wod { background: #281f3d; color: #b3a0e8; }
.chip-cardio { background: var(--clay-wash); color: var(--clay); }
.chip-recuperacion { background: var(--warn-wash); color: var(--warn); }
.chip-descanso { background: transparent; color: var(--muted); border: 1px dashed var(--border); }
[data-theme="light"] .chip-wod { background: #e8e1f5; color: #5a4d8a; }
.day__done { margin-top: auto; font-size: 12px; color: var(--good); font-weight: 600; }
.day__pending { margin-top: auto; font-size: 12px; color: var(--muted); }
@media (max-width: 620px) {
  .day { flex-direction: row; align-items: center; min-height: 0; }
  .day__chip, .day__done, .day__pending { margin: 0; }
  .day__top { flex-direction: column; gap: 0; align-items: flex-start; }
}

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); }
.badge--accent { background: var(--good-wash); color: var(--good); }
.badge--clay { background: var(--clay-wash); color: var(--clay); }
.badge--cat { text-transform: capitalize; }
.tag-empuje { background: var(--good-wash); color: var(--good); }
.tag-traccion { background: #14283f; color: #6ab0ff; }
.tag-pierna { background: #281f3d; color: #b3a0e8; }
.tag-bisagra { background: #321f33; color: #e29ad0; }
.tag-core { background: var(--clay-wash); color: var(--clay); }
.tag-cardio { background: var(--clay-wash); color: var(--clay); }
.tag-movilidad { background: var(--surface-2); color: var(--text-2); }
[data-theme="light"] .tag-traccion { background: #dceaf8; color: #2f6db0; }
[data-theme="light"] .tag-pierna { background: #e8e1f5; color: #5a4d8a; }
[data-theme="light"] .tag-bisagra { background: #f3def0; color: #8a4d7a; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-md); font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn:hover { border-color: var(--muted); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--danger { color: var(--rose); border-color: transparent; background: transparent; }
.btn--danger:hover { background: var(--clay-wash); }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ---------- Formularios ---------- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); transition: border-color .15s, background .15s;
}
.input:focus { outline: none; border-color: var(--accent-dim); background: var(--surface); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }

/* segmented control */
.segmented { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: none; background: transparent; color: var(--text-2); padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; transition: .15s; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented--accent button.on { background: var(--accent); color: var(--accent-ink); }

/* slider de energía */
.range-wrap { display: flex; align-items: center; gap: var(--sp-3); }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 6px; background: var(--border); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.range-val { font-family: var(--font-display); font-size: 22px; font-weight: 600; width: 42px; text-align: center; }

/* ---------- Editor de ejercicios en registro ---------- */
.ex-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.ex-block__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ex-block__name { font-weight: 600; font-size: 15.5px; }
.ex-block__head .badge { margin-left: 4px; }
.ex-block__del { margin-left: auto; }
.sets-head, .set-row { display: grid; grid-template-columns: 28px 1fr 1fr 1fr 32px; gap: var(--sp-2); align-items: center; }
.sets-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin-bottom: 6px; padding: 0 2px; }
.set-row { margin-bottom: 6px; }
.set-row .set-idx { font-family: var(--font-display); color: var(--muted); text-align: center; font-size: 14px; }
.set-row .input { padding: 9px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.set-del { background: none; border: none; color: var(--muted); font-size: 18px; }
.set-del:hover { color: var(--rose); }

/* ---------- Picker de ejercicios ---------- */
.picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.picker button { padding: 8px 13px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; transition: .15s; }
.picker button:hover { border-color: var(--accent-dim); color: var(--text); }

/* ---------- Biblioteca ---------- */
.lib-filters { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.lib-filters button { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.lib-filters button.on { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.ex-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4); }
.ex-card__top { display: flex; align-items: flex-start; gap: var(--sp-2); justify-content: space-between; }
.ex-card__name { font-family: var(--font-display); font-size: 18px; font-weight: 500; line-height: 1.2; }
.ex-card__star { color: var(--accent); font-size: 14px; }
.ex-card__meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ex-card__risk { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.ex-card__last { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: var(--sp-2); }
.ex-card__last b { color: var(--text-2); font-weight: 600; }

/* ---------- Progreso / gráficos ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-5); }
.chart-card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-4); }
.chart-card__title { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.chart-card__delta { font-size: 13px; font-weight: 600; }
.delta-up { color: var(--good); }
.delta-flat { color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__empty { color: var(--muted); font-size: 13.5px; padding: var(--sp-5) 0; text-align: center; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 100%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height .5s; }
.bars__bar.is-cardio { background: var(--clay); }
.bars__lbl { font-size: 10.5px; color: var(--muted); }
.bars__val { font-size: 11px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Historial ---------- */
.hist { display: flex; flex-direction: column; gap: var(--sp-3); }
.hist__item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); display: flex; gap: var(--sp-4); align-items: center; }
.hist__date { text-align: center; flex-shrink: 0; width: 50px; }
.hist__date .d { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.hist__date .m { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.hist__body { flex: 1; min-width: 0; }
.hist__title { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hist__summary { color: var(--text-2); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.hist__sore { color: var(--warn); font-size: 12.5px; margin-top: 4px; }
.hist__actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ---------- Modal de detalle ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; padding: 0; opacity: 0; transition: opacity .2s; }
.modal-scrim.show { opacity: 1; }
@media (min-width: 620px) { .modal-scrim { align-items: center; padding: var(--sp-5); } }
.modal {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: var(--sp-5);
  transform: translateY(16px); transition: transform .22s;
}
.modal-scrim.show .modal { transform: none; }
@media (min-width: 620px) { .modal { border-radius: var(--r-xl); } }
.modal__close { float: right; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; }
.modal h2 { font-family: var(--font-display); font-weight: 500; font-size: 23px; }
.detail-ex { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-soft); }
.detail-ex:last-child { border-bottom: none; }
.detail-ex__name { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.detail-ex__sets { color: var(--text-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.detail-ex__note { color: var(--muted); font-size: 12.5px; font-style: italic; margin-top: 3px; }

/* ---------- Plan en modal ---------- */
.plan-sec { margin-top: var(--sp-4); }
.plan-sec__h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-dim); font-weight: 700; margin-bottom: 8px; }
.plan-sec__h small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.plan-warm { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-warm span { font-size: 12.5px; background: var(--surface-2); color: var(--text-2); padding: 5px 10px; border-radius: 8px; }
.plan-ex { padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.plan-ex:last-child { border-bottom: none; }
.plan-ex__name { font-weight: 600; font-size: 14.5px; display: inline; }
.plan-ex__scheme { float: right; color: var(--accent); font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plan-ex__note { color: var(--muted); font-size: 12.5px; margin-top: 3px; clear: both; }

/* card de plan en dashboard */
.plan-card__days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-4); }
.plan-day-pill { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--r-md); border: 1px solid var(--border-soft); background: var(--bg-soft); min-width: 60px; flex: 1; cursor: pointer; transition: border-color .15s; }
.plan-day-pill:hover { border-color: var(--accent-dim); }
.plan-day-pill.is-today { border-color: var(--accent); }
.plan-day-pill.is-done { background: var(--good-wash); border-color: transparent; }
.plan-day-pill__d { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.plan-day-pill__dot { width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.dot-fuerza { background: var(--good-wash); color: var(--good); }
.dot-wod { background: #281f3d; color: #b3a0e8; }
.dot-cardio { background: var(--clay-wash); color: var(--clay); }
.dot-recuperacion { background: var(--warn-wash); color: var(--warn); }
.dot-descanso { background: var(--surface-2); color: var(--muted); }
.plan-day-pill.is-done .plan-day-pill__dot { background: var(--good); color: var(--accent-ink); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--muted); }
.empty__icon { font-size: 38px; opacity: .5; }
.empty__title { font-family: var(--font-display); font-size: 19px; color: var(--text-2); margin: var(--sp-3) 0 6px; }
.empty p { font-size: 14px; max-width: 36ch; margin: 0 auto var(--sp-4); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); z-index: 80; background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 30px; font-size: 14px; font-weight: 600; opacity: 0; transition: .25s; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 940px) { .toast { bottom: 32px; } }

/* utilidades */
.muted { color: var(--muted); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.divider { height: 1px; background: var(--border-soft); margin: var(--sp-5) 0; border: none; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
