/* ═══════════════════════════════════════════
   TREINO LIVRE — style.css
   Dark fitness app aesthetic
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ─── CSS VARIABLES ─── */
:root {
  --bg: #0D0D0D;
  --bg2: #181818;
  --bg3: #222222;
  --accent: #800020;
  --accent-light: #a0002a;
  --accent-glow: rgba(128, 0, 32, 0.25);
  --text: #F5F5F5;
  --text-muted: #888;
  --text-dim: #555;
  --border: #2a2a2a;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 68px;
  --top-h: 56px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: var(--font-body); }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }

/* ─── SPLASH ─── */
.splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo { text-align: center; animation: splashIn 0.6s ease; }
.splash-icon { font-size: 64px; margin-bottom: 12px; }
.splash-title {
  font-family: var(--font-display);
  font-size: 52px;
  letter-spacing: 6px;
  color: var(--text);
  line-height: 1;
}
.splash-sub { color: var(--text-muted); font-size: 14px; margin-top: 8px; letter-spacing: 2px; text-transform: uppercase; }
@keyframes splashIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── APP LAYOUT ─── */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.hidden { display: none !important; }

/* ─── TOP BAR ─── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--top-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
}
.topbar-back {
  width: 40px; height: 40px;
  font-size: 28px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.topbar-back:active { background: var(--bg3); }
.topbar-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
  flex: 1; text-align: center;
}
.topbar-action {
  width: 40px; height: 40px;
  font-size: 14px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding-top: var(--top-h);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  -webkit-overflow-scrolling: touch;
}

/* ─── SCREENS ─── */
.screen { display: none; padding: 16px; animation: fadeIn 0.25s ease; }
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px 0;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:active { transform: scale(0.9); }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.5px; }

/* ─── MORE BUTTON ─── */
.more-btn {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); right: 16px; z-index: 200;
  width: 42px; height: 42px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.more-menu {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 62px); right: 12px; z-index: 201;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}
.more-item {
  display: block; width: 100%;
  padding: 14px 18px;
  text-align: left;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.more-item:last-child { border-bottom: none; }
.more-item:active { background: var(--bg3); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-light); }
.btn-secondary {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }

/* ─── FAB ─── */
.fab-container { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.btn-fab {
  width: 52px; height: 52px;
  background: var(--accent);
  color: #fff; font-size: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: transform 0.15s;
}
.btn-fab:active { transform: scale(0.93); }

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px;
}
.section-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1.5px;
  color: var(--text);
}

/* ─── CARDS ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.card:active { background: var(--bg3); }

/* ─── DASHBOARD ─── */
.dashboard-hero {
  padding: 8px 0 16px;
}
.hero-greeting {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--text);
}
.hero-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 4px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.stat-icon { font-size: 20px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 1px;
  color: var(--accent);
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.workout-quick-list { display: flex; flex-direction: column; gap: 8px; }
.quick-workout-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.15s, border-color 0.15s;
}
.quick-workout-btn:active { background: var(--bg3); border-color: var(--accent); }
.quick-workout-name { font-weight: 600; font-size: 15px; }
.quick-workout-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.quick-start-arrow { color: var(--accent); font-size: 22px; }

.last-workout-card { }
.last-workout-info {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.last-workout-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.last-workout-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── WORKOUT LIST ─── */
.workout-list { display: flex; flex-direction: column; gap: 10px; }
.workout-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.workout-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
}
.workout-card-name { font-size: 17px; font-weight: 700; }
.workout-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.workout-card-actions { display: flex; gap: 8px; padding: 0 16px 14px; }
.btn-icon {
  flex: 1; padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  background: var(--bg3);
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s;
}
.btn-icon:active { background: var(--border); }
.btn-icon.start { background: var(--accent); color: #fff; }

/* ─── WORKOUT EDIT ─── */
.big-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 18px; font-weight: 600;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.big-input:focus { border-color: var(--accent); }
.big-input::placeholder { color: var(--text-dim); font-weight: 400; }

.exercise-edit-list { display: flex; flex-direction: column; gap: 8px; }
.exercise-edit-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.exercise-edit-drag { color: var(--text-dim); font-size: 18px; cursor: grab; }
.exercise-edit-info { flex: 1; }
.exercise-edit-name { font-weight: 600; font-size: 15px; }
.exercise-edit-muscle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.exercise-edit-sets {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.exercise-edit-sets label { font-size: 12px; color: var(--text-muted); }
.exercise-edit-sets input {
  width: 36px;
  background: none; border: none; color: var(--text);
  font-size: 15px; font-weight: 700; text-align: center; outline: none;
}
.exercise-edit-remove { color: var(--danger); font-size: 20px; padding: 4px; }

/* ─── EXECUTION ─── */
.execution-header {
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  margin-bottom: 16px;
}
.execution-workout-name {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 3px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.timer-display {
  font-family: var(--font-display);
  font-size: 56px; letter-spacing: 4px;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 30px var(--accent-glow);
}
.timer-controls { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.btn-timer-ctrl {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.btn-timer-ctrl:active { opacity: 0.8; transform: scale(0.96); }
.btn-timer-ctrl.btn-warn { background: var(--warning); color: #000; border-color: transparent; }
.btn-timer-ctrl.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }

/* ─── REST TIMER ─── */
.rest-timer-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.rest-timer-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.rest-timer-label span { color: var(--text); font-weight: 700; font-size: 15px; }
.rest-quick-btns { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.btn-rest {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  transition: all 0.15s;
}
.btn-rest:active, .btn-rest.active-rest { background: var(--accent); color: #fff; border-color: transparent; }
.rest-timer-progress {
  height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden;
}
.rest-timer-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
}

/* ─── EXERCISE CARDS (EXECUTION) ─── */
.exec-exercise-list { display: flex; flex-direction: column; gap: 14px; }
.exec-exercise-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.exec-exercise-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.exec-exercise-name { font-weight: 700; font-size: 16px; }
.exec-exercise-muscle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.exec-volume-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 700;
}

.exec-sets { padding: 10px 14px 14px; }
.exec-set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr 40px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.exec-set-num {
  font-size: 13px; color: var(--text-dim);
  font-weight: 700; text-align: center;
}
.exec-set-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  text-align: center;
  padding: 10px 6px;
  width: 100%; outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
.exec-set-input:focus { border-color: var(--accent); }
.exec-set-input::placeholder { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.exec-set-check {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 16px;
  transition: all 0.2s;
}
.exec-set-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.exec-set-labels {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr 40px;
  gap: 6px;
  margin-bottom: 4px;
}
.exec-set-label { font-size: 10px; color: var(--text-dim); text-align: center; letter-spacing: 0.5px; text-transform: uppercase; }

.exec-add-set-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 13px;
  transition: all 0.15s;
}
.exec-add-set-btn:active { border-color: var(--accent); color: var(--accent); }

/* ─── LIBRARY ─── */
.search-bar { margin-bottom: 12px; }
.search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

.muscle-filter {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px;
  scrollbar-width: none;
}
.muscle-filter::-webkit-scrollbar { display: none; }
.muscle-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.muscle-chip.active { background: var(--accent); color: #fff; border-color: transparent; }

.library-list { display: flex; flex-direction: column; gap: 8px; }
.exercise-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: background 0.15s;
}
.exercise-card:active { background: var(--bg3); }
.exercise-card-emoji { font-size: 28px; }
.exercise-card-info { flex: 1; }
.exercise-card-name { font-weight: 600; font-size: 15px; }
.exercise-card-muscle {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.muscle-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px; font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ─── EXERCISE DETAIL ─── */
.ex-detail-hero {
  text-align: center;
  padding: 20px;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.ex-detail-emoji { font-size: 56px; }
.ex-detail-name {
  font-family: var(--font-display);
  font-size: 28px; letter-spacing: 2px;
  margin: 8px 0 4px;
}
.ex-detail-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.ex-detail-section h4 {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.ex-detail-section p { font-size: 14px; color: var(--text); line-height: 1.6; }
.ex-detail-section ul { list-style: none; }
.ex-detail-section ul li {
  font-size: 14px; color: var(--text); line-height: 1.6;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px;
}
.ex-detail-section ul li:last-child { border-bottom: none; }
.ex-detail-section ul li::before { content: '›'; color: var(--accent); font-size: 16px; }

/* ─── HISTORY ─── */
.tab-bar {
  display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: transparent; }

.history-content { display: flex; flex-direction: column; gap: 10px; }
.history-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.history-card:active { background: var(--bg3); }
.history-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.history-card-name { font-weight: 700; font-size: 16px; }
.history-card-date { font-size: 12px; color: var(--text-muted); }
.history-card-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.history-stat { font-size: 13px; color: var(--text-muted); }
.history-stat strong { color: var(--text); }

/* ─── SESSION DETAIL ─── */
.session-detail-header {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.session-detail-name {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: 2px;
}
.session-detail-meta { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.session-detail-stat { font-size: 13px; color: var(--text-muted); }
.session-detail-stat strong { color: var(--accent); }

.session-exercise {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.session-exercise-header { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.session-exercise-name { font-weight: 700; }
.session-exercise-sets { padding: 10px 14px; }
.session-set-row {
  display: grid; grid-template-columns: 40px 1fr 1fr 1fr;
  gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.session-set-row:last-child { border-bottom: none; }
.session-set-row > span:first-child { color: var(--text-dim); }
.session-set-done { color: var(--success); }

/* ─── CHARTS ─── */
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.chart-card h4 {
  font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
}
.chart-card canvas { max-height: 200px; }

/* ─── PR ─── */
.pr-list { display: flex; flex-direction: column; gap: 8px; }
.pr-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.pr-card-left { }
.pr-card-name { font-weight: 600; font-size: 15px; }
.pr-card-muscle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pr-card-right { text-align: right; }
.pr-card-weight {
  font-family: var(--font-display);
  font-size: 28px; color: var(--accent);
  letter-spacing: 1px;
}
.pr-card-date { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.pr-badge {
  font-size: 10px; background: gold; color: #000;
  border-radius: 4px; padding: 2px 6px;
  font-weight: 700; letter-spacing: 1px;
}

/* ─── BODYWEIGHT ─── */
.bw-input-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.bw-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 18px; font-weight: 600;
  padding: 14px 16px;
  outline: none;
}
.bw-input:focus { border-color: var(--accent); }
.bw-history { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.bw-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.bw-entry-weight { font-family: var(--font-display); font-size: 22px; color: var(--accent); }
.bw-entry-date { font-size: 12px; color: var(--text-muted); }
.bw-entry-del { color: var(--text-dim); font-size: 18px; padding: 4px 8px; }
.bw-entry-del:active { color: var(--danger); }

/* ─── BACKUP ─── */
.backup-section { padding: 24px 0; text-align: center; }
.backup-icon { font-size: 42px; margin-bottom: 10px; }
.backup-section h3 { font-size: 18px; margin-bottom: 6px; }
.backup-section p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.backup-divider { border-top: 1px solid var(--border); }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px;
  width: 100%; max-width: 520px;
  max-height: 85dvh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-large { max-height: 90dvh; }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-close { font-size: 20px; color: var(--text-muted); padding: 4px; }

/* ─── PICKER LIST ─── */
.picker-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  cursor: pointer;
  transition: background 0.15s;
}
.picker-item:active { background: var(--border); }
.picker-item-emoji { font-size: 22px; }
.picker-item-name { font-weight: 600; font-size: 14px; }
.picker-item-muscle { font-size: 12px; color: var(--text-muted); }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); left: 50%; z-index: 600;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.2s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* ─── UTILS ─── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.flex-row { display: flex; gap: 8px; align-items: center; }

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

/* ─── RESPONSIVE ─── */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { max-width: 600px; margin: 0 auto; }
  .topbar, .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); }
  .more-btn { right: calc(50% - 300px + 16px); }
  .more-menu { right: calc(50% - 300px + 12px); }
  .modal { border-radius: var(--radius); margin-bottom: 20px; }
}

/* ═══════════════════════════════════════════
   V2 ADDITIONS
═══════════════════════════════════════════ */

/* WORKOUT PREVIEW */
.preview-header {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px; margin-bottom: 16px; text-align: center;
}
.preview-workout-name {
  font-family: var(--font-display); font-size: 28px; letter-spacing: 3px; color: var(--text);
}
.preview-meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.preview-exercise-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.preview-ex-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.preview-ex-name { font-weight: 600; font-size: 15px; }
.preview-ex-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.preview-ex-sets {
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 20px;
  padding: 4px 12px; font-size: 13px; font-weight: 700;
}
.preview-actions { display: flex; gap: 10px; }
.preview-actions .btn { flex: 1; }

/* FORM */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; }
.textarea-input { resize: vertical; min-height: 80px; font-size: 14px; }
select.big-input { -webkit-appearance: none; appearance: none; }

/* EXERCISE CUSTOM */
.exercise-card-custom {
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* FAB SM */
.btn-fab-sm { width: 42px; height: 42px; font-size: 22px; }

/* DIET */
.diet-date-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
}
.diet-date-label { font-weight: 700; font-size: 15px; }
.btn-date-nav {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); color: var(--text);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.btn-date-nav:active { background: var(--border); }

.macro-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
.macro-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 8px; text-align: center;
}
.macro-card-value { font-family: var(--font-display); font-size: 20px; color: var(--accent); }
.macro-card-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; }
.macro-card-goal { font-size: 10px; color: var(--text-dim); }
.macro-bar { height: 3px; background: var(--bg3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.macro-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.meal-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.meal-card-name { font-weight: 700; font-size: 15px; }
.meal-card-cals { font-size: 13px; color: var(--accent); font-weight: 700; }
.meal-food-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.meal-food-row:last-child { border-bottom: none; }
.meal-food-name { font-weight: 500; }
.meal-food-qty { color: var(--text-muted); font-size: 12px; }
.meal-food-macros { color: var(--text-muted); font-size: 12px; text-align: right; }
.meal-card-actions { display: flex; gap: 8px; padding: 10px 14px; }

.meal-food-edit-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.meal-food-edit-row {
  background: var(--bg3); border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.meal-food-edit-info { flex: 1; }
.meal-food-edit-name { font-weight: 600; font-size: 13px; }
.meal-food-edit-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.meal-food-edit-qty {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-weight: 700; text-align: center;
  padding: 6px 8px; width: 64px; outline: none;
}
.meal-food-edit-remove { color: var(--danger); font-size: 18px; padding: 4px 6px; }

.macro-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.macro-preview {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 12px;
}
.macro-preview-item { text-align: center; }
.macro-preview-val { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
.macro-preview-label { font-size: 10px; color: var(--text-muted); }

.food-category-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; background: var(--bg3);
  color: var(--text-muted); margin-top: 2px;
}

/* ═══════════════════════════════════════════
   V3 — EXECUTION REDESIGN + EXERCISE TYPES
═══════════════════════════════════════════ */

/* TOPBAR v3 */
.topbar-left  { display:flex; align-items:center; min-width:80px; }
.topbar-right { display:flex; align-items:center; justify-content:flex-end; min-width:80px; }

.btn-abandon {
  padding:7px 12px; border-radius:var(--radius-sm);
  background:rgba(239,68,68,0.15); border:1px solid rgba(239,68,68,0.4);
  color:#ef4444; font-size:12px; font-weight:700; white-space:nowrap;
  transition:all .15s;
}
.btn-abandon:active { background:rgba(239,68,68,0.3); }

.btn-finish {
  padding:7px 12px; border-radius:var(--radius-sm);
  background:rgba(34,197,94,0.15); border:1px solid rgba(34,197,94,0.4);
  color:#22c55e; font-size:12px; font-weight:700; white-space:nowrap;
  transition:all .15s;
}
.btn-finish:active { background:rgba(34,197,94,0.3); }

/* EXECUTION TIMER BLOCK */
.exec-timer-block {
  background:var(--bg2); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px;
  display:flex; align-items:center; gap:12px;
  margin-bottom:12px;
}
.exec-timer-block .timer-display {
  font-family:var(--font-display); font-size:44px; letter-spacing:3px;
  color:var(--accent); line-height:1; flex:1;
  text-shadow:0 0 20px var(--accent-glow);
}
.timer-state-hint { font-size:11px; color:var(--text-dim); margin-top:4px; }
.btn-timer-play {
  width:52px; height:52px; border-radius:50%;
  background:var(--accent); color:#fff; font-size:20px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; transition:all .15s;
  box-shadow:0 4px 16px var(--accent-glow);
}
.btn-timer-play.running { background:#f59e0b; }
.btn-timer-play:active { transform:scale(.93); }
.timer-block-left { flex:1; }

/* REST TIMER v3 */
.rest-timer-top { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.rest-timer-label { font-size:12px; color:var(--text-muted); }
.rest-timer-val { font-size:16px; font-weight:700; color:var(--text); flex:1; }
.btn-rest-stop { color:var(--text-dim); font-size:16px; padding:4px; }
.btn-rest-stop:active { color:var(--danger); }

/* SET TYPE SELECTOR */
.set-type-select {
  background:var(--bg3); border:1px solid var(--border);
  border-radius:6px; color:var(--text-muted);
  font-size:11px; font-weight:700; padding:0 4px;
  height:36px; width:42px; text-align:center;
  cursor:pointer; outline:none; -webkit-appearance:none;
  text-align-last:center;
}
.set-type-select.type-warmup  { color:#f59e0b; border-color:rgba(245,158,11,.4); background:rgba(245,158,11,.08); }
.set-type-select.type-prep    { color:#6366f1; border-color:rgba(99,102,241,.4); background:rgba(99,102,241,.08); }
.set-type-select.type-work    { color:#22c55e; border-color:rgba(34,197,94,.4);  background:rgba(34,197,94,.08);  }

/* exec set row v3 — 6 cols: type, num, kg/time, reps/dist, obs, check */
.exec-set-row {
  display:grid;
  grid-template-columns:44px 28px 1fr 1fr 1fr 38px;
  gap:5px; align-items:center; margin-bottom:5px;
}
.exec-set-labels {
  display:grid;
  grid-template-columns:44px 28px 1fr 1fr 1fr 38px;
  gap:5px; margin-bottom:4px;
}
/* dim non-work sets */
.exec-set-row.set-warmup { opacity:.65; }
.exec-set-row.set-prep   { opacity:.75; }

/* CARDIO SET ROW */
.exec-set-row.cardio-row {
  grid-template-columns:44px 28px 1fr 1fr 1fr 38px;
}

/* TYPE CHIPS (exercise edit) */
.type-chips { display:flex; flex-wrap:wrap; gap:8px; }
.type-chip {
  padding:8px 14px; border-radius:20px;
  background:var(--bg2); border:1px solid var(--border);
  color:var(--text-muted); font-size:13px; font-weight:500;
  transition:all .15s;
}
.type-chip.active { background:var(--accent); color:#fff; border-color:transparent; }

/* VOLUME LEGEND */
.vol-legend {
  display:flex; gap:10px; flex-wrap:wrap;
  padding:8px 14px; font-size:11px; color:var(--text-dim);
}
.vol-legend-item { display:flex; align-items:center; gap:4px; }
.vol-dot { width:8px; height:8px; border-radius:50%; }
