@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg:           #080c14;
  --bg-card:      #111827;
  --bg-card-2:    #1a2234;
  --border:       #1e2d4a;
  --accent:       #f97316;
  --accent-dark:  #ea580c;
  --accent-glow:  rgba(249,115,22,0.15);
  --accent-2:     #06b6d4;
  --text:         #f8fafc;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --nav-h:        72px;
  --radius:       18px;
  --radius-sm:    12px;
  --shadow:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.3);
}

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

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea { font-family: inherit; outline: none; border: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── LAYOUT ── */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 0 16px;
  padding-bottom: calc(var(--nav-h) + 20px);
}

/* ── TOP BAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  transition: opacity .2s;
}
.topbar-back:active { opacity: 0.7; }
.topbar-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: rgba(17,24,39,0.95);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-item svg { width: 22px; height: 22px; transition: transform .2s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.15); }
.nav-item:active { transform: scale(0.92); }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: border-color .2s, transform .15s;
}
.card:active { transform: scale(0.98); }
.card-accent { border-left: 3px solid var(--accent); }
.card-link { cursor: pointer; }
.card-link:active { transform: scale(0.97); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
}
.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-accent  { background: var(--accent-glow);  color: var(--accent); }
.badge-info    { background: rgba(6,182,212,.15);  color: var(--accent-2); }
.badge-success { background: rgba(34,197,94,.15);  color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger); }

/* ── PILLS (series/reps/rir/rest) ── */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 70px;
}
.pill-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}
.pill-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── SECTION HEADING ── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 20px 0 10px;
}

/* ── GREETING ── */
.greeting {
  padding: 12px 0 4px;
}
.greeting-line1 {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.greeting-name {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── HERO CARD (today's training) ── */
.hero-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(249,115,22,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
}
.hero-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: 99px;
  transition: background .2s, transform .15s;
}
.hero-btn:active { background: var(--accent-dark); transform: scale(0.96); }

/* ── QUICK ACTIONS ── */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.quick-card:active { transform: scale(0.96); }
.quick-card:hover { border-color: var(--accent); }
.quick-card-icon {
  font-size: 1.6rem;
}
.quick-card-label {
  font-size: 0.85rem;
  font-weight: 700;
}
.quick-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── ALERT BANNER ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.alert-warning {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fcd34d;
}
.alert-info {
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.25);
  color: var(--accent-2);
}
.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert-text strong { display: block; font-weight: 700; margin-bottom: 2px; }

/* ── DAY CARD (routine) ── */
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.day-card-header:active { background: var(--bg-card-2); }
.day-info { display: flex; align-items: center; gap: 12px; }
.day-emoji {
  font-size: 1.5rem;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-2);
  border-radius: 10px;
  flex-shrink: 0;
}
.day-name { font-size: 0.95rem; font-weight: 700; }
.day-type { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.day-chevron {
  color: var(--text-dim);
  transition: transform .3s;
  flex-shrink: 0;
}
.day-card.open .day-chevron { transform: rotate(180deg); }

.day-body {
  display: none;
  border-top: 1px solid var(--border);
}
.day-card.open .day-body { display: block; }

.exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: var(--text);
}
.exercise-row:last-child { border-bottom: none; }
.exercise-row:active { background: var(--bg-card-2); }
.exercise-row-info { flex: 1; min-width: 0; }
.exercise-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exercise-row-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.exercise-row-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 8px;
}
.exercise-done {
  background: rgba(34,197,94,0.05);
}
.exercise-done .exercise-row-name {
  color: var(--text-muted);
}
.done-check {
  width: 26px; height: 26px;
  border-radius: 99px;
  background: rgba(34,197,94,0.15);
  border: 1.5px solid var(--success);
  color: var(--success);
  font-size: .85rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-left: 8px;
}
.exercise-nota-badge {
  display: inline-block;
  background: rgba(249,115,22,0.15);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* ── EXERCISE DETAIL ── */
.exercise-detail-header {
  padding: 0 0 20px;
}
.exercise-detail-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 10px;
}

/* ── VIDEO ── */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
}
.video-placeholder span { font-size: 2.5rem; }
.video-placeholder p { font-size: 0.8rem; font-weight: 500; }

/* ── LOG FORM ── */
.log-section-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.serie-log-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.serie-log-card.done { border-color: var(--success); }
.serie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.serie-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.serie-check {
  width: 22px; height: 22px;
  border-radius: 99px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--success);
  font-size: 0.8rem;
}
.serie-check.checked { background: rgba(34,197,94,.15); border-color: var(--success); }
.serie-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.input-field {
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 14px;
  width: 100%;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--text-dim); font-weight: 400; }
.input-field-notes {
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  padding: 12px 14px;
  width: 100%;
  resize: none;
  transition: border-color .2s;
  min-height: 64px;
}
.input-field-notes:focus { border-color: var(--accent); }

.last-record {
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--accent-2);
}
.last-record strong { font-weight: 700; }

/* ── BUTTONS ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:active { background: var(--accent-dark); }
.btn-secondary {
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-secondary:active { border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── CAMBIO FISICO ── */
.weight-display {
  text-align: center;
  padding: 24px 0;
}
.weight-big {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text);
}
.weight-big span { font-size: 1.5rem; font-weight: 600; color: var(--text-muted); }
.weight-date {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  cursor: pointer;
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo-upload-area {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color .2s;
}
.photo-upload-area span { font-size: 1.4rem; }

.week-record {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color .2s;
}
.week-record:active { border-color: var(--accent); }
.week-record-info { flex: 1; min-width: 0; }
.week-record-date {
  font-size: 0.88rem;
  font-weight: 700;
}
.week-record-weight {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.week-record-photos {
  display: flex;
  gap: 4px;
}
.week-record-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.week-record-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── HISTORIAL ── */
.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .2s;
}
.session-card:active { border-color: var(--accent); }
.session-date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.session-name {
  font-size: 0.92rem;
  font-weight: 700;
}
.session-exercises {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.log-item:last-child { border-bottom: none; }
.log-item-name { font-weight: 600; color: var(--text); flex: 1; }
.log-item-data { color: var(--text-muted); text-align: right; font-size: 0.8rem; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.05) 0%, transparent 50%);
}
.login-logo {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  text-align: center;
}
.login-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 40px;
  font-weight: 500;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
}
.login-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.login-card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.login-input-wrap {
  margin-bottom: 14px;
}
.login-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.login-input {
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 16px;
  width: 100%;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.login-input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 99px;
  letter-spacing: 0.02em;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn:active { background: var(--accent-dark); transform: scale(0.97); }
.login-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

/* ── MODAL FOTO ── */
.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.photo-modal.open { display: flex; }
.modal-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
}
.photo-modal-close {
  position: fixed;
  top: env(safe-area-inset-top, 16px);
  right: 16px;
  margin-top: 16px;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  background: rgba(0,0,0,0.6);
  width: 44px; height: 44px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  z-index: 301;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}
.empty-state span { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.88rem; line-height: 1.5; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 12px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  z-index: 150;
  opacity: 0;
  transition: all .3s;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--success); color: var(--success); }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeIn .3s ease both; }
.fade-in-1 { animation-delay: .05s; }
.fade-in-2 { animation-delay: .1s; }
.fade-in-3 { animation-delay: .15s; }
.fade-in-4 { animation-delay: .2s; }

/* ── FORM EXTRAS ── */
select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── STEPPER ── */
.stepper {
  display: flex;
  align-items: center;
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s;
  height: 54px;
}
.stepper:focus-within { border-color: var(--accent); }

.stepper-btn {
  width: 48px;
  height: 100%;
  background: transparent;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 300;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.stepper-btn:active { background: var(--accent-glow); }

.stepper-val {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  padding: 0 4px;
  min-width: 0;
  height: 100%;
}
.stepper-val::placeholder {
  color: var(--text-dim);
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: .02em;
}

/* ── EDIT / DELETE INLINE ── */
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  cursor: pointer;
  border: none;
  transition: all .15s;
}
.btn-edit   { background: rgba(6,182,212,.15);  color: #06b6d4; }
.btn-delete { background: rgba(239,68,68,.15);  color: #ef4444; }
.btn-edit:active   { background: rgba(6,182,212,.3); }
.btn-delete:active { background: rgba(239,68,68,.3); }

.edit-row {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 4px;
}
.edit-row.open { display: flex; }
.edit-row .input-field { padding: 9px 12px; font-size: .9rem; width: 100%; }
.edit-row .btn-save-edit { width: 100%; text-align: center; }

.btn-save-edit {
  padding: 9px 16px;
  background: var(--accent);
  color: white;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-save-edit:active { background: var(--accent-dark); }

/* ── PROGRESS BAR ── */
.prog-bar-wrap {
  background: var(--bg-card-2);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.prog-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #fb923c);
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── WEIGHT CHART PLACEHOLDER ── */
.chart-area {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ── TIMER INLINE ── */
.timer-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}
.timer-inline-left { flex: 1; min-width: 0; }
.timer-adjust {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer-adj-btn {
  background: var(--bg-card-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.timer-adj-btn:active { border-color: var(--accent); color: var(--accent); transform: scale(0.93); }
.timer-ring-wrap { flex-shrink: 0; margin-left: 16px; }
.timer-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.timer-display {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -.05em;
  color: var(--text);
  line-height: 1;
}
.timer-btns {
  display: flex;
  gap: 8px;
}
.timer-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .15s;
}
.timer-btn:active { transform: scale(0.95); }
.timer-btn-start { background: var(--accent);    color: white; }
.timer-btn-pause { background: var(--warning);   color: #111; }
.timer-btn-reset { background: var(--bg-card-2); color: var(--text-muted); border: 1px solid var(--border); max-width: 44px; flex: none; }

/* ── CHART CARD ── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  margin-bottom: 14px;
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.chart-card-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.pr-badge {
  font-size: .72rem;
  font-weight: 700;
  color: #facc15;
  background: rgba(250,204,21,0.12);
  border: 1px solid rgba(250,204,21,0.3);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── PR BANNER ── */
.pr-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
  padding: 24px 32px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(249,115,22,0.5);
  z-index: 999;
  opacity: 0;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  line-height: 1.3;
}
.pr-banner span { display: block; font-size: 1.8rem; margin-top: 4px; }
.pr-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── WEEK CARD ── */
.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  margin-bottom: 14px;
}
.week-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.week-card-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.racha-badge {
  font-size: .78rem;
  font-weight: 800;
  color: #f97316;
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.25);
  border-radius: 20px;
  padding: 3px 10px;
}
.week-days {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.week-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  transition: all .2s;
}
.dot-done   { background: var(--success); color: white; box-shadow: 0 0 10px rgba(34,197,94,0.4); }
.dot-today  { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.dot-missed { background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text-dim); }
.dot-future { background: var(--bg-card-2); border: 1px dashed var(--border); color: var(--border); }
.week-day-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-dim);
}
.week-day-label.label-today { color: var(--accent); font-weight: 800; }
.week-summary {
  margin-top: 12px;
  text-align: center;
  font-size: .75rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── TOPBAR EDIT BTN ── */
.topbar-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(249,115,22,0.25);
  transition: all .15s;
}
.topbar-edit-btn:active { transform: scale(0.95); }

/* ── VIDEO PLACEHOLDER LINK ── */
.video-placeholder-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
}
.video-placeholder-link:hover p { color: var(--accent); }

/* ── EXERCISE EDIT LIST ── */
.exercise-edit-list { display: flex; flex-direction: column; }

.exercise-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: opacity .3s;
}

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

.exercise-edit-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exercise-edit-meta {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.exercise-edit-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.btn-add-exercise {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  border-top: 1px dashed var(--border);
  color: var(--accent);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.btn-add-exercise:active { opacity: 0.7; }

/* ── MODAL DRAWER ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: flex-end;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  display: flex;
}

.modal-drawer {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  animation: slideUp .25s ease;
}

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

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card-2);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px 20px 32px;
}

.edit-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* ── BUSCAR VIDEO BTN ── */
.btn-buscar-video {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: all .15s;
}
.btn-buscar-video:hover { border-color: var(--accent); color: var(--accent); }
.btn-buscar-video:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── VIDEO RESULTS ── */
.video-results-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-result-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-card-2);
}
.video-result-card:active { transform: scale(0.98); }
.video-result-card.selected { border-color: var(--accent); background: var(--accent-glow); }

.video-result-thumb {
  width: 90px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.video-result-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── SELECTED VIDEO ── */
.video-selected-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.video-yt-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.75);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── INPUT FIELD ── */
.input-field {
  width: 100%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .15s;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--text-dim); }

/* ── RESPONSIVE ── */
@media (min-width: 480px) {
  .page { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .bottom-nav { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .modal-drawer { border-radius: 24px; margin-bottom: 24px; }
}
