:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: #211f19;
  background: #f5f4ef;
  --ink: #211f19;
  --muted: #666257;
  --line: #e9e5da;
  --gold: #dbc541;
  --gold-hover: #eed653;
  --green: #1e6349;
  --red: #902f27;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid #89760c; outline-offset: 3px; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 224px; padding: 30px 17px 19px; background: #201e19; color: #f6f3e9; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 27px; font-weight: 800; letter-spacing: .085em; line-height: 1; }
.brand small { display: block; margin-top: 6px; color: #d3caa9; font-size: .66rem; letter-spacing: .27em; font-weight: 650; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: 1.35rem; letter-spacing: 0; }
.sidebar nav { display: grid; gap: 3px; padding-bottom: 8px; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 9px 12px; color: #d6d0be; border-radius: 8px; font-size: .88rem; font-weight: 550; }
.sidebar nav a span { width: 16px; font-size: 1.06rem; text-align: center; color: #b8ad8a; }
.sidebar nav a:hover { background: #302d24; }
.sidebar nav a[aria-current] { background: #393326; color: #fff4af; }
.sidebar nav a[aria-current] span { color: var(--gold); }
.sidebar-foot { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px 7px 0; border-top: 1px solid #3e3a30; font-size: .82rem; }
.sidebar-foot small { display: block; margin-top: 3px; color: #c3bda8; }
.center-mark { width: 31px; height: 31px; border-radius: 50%; background: #383529; display: grid; place-items: center; color: #edde89; }
.workspace { margin-left: 224px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 34px; min-height: 65px; background: #fff; border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.top-date { font-size: .85rem; color: var(--muted); }
.top-date::first-letter { text-transform: uppercase; }
.test-flag { display: inline-flex; gap: 8px; align-items: center; padding: 7px 11px; border-radius: 20px; background: #fbf4d1; color: #614b07; border: 1px solid #eee2a5; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.test-flag:hover { background: #f8edb5; }
.test-flag span, .status span { display: inline-block; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
main { max-width: 1560px; margin-inline: auto; padding: 30px 34px 48px; }
.initial { color: var(--muted); }
.view-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 3.5vw, 2.4rem); letter-spacing: -.045em; line-height: 1.12; }
.view-head p { color: var(--muted); margin-top: 7px; font-size: .92rem; }
h2 { font-size: 1.04rem; letter-spacing: -.016em; }
h3 { font-size: .92rem; margin-top: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; border: 1px solid #ddd8ca; border-radius: 8px; background: #fff; color: #302d23; padding: 9px 14px; min-height: 38px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.button:hover { background: #f7f5ee; border-color: #c8c0ad; }
.button.primary { background: var(--gold); border-color: #c5ae2e; color: #25210e; }
.button.primary:hover { background: var(--gold-hover); }
.button.small { min-height: 30px; padding: 5px 9px; font-size: .77rem; }
.button.danger { color: var(--red); border-color: #e4c7c1; }
.button.danger:hover { background: #fdf1ee; }
.text-button { padding: 0; color: #443a15; border: none; background: none; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; text-align: left; }
.forward { color: #6d5712; font-size: .79rem; font-weight: 650; }
.forward:hover { text-decoration: underline; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 21px; }
.metric { display: grid; gap: 9px; min-height: 114px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 17px; }
.metric:hover { border-color: #d5c67b; }
.metric strong { font-size: 1.77rem; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-name { color: #4a4539; font-weight: 620; font-size: .82rem; }
.metric-note, .muted { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.stack { display: grid; gap: 17px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 56px; border-bottom: 1px solid var(--line); padding: 12px 17px; }
.card-content { padding: 17px; }
.slot-list { padding: 2px 17px 7px; }
.slot { display: grid; grid-template-columns: minmax(100px, auto) minmax(48px, 1fr) auto auto; align-items: center; gap: 13px; min-height: 43px; border-bottom: 1px solid #f1eee6; }
.slot:last-child { border-bottom: 0; }
.slot-time { font-weight: 680; font-variant-numeric: tabular-nums; font-size: .86rem; white-space: nowrap; }
.slot-time span { margin-left: 5px; font-weight: 450; color: var(--muted); }
.slot progress { appearance: none; border: 0; border-radius: 12px; overflow: hidden; height: 6px; width: 100%; background: #efede4; }
.slot progress::-webkit-progress-bar { background: #efede4; }
.slot progress::-webkit-progress-value { background: #c4aa36; }
.slot progress::-moz-progress-bar { background: #c4aa36; }
.place-count { min-width: 42px; text-align: right; color: #635d4f; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed { padding: 0 17px; }
.feed-item { display: flex; justify-content: space-between; gap: 9px; padding: 12px 0; border-bottom: 1px solid #f1eee6; font-size: .85rem; }
.feed-item:last-child { border: 0; }
.feed-item small, .feed-item time { color: var(--muted); font-size: .73rem; }
.feed-item small { display: block; margin-top: 4px; }
.feed-item time { white-space: nowrap; }
.empty { padding: 27px 18px; font-size: .88rem; color: var(--muted); line-height: 1.45; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th, td { padding: 10px 13px; border-bottom: 1px solid #efede7; text-align: left; vertical-align: middle; }
th { background: #faf9f5; color: #666051; font-size: .76rem; font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td strong { font-weight: 650; }
td small.cell-note { display: block; color: var(--muted); margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 4px 8px; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.status.active { color: var(--green); background: #eaf5ed; }
.status.grace, .status.pending { color: #785411; background: #fbf2d6; }
.status.closed { color: #5e5a50; background: #eeece6; }
.status.unpaid, .status.suspended { color: var(--red); background: #faebe7; }
input, select, textarea { min-width: 0; min-height: 37px; border: 1px solid #d7d2c3; border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--ink); font-size: .86rem; }
textarea { resize: vertical; min-height: 72px; }
.search { width: min(260px, 100%); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: .83rem; color: #454031; font-weight: 630; }
.form label.check { display: flex; align-items: center; gap: 8px; }
.form .check input { min-height: auto; width: 15px; height: 15px; accent-color: #8e731a; margin: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 15px; }
.fields .wide { grid-column: 1 / -1; }
.form p { font-size: .87rem; line-height: 1.45; }
.form-actions, .inline-actions, .settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions { justify-content: flex-end; margin-top: 6px; }
.form-error { color: var(--red); font-weight: 600; }
.form-error:empty { display: none; }
.access-result { display: grid; gap: 5px; border-radius: 8px; padding: 13px; font-size: .87rem; }
.access-result.allowed { color: var(--green); background: #eaf5ed; }
.access-result.denied { color: var(--red); background: #faebe7; }
dialog { border: 1px solid #e4ddcb; border-radius: 13px; padding: 0; width: min(625px, calc(100vw - 24px)); max-height: calc(100vh - 34px); color: var(--ink); background: #fff; box-shadow: 0 19px 65px #1a180f42; }
dialog::backdrop { background: #2220197a; }
.sign-in { width: min(100%, 430px); margin: min(12vh, 84px) auto 0; }
.sign-in .brand-mark { margin-bottom: 14px; }
.sign-in h1 { margin-bottom: 9px; }
.sign-in .form { margin-top: 20px; }
.signed-out .sidebar, .signed-out .topbar { display: none; }
.signed-out .workspace { margin-left: 0; }
.task-list { display: grid; gap: 10px; }
.exercise-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.exercise-item .fields { margin-bottom: 7px; }
.routine-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: 8px; }
.routine-stats div { padding: 7px 8px; border-radius: 7px; background: #f7f5ee; }
.routine-stats dt { color: var(--muted); font-size: .73rem; }
.routine-stats dd { margin: 3px 0 0; font-weight: 650; font-size: .87rem; overflow-wrap: anywhere; }
.preserved-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.form-row { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.form-row label { min-width: min(100%, 145px); }
.qr-ticket { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr-ticket canvas { outline: 1px solid var(--line); }
.qr-ticket code { padding: 5px 8px; background: #f5f3eb; user-select: all; }
.dialog-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { font-size: 1.25rem; }
.icon-button { border: 0; border-radius: 6px; background: #f3f0e7; color: #444033; width: 29px; height: 29px; line-height: 1; font-size: 1.15rem; }
.dialog-content { display: grid; gap: 12px; padding: 17px 18px; }
.dialog-content .table-wrap, .form .table-wrap { border: 1px solid var(--line); border-radius: 7px; }
.member-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .83rem; }
.receipt { display: grid; gap: 12px; font-size: .88rem; }
#estimate .muted { margin-bottom: 6px; }
#toast { position: fixed; z-index: 2; right: 22px; bottom: 20px; pointer-events: none; opacity: 0; }
#toast.visible { opacity: 1; border-radius: 8px; padding: 12px 16px; background: #24221b; color: #fff; font-size: .88rem; box-shadow: 0 5px 20px #211e3033; }
#toast.error { background: #872b23; }
@media (max-width: 1050px) {
  .sidebar { width: 185px; }
  .workspace { margin-left: 185px; }
  .topbar, main { padding-inline: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sidebar { position: static; width: auto; padding: 12px 11px 8px; }
  .brand { padding: 0 3px 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 3px; }
  .sidebar nav a { flex: 0 0 auto; font-size: .79rem; padding: 7px; gap: 5px; }
  .sidebar-foot { display: none; }
  .workspace { margin-left: 0; }
  .topbar, main { padding-inline: 12px; }
  main { padding-top: 18px; }
  .view-head { align-items: center; flex-wrap: wrap; }
  .card-head { flex-wrap: wrap; }
  .view-head p { font-size: .8rem; }
  .metric { padding: 12px; min-height: 100px; }
  .metrics { gap: 9px; }
  .slot { gap: 6px; }
}
@media print {
  body { background: #fff; }
  body > :not(dialog), dialog .icon-button, .no-print { display: none !important; }
  dialog[open] { box-shadow: none; border: 0; width: 100%; max-height: none; position: static; }
  dialog::backdrop { background: transparent; }
}

/* Editor semanal del módulo de entrenamiento */
.routine-week { border:1px solid #dce3eb; border-radius:14px; padding:14px; margin:14px 0; }
.routine-week .card-head { margin-bottom:12px; }
.week-grid { display:grid; grid-template-columns:repeat(7,minmax(170px,1fr)); gap:8px; overflow-x:auto; padding-bottom:10px; }
.week-day { background:#f4f7fb; border:1px solid #e1e6ef; border-radius:10px; padding:8px; min-width:170px; }
.week-day h4 { margin:5px 0 12px; }
.week-exercise { margin:8px 0; padding:8px; background:white; border-radius:9px; }
.week-exercise label { min-width:0; font-size:.82rem; }
.week-exercise select { max-width:100%; }
.week-exercise details { margin:8px 0; }
.week-exercise details .fields { display:block; }
.week-exercise details .fields label { margin:6px 0; }
.target-picker { border:1px solid #e2e7ee; border-radius:9px; padding:12px; max-height:250px; overflow-y:auto; }
#target-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:7px; }
.delivery-channels { border:1px solid #e2e7ee; border-radius:9px; padding:12px; }
@media(max-width:900px) { .week-grid { grid-template-columns:repeat(7,minmax(165px,1fr)); } }

 dialog.routine-dialog { width:min(1450px,calc(100vw - 32px)); }
 dialog.routine-dialog .dialog-content { display:block; }
 dialog.routine-dialog .routine-week .card-head { padding-left:0; padding-right:0; }
.panel{background:white;border:1px solid var(--line);border-radius:12px;padding:18px;margin:12px 0}.product-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.product-row select{max-width:160px}.checkout{border-top:1px solid var(--line);padding:14px 0}
.web-thumbnail{object-fit:contain;background:#24251d;border-radius:6px}#web-editor details{padding:.75rem 0}#web-editor summary{cursor:pointer;font-weight:700}#web-editor textarea{width:100%;min-height:3rem}#web-editor label{display:grid;gap:.35rem;margin:.75rem 0}#web-gallery>div{border-block-end:1px solid #aaa;padding:.8rem 0}
