:root {
  --ink: #14171f;
  --ink-2: #232834;
  --ink-3: #3a4150;
  --paper: #f4f5f1;
  --card: #ffffff;
  --line: #e3e5de;
  --muted: #6b7280;
  --lime: #c6f432;
  --lime-dark: #8fb30f;
  --red: #e5484d;
  --red-bg: #fdecec;
  --amber: #b7791f;
  --amber-bg: #fdf3e1;
  --green: #2f9e5b;
  --green-bg: #e7f6ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 23, 31, .06), 0 4px 16px rgba(20, 23, 31, .05);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; line-height: 1.1; margin: 0; }
h1 { font-size: 34px; font-weight: 800; text-transform: uppercase; }
h2 { font-size: 24px; font-weight: 700; text-transform: uppercase; }
h3 { font-size: 18px; font-weight: 700; text-transform: uppercase; }

/* ---------- Boot / logo ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--lime); color: var(--ink);
  font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .02em;
}
.boot .logo-mark { width: 72px; height: 72px; font-size: 34px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--ink);
}
.login-hero {
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(198, 244, 50, .18), transparent 45%),
    repeating-linear-gradient(-55deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px),
    var(--ink);
}
.login-hero h1 { font-size: clamp(44px, 6vw, 84px); line-height: .92; }
.login-hero h1 em { font-style: normal; color: var(--lime); }
.login-hero p { color: #b8bdc8; max-width: 380px; }
.login-panel { background: var(--paper); display: grid; place-items: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-box h2 { font-size: 30px; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 20px; min-height: 240px; }
}

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo-mark { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
.brand span { font-family: var(--display); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; padding: 8px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: #b8bdc8;
}
.nav a:hover { color: #fff; background: var(--ink-2); }
.nav a.active { color: var(--ink); background: var(--lime); }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #b8bdc8; }
.main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .brand span { display: none; }
  .user .who { display: none; }
  .main { padding: 20px 16px 80px; }
  h1 { font-size: 28px; }
}

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--ink); color: #fff; transition: transform .05s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.lime:hover { background: #d4ff4a; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.dark-ghost { background: transparent; color: #b8bdc8; border-color: var(--ink-3); padding: 7px 12px; }
.btn.dark-ghost:hover { color: #fff; }
.btn.danger { background: var(--red); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }

.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(198, 244, 50, .55); }
textarea.input { min-height: 84px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.field .hint { font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .g3, .g4 { grid-template-columns: 1fr 1fr; } .g2.stack { grid-template-columns: 1fr; } }
.span-all { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on.warn { background: var(--red); border-color: var(--red); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: #eef0ea; color: var(--ink-3); white-space: nowrap;
}
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.lime { background: var(--lime); color: var(--ink); }
.tag.dark { background: var(--ink); color: #fff; }

/* ---------- Cards / lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.section { display: grid; gap: 14px; }
.section + .section { margin-top: 24px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; flex: 1 1 180px; }
.toolbar .search { flex: 3 1 240px; }

.client-list { display: grid; gap: 10px; }
.client-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; text-decoration: none; transition: border-color .15s, transform .1s;
}
.client-row:hover { border-color: var(--ink-3); }
.avatar {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ink); color: var(--lime); font-family: var(--display); font-weight: 800; font-size: 20px;
}
.avatar.lg { width: 64px; height: 64px; font-size: 28px; border-radius: 16px; }
.client-row .name { font-weight: 700; }
.client-row .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 560px) { .client-row { grid-template-columns: 46px 1fr; } .client-row .right { grid-column: 2; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .v small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 500; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--lime-dark); }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.red { background: var(--red-bg); color: #9b1c1f; }
.alert.amber { background: var(--amber-bg); color: #7a4f0f; }
.alert.green { background: var(--green-bg); color: #1d6b3c; }
.alert.info { background: #eef0ea; color: var(--ink-3); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---------- Exercises ---------- */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ex-card { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; padding: 0; transition: border-color .15s, transform .1s; }
.ex-card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.ex-thumb {
  aspect-ratio: 16 / 9; background: var(--ink); position: relative; display: grid; place-items: center;
  color: var(--lime); font-family: var(--display); font-size: 40px; font-weight: 800; overflow: hidden;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-thumb .noimg { opacity: .9; background: repeating-linear-gradient(-55deg, var(--ink) 0 14px, var(--ink-2) 14px 15px); width: 100%; height: 100%; display: grid; place-items: center; }
.ex-thumb .badge { position: absolute; top: 8px; left: 8px; }
.ex-thumb .play { position: absolute; bottom: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 12px; }
.ex-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.ex-body .t { font-weight: 700; line-height: 1.25; }
.ex-body .s { font-size: 12px; color: var(--muted); }
.ex-card.excluded { opacity: .55; }

.video-wrap { aspect-ratio: 16 / 9; background: var(--ink); border-radius: 12px; overflow: hidden; }
.video-wrap iframe, .video-wrap video { width: 100%; height: 100%; border: 0; display: block; }
.video-empty { aspect-ratio: 16 / 9; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 16px; }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
ol.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 8px; background: var(--lime); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
ul.bul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .cols2 { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 23, 31, .55); z-index: 50; display: grid; place-items: start center; overflow-y: auto; padding: 40px 16px; }
.modal { width: 100%; max-width: 560px; background: var(--paper); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .15s ease-out; }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; display: grid; gap: 18px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--paper); border-radius: 0 0 18px 18px; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px; }
fieldset.group { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; display: grid; gap: 14px; background: #fff; }
fieldset.group legend { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 16px; padding: 0 6px; }
@media (max-width: 560px) { .overlay { padding: 0; } .modal { border-radius: 0; min-height: 100vh; } }

.parq { display: grid; gap: 8px; }
.parq-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.parq-row:last-child { border-bottom: 0; }
.yn { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.yn button { border: 0; background: #fff; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.yn button.on.si { background: var(--red); color: #fff; }
.yn button.on.no { background: var(--ink); color: #fff; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 99; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.error { background: var(--red); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ---------- Programación semanal ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { min-height: 150px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--lime-dark); box-shadow: 0 0 0 2px var(--lime); }
.day-h { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 2px 2px 4px; }
.ses { background: var(--ink); color: #fff; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; width: 100%; }
.ses:hover { background: var(--ink-2); }
.ses .t { font-weight: 700; font-size: 13px; line-height: 1.25; }
.ses ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: #b8bdc8; display: grid; gap: 2px; }
.ses.completada { background: #1f3b2b; }
.add-day { margin-top: auto; border: 1px dashed var(--line); background: none; border-radius: 10px; padding: 6px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.add-day:hover { border-color: var(--ink-3); color: var(--ink); }
@media (max-width: 960px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } .add-day { margin-top: 0; } }
.ses-ex { padding: 14px; display: grid; gap: 12px; box-shadow: none; }
.ex-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ex-fields .field > label { font-size: 11px; }
.span2 { grid-column: span 2; }
@media (max-width: 720px) { .span2 { grid-column: 1 / -1; } }

/* ---------- App del cliente ---------- */
.main.narrow { max-width: 720px; }
.week-strip { display: grid; grid-template-columns: 28px repeat(7, minmax(0, 1fr)) 28px; gap: 4px; margin-bottom: 18px; align-items: stretch; }
.ws-nav { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; border-radius: 8px; }
.ws-nav:hover { background: #fff; color: var(--ink); }
.ds { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 0 6px; display: grid; justify-items: center; gap: 2px; cursor: pointer; }
.ds span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.ds strong { font-family: var(--display); font-size: 22px; line-height: 1; }
.ds.today { border-color: var(--lime-dark); }
.ds.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ds.on span { color: #b8bdc8; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.dot.has { background: var(--amber); }
.dot.done { background: var(--lime-dark); }
.ds.on .dot.has { background: var(--lime); }
.ses-cli { display: grid; gap: 10px; padding: 18px; text-decoration: none; margin-bottom: 12px; }
.ses-cli:hover { border-color: var(--ink-3); }
.progress { height: 6px; background: #eef0ea; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--lime-dark); border-radius: 99px; transition: width .3s; }
.ses-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.ses-list li::before { content: '▸ '; color: var(--lime-dark); }
.ex-cli { padding: 16px; display: grid; gap: 10px; }
.presc { font-size: 14px; font-weight: 600; background: #eef0ea; border-radius: 8px; padding: 8px 10px; }
.sgrid { display: grid; grid-template-columns: 44px 1fr 1fr 1fr 48px; gap: 8px; align-items: center; }
.sgrid.nokg { grid-template-columns: 44px 1fr 1fr 48px; }
.sgrid.head span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.sgrid .input { text-align: center; padding: 10px 4px; font-weight: 600; font-size: 16px; }
.sgrid .input:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; }
.sgrid .sn { text-align: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.sgrid.done { background: var(--green-bg); border-radius: 10px; }
.tick { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 18px; font-weight: 800; color: var(--muted); cursor: pointer; }
.sgrid.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.rest { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 40; width: min(520px, calc(100vw - 32px)); background: var(--ink); color: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.rest.fin { background: var(--green); }
.rest-bar { height: 4px; background: var(--ink-3); }
.rest-bar span { display: block; height: 100%; background: var(--lime); transition: width .25s linear; }
.rest-body { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 12px; }
.rest-t { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rpe { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 0; font-weight: 700; cursor: pointer; }
.rpe button.on { background: var(--ink); color: var(--lime); border-color: var(--ink); }
@media (max-width: 420px) { .rpe { grid-template-columns: repeat(5, 1fr); } .sgrid { grid-template-columns: 34px 1fr 1fr 1fr 44px; gap: 6px; } }

/* ---------- Invitaciones y alta ---------- */
label.card.sel { border-color: var(--ink); background: #fbfcf7; box-shadow: 0 0 0 2px var(--lime) !important; }
.inv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.inv-row:last-child { border-bottom: 0; }
.inv-link { background: var(--ink); color: var(--lime); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.inv-link code { font-size: 13px; white-space: nowrap; }
.btn.wa { background: #25d366; color: #fff; }
.btn.wa:hover { background: #1fbd5a; }
.steps-mini { display: flex; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.steps-mini span { padding: 4px 8px; border-radius: 6px; background: #eef0ea; }
.steps-mini span.on { background: var(--ink); color: var(--lime); }

/* ---------- Editor de entrenamiento (página propia) ---------- */
.editor-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #e9ebe4; }
.editor-top { background: #14171f; color: #fff; display: flex; align-items: center; gap: 20px; padding: 14px 22px; flex-wrap: wrap; box-shadow: 0 2px 12px rgba(0,0,0,.2); z-index: 2; }
.editor-back { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.editor-back:hover { background: rgba(255,255,255,.16); }
.editor-title { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.editor-title h1 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-size: 30px; line-height: 1.05; color: #fff; }
.editor-kicker { color: #c6f432; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.editor-sub { color: rgba(255,255,255,.65); font-size: 13px; text-transform: capitalize; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); gap: 16px; padding: 16px; }
.panel { background: var(--paper); border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--line); }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.panel-h strong { display: block; font-size: 16px; }
.panel-h span:not(.panel-n) { font-size: 12px; color: var(--muted); }
.panel-n { width: 30px; height: 30px; border-radius: 50%; background: #14171f; color: #c6f432; display: grid; place-items: center; font-weight: 800; flex: none; }
.panel-lib .panel-n { background: #c6f432; color: #14171f; }
.panel-b { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 16px; align-content: start; }
.panel-lib { background: #f1f2ed; }
.picker-head { padding: 14px 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); background: #fff; }
.picker-filtros { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.picker-filtros .input { padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.picker-list { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 8px; align-content: start; }
.pick { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.pick.warn { border-color: #f1b4b4; }
.pick-img { width: 96px; height: 54px; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: #14171f; color: #c6f432; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-body { min-width: 0; cursor: pointer; }
.pick-body .t { font-weight: 600; font-size: 14px; }
.pick-body .s { font-size: 12px; color: var(--muted); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-add { font-size: 20px; line-height: 1; width: 40px; height: 40px; padding: 0; }
@media (max-width: 900px) {
  .editor-page { height: auto; min-height: 100vh; }
  .editor-cols { grid-template-columns: 1fr; }
  .panel, .panel-b, .picker-list { overflow: visible; }
}

/* ---------- Bloques de entrenamiento ---------- */
.bloque { background: #fff; border: 1px solid var(--line); border-left: 6px solid #9aa0aa; border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.bloque.activo { box-shadow: 0 0 0 2px #c6f432; }
.bloque.fmt-series { border-left-color: #14171f; }
.bloque.fmt-emom, .bloque-cli.fmt-emom { border-left-color: #2f80ed; }
.bloque.fmt-amrap, .bloque-cli.fmt-amrap { border-left-color: #e8590c; }
.bloque.fmt-for_time, .bloque-cli.fmt-for_time { border-left-color: #c2255c; }
.bloque.fmt-tabata, .bloque-cli.fmt-tabata { border-left-color: #7048e8; }
.bloque.fmt-circuito, .bloque-cli.fmt-circuito { border-left-color: #2b8a3e; }
.bloque.fmt-libre, .bloque-cli.fmt-libre { border-left-color: #9aa0aa; }
.bloque-h { display: grid; grid-template-columns: auto 1fr 190px auto; gap: 8px; align-items: center; }
.bloque-letra { width: 32px; height: 32px; border-radius: 8px; background: #14171f; color: #c6f432; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.bloque-nombre { font-weight: 600; }
.bloque-cfg { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.bloque-cfg .field { width: 120px; }
.bloque-cfg:empty { display: none; }
.bloque-resumen { margin-left: auto; background: #14171f; color: #c6f432; font-weight: 700; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.bloque .ses-ex { background: #fafbf8; }
.bloque-destino { font-size: 12px; font-weight: 600; color: #4d6b00; background: #f2fbd6; border-radius: 8px; padding: 8px 10px; }
.sm-select { width: auto; padding: 5px 8px; font-size: 12px; }
.nuevo-bloque { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.bloque-cli { background: #fff; border: 1px solid var(--line); border-left: 6px solid #14171f; border-radius: 14px; padding: 12px 14px; margin: 14px 0 8px; }
.ex-cli.compacto { padding: 10px 14px; gap: 4px; }
@media (max-width: 640px) { .bloque-h { grid-template-columns: auto 1fr; } .bloque-fmt { grid-column: 1 / -1; } }
