/* ── Variables ── */
:root {
  --sidebar-w: 220px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active-bg: rgba(59,130,246,.12);
  --sidebar-active: #60a5fa;
  --brand-bg: #1e3a5f;

  --primary: #3b82f6;
  --primary-d: #2563eb;
  --success: #22c55e;
  --success-d: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
textarea { resize: vertical; }

/* ── Login ── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a6e 100%);
  padding: 1rem;
}
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.login-title { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.login-sub { font-size: 13px; color: var(--text-2); }

/* ── Overlay (change password) ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.overlay-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.overlay-icon { font-size: 40px; margin-bottom: 1rem; }
.overlay-card h2 { font-size: 20px; font-weight: 600; margin-bottom: .5rem; }

/* ── App layout ── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-top { flex: 1; }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: .5rem;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-brand-name { color: #e2e8f0; font-size: 16px; font-weight: 600; }
.sidebar-nav { padding: .5rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 400;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #cbd5e1; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 500; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-bottom {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-name { color: #94a3b8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: none;
  border: none;
  color: #64748b;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color .15s;
}
.btn-logout:hover { color: #ef4444; }

/* ── Content area ── */
.content-area {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.view { padding: 1.75rem 2rem; min-height: 100%; }
.view.hidden { display: none; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 8px;
}
.page-header h1 { font-size: 22px; font-weight: 600; color: var(--text); }
.page-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.phase-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.stat-card-success { border-left: 3px solid var(--success); }
.stat-label { font-size: 12px; color: var(--text-2); margin-bottom: .35rem; font-weight: 400; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--text); }
.stat-delta { font-size: 12px; color: var(--success); margin-top: 2px; }

/* ── Forms ── */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.hint { font-weight: 400; font-size: 11px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Alerts ── */
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideIn .2s ease;
}
.toast-success { background: #15803d; color: #fff; }
.toast-error { background: #b91c1c; color: #fff; }
.toast-info { background: var(--text); color: #fff; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Progress bar ── */
.progress-bar-wrap {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-label { font-size: 13px; color: var(--success-d); font-weight: 500; }

/* ── Charts ── */
.chart-wrap {
  position: relative;
  height: 260px;
  margin-top: 0.5rem;
}

/* ── View grid (two cols) ── */
.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Session list items ── */
.session-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.session-item:last-child { border-bottom: none; }
.session-main { flex: 1; }
.session-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.session-date { font-size: 13px; color: var(--text-2); }
.session-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.type-Baloncesto { background: #dbeafe; color: #1d4ed8; }
.type-Explosividad { background: #fee2e2; color: #b91c1c; }
.type-Cardio { background: #dcfce7; color: #15803d; }
.type-Fuerza { background: #ede9fe; color: #6d28d9; }
.type-Movilidad { background: #f3e8ff; color: #7e22ce; }
.type-Fuerza\+Cardio { background: #fef3c7; color: #92400e; }
.type-Otro { background: #f1f5f9; color: #475569; }
.session-exercises { font-size: 12px; color: var(--text-2); white-space: pre-line; margin-top: 2px; }
.session-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.session-actions { flex-shrink: 0; }

/* ── Entry list items (weight/jump) ── */
.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.entry-item:last-child { border-bottom: none; }
.entry-main { display: flex; align-items: center; gap: 12px; }
.entry-date { font-size: 13px; color: var(--text-2); min-width: 90px; }
.entry-value { font-size: 16px; font-weight: 600; color: var(--text); }
.entry-notes { font-size: 12px; color: var(--text-3); }
.entry-delta { font-size: 11px; margin-left: 6px; }
.delta-pos { color: var(--danger); }
.delta-neg { color: var(--success); }
.delta-jump-pos { color: var(--success); }
.delta-jump-neg { color: var(--danger); }

/* ── Achievements ── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.achievement-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  text-align: center;
  transition: transform .15s;
}
.achievement-card.unlocked {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
}
.achievement-card.unlocked:hover { transform: translateY(-2px); }
.achievement-emoji { font-size: 32px; margin-bottom: .5rem; display: block; }
.achievement-card.locked .achievement-emoji { filter: grayscale(1); opacity: .4; }
.achievement-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.achievement-card.locked .achievement-title { color: var(--text-3); }
.achievement-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.achievement-card.locked .achievement-desc { color: var(--text-3); }
.achievement-progress { font-size: 11px; color: var(--primary); margin-top: 6px; font-weight: 500; }
.achievement-unlocked-date { font-size: 11px; color: #d97706; margin-top: 6px; font-weight: 500; }
.achievements-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ach-count { font-size: 28px; font-weight: 700; color: var(--primary); }
.ach-count-label { font-size: 13px; color: var(--text-2); }

/* ── Dashboard weekly schedule ── */
.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}
.week-day {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
}
.week-day.today {
  border-color: var(--primary);
  background: #eff6ff;
}
.week-day-name { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; }
.week-day.today .week-day-name { color: var(--primary); }
.week-day-icon { font-size: 16px; margin: 4px 0; display: block; }
.week-day-label { font-size: 10px; color: var(--text-2); line-height: 1.2; }
.week-day.today .week-day-label { color: var(--primary); font-weight: 500; }

/* ── Dashboard today card ── */
.today-card {
  background: linear-gradient(135deg, #1e3a5f, #1e40af);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.today-icon { font-size: 36px; }
.today-info { flex: 1; }
.today-label { font-size: 12px; opacity: .75; margin-bottom: .2rem; }
.today-workout { font-size: 18px; font-weight: 600; }
.today-time { font-size: 13px; opacity: .8; margin-top: 2px; }

/* ── Recent sessions (dashboard) ── */
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.recent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.recent-text { flex: 1; font-size: 13px; color: var(--text); }
.recent-meta { font-size: 12px; color: var(--text-3); }

/* ── Phase selector in dashboard ── */
.phase-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.phase-control label { font-size: 13px; color: var(--text-2); }
.phase-control select { width: auto; }

/* ── Empty / loading states ── */
.empty-state { text-align: center; color: var(--text-3); font-size: 13px; padding: 2rem 0; }
.loading-state { text-align: center; color: var(--text-3); font-size: 13px; padding: 3rem 0; }

/* ── Utility ── */
.hidden { display: none !important; }
.text-muted { color: var(--text-2); font-size: 13px; line-height: 1.5; margin-bottom: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.gap-half { gap: .5rem; }

/* ── Training plan cards ── */
.training-plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.training-plan-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.07); }
.tpc-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .75rem; }
.tpc-title { font-size: 15px; font-weight: 600; color: var(--text); }
.tpc-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tpc-progress { display: flex; align-items: center; gap: 10px; margin-top: .75rem; }
.tpc-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.tpc-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 3px; transition: width .5s; }
.tpc-pct { font-size: 12px; color: var(--text-2); font-weight: 500; min-width: 32px; text-align: right; }
.tpc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tpc-chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.chip-done { background: #dcfce7; color: #15803d; }
.chip-skip { background: #fee2e2; color: #b91c1c; }
.chip-pend { background: #dbeafe; color: #1d4ed8; }
.chip-rest { background: #f1f5f9; color: #64748b; }

/* ── Empty training state ── */
.empty-training { text-align: center; padding: 4rem 2rem; }
.empty-training-icon { font-size: 52px; margin-bottom: 1rem; }
.empty-training-title { font-size: 20px; font-weight: 600; margin-bottom: .5rem; }
.empty-training-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 1.5rem; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ── Plan stats mini row ── */
.plan-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 1rem; }
.plan-stat { background: var(--bg); border-radius: var(--radius-sm); padding: .75rem 1rem; text-align: center; }
.plan-stat-val { font-size: 22px; font-weight: 700; }
.plan-stat-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.pstat-done { color: #16a34a; }
.pstat-skip { color: #ef4444; }
.pstat-pend { color: #3b82f6; }
.pstat-rest { color: #94a3b8; }

/* ── Week section header ── */
.week-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  cursor: pointer;
  user-select: none;
}
.week-section-header:hover { background: #e8edf3; }
.wsh-left { display: flex; align-items: center; gap: 10px; }
.wsh-title { font-size: 14px; font-weight: 600; color: var(--text); }
.wsh-phase { font-size: 12px; color: var(--text-2); }
.wsh-deload { font-size: 11px; color: var(--warning); font-weight: 500; margin-left: 4px; }
.wsh-dots { display: flex; gap: 3px; }
.wdot { width: 9px; height: 9px; border-radius: 50%; }
.wdot-completed { background: #22c55e; }
.wdot-skipped   { background: #ef4444; }
.wdot-pending   { background: #cbd5e1; }
.wdot-rest      { background: #e2e8f0; border: 1px solid #cbd5e1; }
.wsh-arrow { font-size: 11px; color: var(--text-3); transition: transform .15s; }
.wsh-arrow.open { transform: rotate(90deg); }

/* ── Training day rows ── */
.training-day-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.training-day-row:last-child { border-bottom: none; }
.training-day-row.today-row { background: #eff6ff; }
.training-day-row.status-completed { opacity: .82; }
.training-day-row.status-skipped { opacity: .55; }

.tday-date-col { text-align: center; min-width: 44px; flex-shrink: 0; }
.tday-dow { font-size: 10px; color: var(--text-3); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; display: block; }
.tday-date-num { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.tday-today-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin: 3px auto 0; }
.tday-date-col.is-today .tday-dow { color: var(--primary); }
.tday-date-col.is-today .tday-date-num { color: var(--primary); }

.tday-workout { flex: 1; min-width: 0; }
.tday-type-pill { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500; margin-bottom: 4px; }
.tday-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.tday-exercises { font-size: 12px; color: var(--text-2); white-space: pre-line; line-height: 1.55; }
.tday-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; }
.tday-deload-note { font-size: 11px; color: var(--warning); font-weight: 500; margin-top: 3px; }

.tday-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.btn-mark-done, .btn-mark-skip, .btn-mark-undo {
  border: none; border-radius: 6px; padding: 5px 11px; font-size: 12px;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .12s;
}
.btn-mark-done { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.btn-mark-done:hover { background: #bbf7d0; }
.btn-mark-done.active { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-mark-skip { background: #f1f5f9; color: #64748b; border: 1px solid var(--border); }
.btn-mark-skip:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn-mark-skip.active { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-mark-undo { background: #f1f5f9; color: #64748b; border: 1px solid var(--border); font-size: 11px; padding: 3px 8px; }
.btn-mark-undo:hover { background: #e2e8f0; }
.tday-rest-label { font-size: 12px; color: var(--text-3); padding: 5px 0; text-align: center; }
.tday-future-label { font-size: 11px; color: var(--text-3); padding: 4px 0; }

/* ── Glossary ── */
.glossary-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.glossary-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.gfilter-btn {
  border: 1px solid var(--border); background: var(--card);
  border-radius: 20px; padding: 5px 14px; font-size: 13px;
  cursor: pointer; font-family: inherit; color: var(--text-2);
  transition: all .15s;
}
.gfilter-btn:hover { border-color: var(--primary); color: var(--primary); }
.gfilter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.gfilter-btn.cat-explosividad.active { background: #ef4444; border-color: #ef4444; }
.gfilter-btn.cat-fuerza.active       { background: #8b5cf6; border-color: #8b5cf6; }
.gfilter-btn.cat-cardio.active       { background: #22c55e; border-color: #22c55e; }
.gfilter-btn.cat-movilidad.active    { background: #a855f7; border-color: #a855f7; }

.glossary-search-input {
  margin-left: auto; width: 220px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; outline: none; transition: border-color .15s;
  background: var(--card);
}
.glossary-search-input:focus { border-color: var(--primary); }

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.gcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.gcard:hover { border-color: #94a3b8; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.gcard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem;
  cursor: pointer;
  user-select: none;
}
.gcard-left { display: flex; align-items: center; gap: 10px; }
.gcard-icon { font-size: 22px; flex-shrink: 0; }
.gcard-name { font-size: 14px; font-weight: 600; color: var(--text); }
.gcard-sub  { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.gcard-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gcat-badge {
  font-size: 10px; padding: 2px 9px; border-radius: 10px; font-weight: 500;
}
.cat-explosividad-badge { background: #fee2e2; color: #b91c1c; }
.cat-fuerza-badge       { background: #ede9fe; color: #6d28d9; }
.cat-cardio-badge       { background: #dcfce7; color: #15803d; }
.cat-movilidad-badge    { background: #f3e8ff; color: #7e22ce; }
.gcard-arrow { font-size: 11px; color: var(--text-3); transition: transform .15s; }
.gcard-arrow.open { transform: rotate(90deg); }
.gcard-difficulty { display: flex; gap: 3px; }
.gdiff-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.gdiff-dot.filled { background: #f59e0b; }

.gcard-body { border-top: 1px solid var(--border); padding: 1rem; display: none; }
.gcard-body.open { display: block; }
.gcard-section-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; margin-top: 12px; }
.gcard-section-title:first-child { margin-top: 0; }
.gcard-muscles { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.gmuscle-tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.gcard-technique { list-style: none; }
.gcard-technique li { font-size: 13px; color: var(--text); line-height: 1.5; padding: 3px 0 3px 16px; position: relative; }
.gcard-technique li::before { content: '→'; position: absolute; left: 0; color: var(--primary); font-size: 11px; top: 4px; }
.gcard-mistakes { list-style: none; }
.gcard-mistakes li { font-size: 12px; color: var(--text-2); line-height: 1.5; padding: 3px 0 3px 16px; position: relative; }
.gcard-mistakes li::before { content: '⚠'; position: absolute; left: 0; font-size: 10px; top: 4px; }
.gcard-actions { display: flex; gap: 8px; margin-top: 1rem; }
.btn-watch {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 7px 12px; font-size: 13px;
  font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn-watch:hover { background: #fecaca; }
.btn-yt-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px; font-size: 13px;
  font-weight: 500; cursor: pointer; font-family: inherit; text-decoration: none;
  transition: background .15s;
}
.btn-yt-link:hover { background: var(--border); }

/* ── Video modal ── */
.video-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.video-modal-card {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 760px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  overflow: hidden;
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.video-modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.video-modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-2); padding: 2px 6px; border-radius: 4px;
}
.video-modal-close:hover { background: var(--bg); color: var(--text); }
.video-iframe-wrap { position: relative; padding-bottom: 56.25%; height: 0; background: #000; }
.video-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .view-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar-brand-name, .nav-item span, .user-name { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-bottom { justify-content: center; }
  .user-info { gap: 0; }
  .view { padding: 1rem; }
  .week-row { grid-template-columns: repeat(7, 1fr); }
  .week-day-label { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
