/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: #0f0c29;
  height: 100%;
}

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg-start:   #0f0c29;
  --bg-mid:     #302b63;
  --bg-end:     #24243e;
  --accent:     #a78bfa;
  --accent-dim: rgba(167,139,250,0.18);
  --text:       #e8e8f0;
  --muted:      rgba(255,255,255,0.5);
  --glass-bg:   rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.13);
  --radius:     18px;
}

/* ── Fondo animado ─────────────────────────────────────── */
body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Pantallas ─────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
  animation: fadeUp 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.screen.active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PANTALLA 1: Bienvenida ────────────────────────────── */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 32px;
  text-align: center;
}

.logo-wrap {
  margin-bottom: 8px;
}

.logo-icon {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 0 24px rgba(167,139,250,0.45));
}

.app-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #e8e8f0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ── Botón principal ───────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:active {
  transform: scale(0.96);
}

.btn-large {
  padding: 16px 40px;
  font-size: 1.1rem;
  box-shadow: 0 4px 24px rgba(167,139,250,0.4);
}

/* ── PANTALLAS 2 y 3: Flujo ────────────────────────────── */
.flow-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 48px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.btn-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  align-self: flex-start;
  padding: 4px 0;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--text); }

.flow-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.flow-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 36px;
}

/* ── Grid de días ──────────────────────────────────────── */
.days-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 380px) {
  .days-grid { grid-template-columns: repeat(3, 1fr); }
}

.day-btn {
  aspect-ratio: 1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.day-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.day-btn:active { transform: scale(0.93); }
.day-btn.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Opciones de estructura ────────────────────────────── */
.structure-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}
.option-card:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.option-card:active { transform: scale(0.98); }

.option-icon { font-size: 1.6rem; }
.option-title { font-size: 1rem; font-weight: 700; }
.option-desc  { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* ── Lista de semanas ──────────────────────────────────── */
.week-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;
}
.week-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.week-btn:active { transform: scale(0.98); }

.week-number {
  font-size: 1rem;
  font-weight: 700;
}
.week-series {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

/* ── Badge de semana activa ────────────────────────────── */
.week-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ── Pantalla ejercicios ────────────────────────────────── */
#screen-exercises {
  flex-direction: column;
}

.exercises-header {
  padding: 24px 20px 0;
  flex-shrink: 0;
}

.exercises-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  -webkit-overflow-scrolling: touch;
}

/* ── Grupo muscular ─────────────────────────────────────── */
.ex-group {
  margin-bottom: 24px;
}

.ex-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ex-group-emoji { font-size: 1.1rem; }

.ex-group-name {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Fila de ejercicio ──────────────────────────────────── */
.ex-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ex-row:active { transform: scale(0.99); }
.ex-row.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.ex-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
}
.ex-row.selected .ex-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ex-row.selected .ex-check::after { content: '✓'; }

.ex-info {
  flex: 1;
  min-width: 0;
}

.ex-name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.ex-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 1px solid var(--glass-border);
}

/* ── Footer con botón confirmar ─────────────────────────── */
.exercises-footer {
  padding: 12px 20px 28px;
  flex-shrink: 0;
  background: linear-gradient(to top, rgba(15,12,41,0.95) 60%, transparent);
}

.btn-confirm {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  border-radius: 14px;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-confirm:not(:disabled):active { transform: scale(0.98); }

/* ── Pantalla resumen ───────────────────────────────────── */
#screen-summary { flex-direction: column; }

.summary-header {
  padding: 24px 20px 0;
  flex-shrink: 0;
}

.summary-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.summary-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.summary-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--glass-border);
}
.summary-stat:last-child { border-bottom: none; }

.summary-stat-label { font-size: 0.88rem; color: var(--muted); }
.summary-stat-value { font-size: 0.92rem; font-weight: 700; color: var(--text); }

.summary-day-block { margin-bottom: 10px; }
.summary-day-block:last-child { margin-bottom: 0; }

.summary-day-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.summary-ex-pill {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  margin: 3px 3px 3px 0;
  color: var(--text);
}

/* ── Dashboard principal ────────────────────────────────── */
#screen-dashboard { flex-direction: column; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}

.dashboard-greeting { font-size: 1.3rem; font-weight: 800; }
.dashboard-subtitle { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

.dashboard-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.dashboard-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.dashboard-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.train-btn {
  width: 100%;
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(167,139,250,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.train-btn:active {
  transform: scale(0.97);
  box-shadow: none;
}

.extra-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.extra-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.extra-btn:hover { background: var(--accent-dim); border-color: var(--accent); }
.extra-btn:active { transform: scale(0.96); }
.extra-btn-icon { font-size: 1.6rem; }

.btn-profile-icon {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-profile-icon:hover { background: var(--accent-dim); border-color: var(--accent); }

/* ── Perfil ─────────────────────────────────────────────── */
#screen-profile { flex-direction: column; }

.profile-header {
  padding: 24px 20px 0;
  flex-shrink: 0;
}

.profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 auto 16px;
  text-transform: uppercase;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.profile-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.profile-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.profile-input:focus { border-color: var(--accent); }
.profile-input::placeholder { color: var(--muted); }
/* Quitar flechas en inputs number */
.profile-input::-webkit-inner-spin-button,
.profile-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.profile-input-unit {
  position: relative;
  display: flex;
  align-items: center;
}
.profile-input-unit .profile-input { padding-right: 36px; }
.profile-unit {
  position: absolute;
  right: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  pointer-events: none;
}

.profile-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn-save-profile {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.records-section { display: flex; flex-direction: column; gap: 12px; }

.records-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 32px 0;
}

/* ── Tarjeta de récord ──────────────────────────────────── */
.record-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.record-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.record-ex-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  margin-right: 8px;
}

.record-max {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.record-max-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  margin-top: 1px;
}

/* ── Gráfica SVG ────────────────────────────────────────── */
.chart-wrap { width: 100%; overflow: hidden; }

.chart-svg {
  width: 100%;
  height: 70px;
  display: block;
}

.chart-area {
  fill: url(#chartGrad);
  opacity: 0.18;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--accent);
}

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}
.chart-axis-label {
  font-size: 0.62rem;
  color: var(--muted);
}

/* ── Config defaults ─────────────────────────────────────── */
.timer-config-list { display: flex; flex-direction: column; gap: 12px; }

.timer-config-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.timer-config-name { font-size: 0.88rem; font-weight: 600; }

.cfg-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cfg-field {
  display: flex;
  align-items: center;
  gap: 5px;
}

.timer-config-input {
  width: 60px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.timer-config-input:focus { border-color: var(--accent); }
.timer-config-input::-webkit-inner-spin-button,
.timer-config-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.timer-config-unit { font-size: 0.78rem; color: var(--muted); }

/* ── Pantalla workout ───────────────────────────────────── */
#screen-workout { flex-direction: column; }

.workout-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}

.workout-meta { flex: 1; min-width: 0; }
.workout-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }

.workout-prog-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workout-prog-bar {
  flex: 1;
  height: 6px;
  background: var(--glass-border);
  border-radius: 3px;
  overflow: hidden;
}

.workout-prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.workout-prog-text {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.workout-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 8px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workout-footer {
  padding: 10px 16px 28px;
  flex-shrink: 0;
  background: linear-gradient(to top, rgba(15,12,41,0.95) 60%, transparent);
}

/* ── Tarjeta de ejercicio ───────────────────────────────── */
.wk-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}
.wk-card.all-done { border-color: rgba(134,239,172,0.4); }

.wk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wk-card-left { flex: 1; min-width: 0; }
.wk-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wk-card-count {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}
.wk-card-count.done-all { color: #86efac; }

.wk-chevron {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 8px;
  transition: transform 0.2s;
}
.wk-card.expanded .wk-chevron { transform: rotate(180deg); }

/* ── Series rows ────────────────────────────────────────── */
.wk-series-wrap {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wk-serie-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.wk-serie-row.done {
  background: rgba(134,239,172,0.07);
  border-color: rgba(134,239,172,0.25);
}

.wk-serie-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 22px;
}
.wk-serie-row.done .wk-serie-num { color: #86efac; }

.wk-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

/* Input de serie */
.wk-input {
  width: 52px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.wk-input:focus { border-color: var(--accent); }
.wk-input::-webkit-inner-spin-button,
.wk-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.wk-serie-row.done .wk-input { opacity: 0.6; }

.wk-input-label {
  font-size: 0.68rem;
  color: var(--muted);
  margin-left: -3px;
}

/* Toggle +/- peso */
.wk-dir-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.wk-dir-btn.pos { background: rgba(134,239,172,0.18); color: #86efac; }
.wk-dir-btn.neg { background: rgba(251,191,36,0.18);  color: #fbbf24; }

/* Botón cronómetro */
.wk-timer-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.wk-timer-btn:active { background: rgba(167,139,250,0.3); }

/* Botón ✓ */
.wk-done-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}
.wk-done-btn:hover { border-color: #86efac; color: #86efac; }
.wk-serie-row.done .wk-done-btn {
  background: rgba(134,239,172,0.2);
  border-color: #86efac;
  color: #86efac;
}

/* Badge récord */
.wk-record-badge {
  font-size: 0.65rem;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.4);
  color: #fbbf24;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* ── Modal cronómetro / finalizar ───────────────────────── */
.timer-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.timer-modal.hidden { display: none; }

.timer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.timer-box {
  position: relative;
  z-index: 1;
  background: #1e1b38;
  border: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.28s cubic-bezier(0.4,0,0.2,1);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.timer-ex-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.timer-series-lbl { font-size: 0.78rem; color: var(--muted); margin-top: -10px; }

.timer-adjust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.timer-adj {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.timer-adj:hover { background: var(--accent-dim); border-color: var(--accent); }

.timer-display {
  font-size: 3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 2px;
  min-width: 120px;
}
.timer-display.running { color: #86efac; }
.timer-display.finished { color: #f87171; }

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timer-toggle-btn {
  flex: 1;
  max-width: 160px;
  padding: 13px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.timer-reset-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 13px 18px;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
}
.timer-reset-btn:hover { background: var(--accent-dim); }

.timer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

/* ── Modal finalizar ────────────────────────────────────── */
.finish-icon { font-size: 2.8rem; }
.finish-title { font-size: 1.3rem; font-weight: 800; }
.finish-summary {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Extras: Correr y Yoga ──────────────────────────────── */
#screen-run, #screen-yoga { flex-direction: column; }

.extra-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.extra-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.run-time-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-time-input {
  flex: 1;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 10px 8px;
  font-variant-numeric: tabular-nums;
}

.run-time-sep {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--muted);
}

.pace-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  animation: fadeUp 0.2s ease;
}
.pace-display.hidden { display: none; }

.pace-label { font-size: 0.8rem; color: var(--muted); }
.pace-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.pace-unit  { font-size: 0.8rem; color: var(--muted); }

/* ── Calendario ─────────────────────────────────────────── */
#screen-calendar { flex-direction: column; }

.cal-header {
  padding: 24px 20px 0;
  flex-shrink: 0;
}

.cal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-nav-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--accent-dim); border-color: var(--accent); }

.cal-month-label {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: capitalize;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 4px;
}
.cal-weekdays span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: default;
  position: relative;
  border: 1px solid transparent;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-cell.empty { cursor: default; }
.cal-cell.today {
  border-color: var(--glass-border);
  font-weight: 800;
  color: var(--text);
}
.cal-cell.trained {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.cal-cell.record {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  font-weight: 700;
  cursor: pointer;
}
.cal-cell.extra {
  background: rgba(52,211,153,0.12);
  color: #34d399;
  font-weight: 700;
  cursor: pointer;
}
/* Si tiene record Y es extra, record gana */
.cal-cell.record.extra { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* Punto indicador debajo del número */
.cal-cell.trained::after,
.cal-cell.record::after,
.cal-cell.extra::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.cal-cell.selected {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ── Leyenda ────────────────────────────────────────────── */
.cal-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cal-dot.trained { background: var(--accent); }
.cal-dot.record  { background: #fbbf24; }
.cal-dot.extra   { background: #34d399; }

/* ── Detalle del día ────────────────────────────────────── */
.cal-day-detail {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeUp 0.2s ease;
}
.cal-day-detail.hidden { display: none; }

.cal-detail-date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.cal-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.cal-entry-icon { font-size: 1rem; }
.cal-entry-text { flex: 1; color: var(--text); }
.cal-entry-badge {
  font-size: 0.65rem;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.4);
  color: #fbbf24;
  border-radius: 6px;
  padding: 2px 6px;
}

/* ── Editar mesociclo ────────────────────────────────────── */
.btn-edit-meso {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
  opacity: 0.8;
  letter-spacing: 0.02em;
}
.btn-edit-meso:hover { opacity: 1; }

.meso-edit-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 10px;
  text-align: left;
  transition: background 0.15s;
}
.meso-edit-opt:hover { background: rgba(255,255,255,0.12); }
.meso-edit-opt.danger { color: #f87171; border-color: rgba(248,113,113,0.3); }
.meso-edit-opt.danger:hover { background: rgba(248,113,113,0.1); }
.meso-edit-icon { font-size: 1.2rem; }

/* ── Login ───────────────────────────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  transition: opacity 0.15s;
}
.btn-google:hover { opacity: 0.9; }

/* ── Cerrar sesión ───────────────────────────────────────── */
.btn-signout {
  width: 100%;
  background: none;
  border: 1px solid rgba(248,113,113,0.35);
  border-radius: 12px;
  color: #f87171;
  font-size: 0.9rem;
  padding: 12px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}
.btn-signout:hover { background: rgba(248,113,113,0.1); }
