/* ════════════════════════════════════════════════════════════════════════
   Personal Trainer — Design System v2
   Paleta: branco/clean moderno. Acento índigo + laranja energia.
   Tipografia: Plus Jakarta Sans (display) + Inter (corpo).
   Assinatura: cards com sombra suave + nav pill + header colorido p/ exercícios.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Fundos */
  --bg:        #F5F7FF;
  --surface:   #FFFFFF;
  --surface-2: #F0F2FB;
  --surface-3: #E8EBFA;

  /* Bordas */
  --border:    #E4E8F5;
  --border-2:  #D0D5EC;

  /* Acento primário — índigo */
  --accent:      #5A52E8;
  --accent-dim:  #7C76ED;
  --accent-bg:   rgba(90, 82, 232, 0.08);
  --accent-bg2:  rgba(90, 82, 232, 0.14);

  /* Energia — laranja */
  --orange:      #FF6B35;
  --orange-bg:   rgba(255, 107, 53, 0.10);

  /* Sucesso */
  --green:       #22C55E;
  --green-dim:   #16A34A;
  --green-bg:    rgba(34, 197, 94, 0.10);
  --green-bg2:   rgba(34, 197, 94, 0.16);

  /* Alerta */
  --amber:       #F59E0B;
  --amber-bg:    rgba(245, 158, 11, 0.10);

  /* Erro */
  --red:         #EF4444;
  --red-bg:      rgba(239, 68, 68, 0.08);

  /* Azul info */
  --blue:        #3B82F6;
  --blue-bg:     rgba(59, 130, 246, 0.10);

  /* Texto */
  --text:        #0D1117;
  --text-2:      #1E2534;
  --muted:       #6E7B96;
  --faint:       #B0BBCF;

  /* Tipografia */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Plus Jakarta Sans', sans-serif;

  /* Bordas arredondadas */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(13,17,23,.06), 0 1px 2px rgba(13,17,23,.04);
  --shadow:    0 4px 12px rgba(13,17,23,.08), 0 2px 4px rgba(13,17,23,.04);
  --shadow-lg: 0 12px 32px rgba(13,17,23,.10), 0 4px 12px rgba(13,17,23,.05);

  /* Safe areas */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; overscroll-behavior-y: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Boot screen
   ════════════════════════════════════════════════════════════════════════ */

.boot-screen {
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.boot-prompt {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.boot-user { color: var(--accent); }
.boot-colon, .boot-dollar { color: var(--faint); }
.boot-path { color: var(--orange); }
.boot-cmd { color: var(--text); }
.cursor-blink {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════════
   App shell
   ════════════════════════════════════════════════════════════════════════ */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.22s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.topbar {
  padding: calc(16px + var(--safe-top)) 20px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.topbar .prompt { display: none; }

.content {
  flex: 1;
  padding: 20px 16px calc(96px + var(--safe-bottom));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 16px calc(10px + var(--safe-bottom));
  gap: 4px;
  box-shadow: 0 -4px 20px rgba(13,17,23,.06);
}
.nav-btn {
  flex: 1; background: none; border: none;
  border-radius: var(--radius-sm);
  padding: 7px 4px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--faint);
  transition: color .15s, background .15s;
}
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn span { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.01em; }
.nav-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════════════════
   Tipografia
   ════════════════════════════════════════════════════════════════════════ */

.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.mono { font-family: var(--font-display); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════
   Cards & Componentes
   ════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Stats 3-col */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
}
.stat-box .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-box .label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 500;
}

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  transition: filter .15s, transform .08s, box-shadow .15s;
  width: 100%;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(90, 82, 232, 0.35);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(90, 82, 232, 0.45); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-orange {
  background: var(--orange);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.35);
}
.btn-orange:hover { filter: brightness(1.06); }

.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.btn-sm { padding: 9px 14px; font-size: 0.82rem; width: auto; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ── Forms ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field input[type=text], .field input[type=number], .field input[type=password],
.field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font-body);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  outline: none;
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 0.76rem; color: var(--faint); margin-top: 6px; }

/* ── Chips ── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
  font-family: var(--font-display);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.selected {
  background: var(--accent-bg2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Slider RPE ── */
.rpe-row { display: flex; align-items: center; gap: 12px; }
.rpe-row input[type=range] {
  flex: 1; accent-color: var(--orange); height: 4px;
}
.rpe-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 32px;
  text-align: center;
  color: var(--orange);
}

/* ════════════════════════════════════════════════════════════════════════
   Login
   ════════════════════════════════════════════════════════════════════════ */

.login-screen {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px; max-width: 400px; margin: 0 auto; width: 100%;
  min-height: 100vh;
}
.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.login-logo-icon {
  width: 64px; height: 64px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(90,82,232,.35);
  font-size: 1.8rem;
}
.login-logo .accent { color: var(--accent); }
.login-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.login-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.dev-notice {
  background: var(--amber-bg);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #92660A;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
}
.login-links {
  display: flex; justify-content: space-between; margin-top: 20px;
  font-size: 0.82rem;
}
.login-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.login-links a:hover { text-decoration: underline; }
.error-box {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.25);
  color: var(--red);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════════════
   Onboarding wizard
   ════════════════════════════════════════════════════════════════════════ */

.wizard-progress {
  display: flex; gap: 4px; padding: 0 16px; margin-top: 10px;
}
.wizard-progress .seg {
  flex: 1; height: 3px; border-radius: 2px; background: var(--border);
}
.wizard-progress .seg.done { background: var(--accent); }

/* Tour explicativo pós-onboarding */
.tour-screen { display: flex; flex-direction: column; height: 100%; }
.tour-content { display: flex; flex-direction: column; flex: 1; }
.tour-slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 8px;
  animation: fade-in 0.25s ease;
}
.tour-emoji {
  font-size: 3.2rem;
  margin-bottom: 18px;
  line-height: 1;
}
.tour-slide .wizard-question { text-align: center; }
.tour-texto {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto;
}

.wizard-step { animation: fade-in 0.2s ease; }
.wizard-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.wizard-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 22px; }

.known-max-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.known-max-row input { flex: 1; }
.known-max-row input.w-load { max-width: 90px; flex: none; }
.known-max-list { margin-bottom: 14px; }
.known-max-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.known-max-item .ex { font-weight: 600; }
.known-max-item .kg { font-weight: 700; color: var(--accent); }
.known-max-item button { background: none; border: none; color: var(--faint); padding: 4px; }

.wizard-nav { position: sticky; bottom: 0; background: var(--bg); padding: 16px 0 4px; }

.file-drop {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 24px; text-align: center;
  color: var(--muted); font-size: 0.85rem;
  cursor: pointer; transition: border-color .15s;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop.has-file { border-color: var(--accent); color: var(--accent); border-style: solid; }

/* ════════════════════════════════════════════════════════════════════════
   Lista de treinos
   ════════════════════════════════════════════════════════════════════════ */

.workout-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow .15s, transform .12s;
}
.workout-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.workout-card .wdate {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.workout-card .wtitle {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.workout-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.workout-delete-btn {
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .15s, background .15s, transform .15s;
}
.workout-delete-btn:hover { opacity: 1; background: var(--red-bg); }
.workout-delete-btn:active { transform: scale(0.9); }

/* Badges */
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-green  { background: var(--green-bg); color: var(--green-dim); }
.badge-amber  { background: var(--amber-bg); color: #B45309; }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-muted  { background: var(--surface-2); color: var(--muted); }
.badge-accent { background: var(--accent-bg); color: var(--accent); }

/* Loading spinner */
.gen-loading {
  text-align: center;
  padding: 60px 20px;
}
.gen-loading .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════
   Dashboard
   ════════════════════════════════════════════════════════════════════════ */

.chart-wrap { position: relative; height: 200px; margin-top: 8px; }
.peso-unico-registro {
  text-align: center;
  padding: 24px 12px;
}
.peso-unico-valor {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.peso-unico-label {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}
.select-row {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; padding-bottom: 2px;
}
.select-row::-webkit-scrollbar { display: none; }

.pr-list { display: flex; flex-direction: column; gap: 8px; }
.pr-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.pr-item .ex { font-weight: 600; font-size: 0.9rem; }
.pr-item .kg {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
  font-size: 1.05rem;
}
.pr-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pr-kg-input {
  width: 72px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
  font-size: 0.95rem;
  text-align: right;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: var(--surface);
}
.pr-edit-btn, .pr-delete-btn {
  border: none;
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.85;
  box-shadow: 0 1px 2px rgba(13,17,23,.08);
  transition: opacity .15s, background .15s, transform .15s;
}
.pr-edit-btn:hover, .pr-edit-btn:active { opacity: 1; background: var(--accent-bg); }
.pr-delete-btn:hover, .pr-delete-btn:active { opacity: 1; background: var(--red-bg); }
.pr-edit-btn:active, .pr-delete-btn:active { transform: scale(0.9); }

/* Histórico de medidas corporais */
.medida-hist-item {
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.medida-hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.medida-hist-data { font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.medida-hist-valores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.medida-chip {
  font-size: 0.78rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
}
.medida-chip strong { color: var(--accent); }
.medida-hist-obs {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* Streak banner */
.streak-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--accent-bg2), var(--accent-bg));
  border: 1.5px solid rgba(90,82,232,.2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.streak-banner .num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
}
.streak-banner .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
.streak-banner .titulo {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

/* Estado vazio */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state .glyph {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.empty-state p {
  font-size: 0.88rem;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════════════════
   Perfil
   ════════════════════════════════════════════════════════════════════════ */

.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(90,82,232,.35);
}
.profile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.profile-username { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.section-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 14px;
}
.section-divider span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  white-space: nowrap;
  font-weight: 700;
  font-family: var(--font-display);
}
.section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(84px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: #FFF;
  padding: 11px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  z-index: 50;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
  font-family: var(--font-display);
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green-dim); }
.toast.error { background: var(--red); }

/* ════════════════════════════════════════════════════════════════════════
   Checkin
   ════════════════════════════════════════════════════════════════════════ */

.wizard-question { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; line-height: 1.25; letter-spacing: -0.02em; }

/* ════════════════════════════════════════════════════════════════════════
   Execução de treino — novo design clean
   ════════════════════════════════════════════════════════════════════════ */

.execucao-wrap { padding-bottom: 32px; }

/* Barra de ações: Voltar / Gerar novamente / Excluir */
.exec-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.exec-actionbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-back-exec,
.btn-regen-exec {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.btn-back-exec:active,
.btn-regen-exec:active { transform: scale(0.96); }
.btn-back-exec {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-regen-exec {
  background: var(--accent-bg2);
  border: 1px solid rgba(90,82,232,.25);
  color: var(--accent);
}
.btn-delete-exec {
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 99px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--red);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.btn-delete-exec:hover { background: var(--red-bg); }
.btn-delete-exec:active { transform: scale(0.9); }

/* Objetivo */
.treino-objetivo {
  position: relative;
  background: linear-gradient(150deg, var(--accent-bg2), var(--accent-bg) 60%, transparent);
  border: 1.5px solid rgba(90,82,232,.22);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.treino-objetivo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.treino-objetivo-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  font-weight: 800;
  font-family: var(--font-display);
}
.treino-objetivo-base {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(90,82,232,.25);
  border-radius: 99px;
  padding: 3px 10px;
  font-family: var(--font-display);
  white-space: nowrap;
}
.treino-objetivo-texto {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
}

/* Seções (aquecimento, cardio) */
.section-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.section-body {
  font-size: 0.87rem;
  color: var(--text-2);
  line-height: 1.65;
}
.cardio-objetivo { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; font-family: var(--font-display); }

/* Card de sessão de cardio (com ilustração + fases) */
.cardio-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.cardio-session-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.cardio-session-illustration {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.cardio-session-illustration svg { width: 100%; height: 100%; }
.cardio-session-title-area { flex: 1; min-width: 0; }

.cardio-fases {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cardio-fase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
}
.cardio-fase-row:nth-child(odd) { background: var(--surface-2); }
.cardio-fase-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-bg2);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}
.cardio-fase-info { display: flex; flex-direction: column; min-width: 0; }
.cardio-fase-nome { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.cardio-fase-meta { font-size: 0.76rem; color: var(--muted); }
.cardio-volume {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 600;
}

/* ── Card de exercício — novo ── */
.exercise-card2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, opacity .15s;
}
.exercise-card2.done {
  border-color: rgba(34,197,94,.3);
  box-shadow: 0 0 0 2px rgba(34,197,94,.15);
}

/* Indicador de auto-save por card (item 1/2 do pedido) */
.exercise-card2.save-pending { opacity: 0.82; }
.exercise-card2.save-ok {
  box-shadow: 0 0 0 2px rgba(34,197,94,.35);
}

/* Drag handle + reordenação (item 3) */
.ex2-drag-handle {
  flex-shrink: 0;
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.35);
  border: none;
  color: rgba(0,0,0,.45);
  font-size: 1.1rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ex2-drag-handle:active { cursor: grabbing; }
.exercise-card2.dragging-hidden { opacity: 0.35; }
.exercise-card2-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  opacity: 0.95;
  transform: scale(1.02);
}

/* Header colorido do card com ilustração */
.ex2-header {
  display: flex;
  align-items: stretch;
  min-height: 80px;
  position: relative;
  overflow: hidden;
}
.ex2-illustration {
  width: 88px;
  min-width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  position: relative;
  flex-shrink: 0;
}
.ex2-illustration img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.ex2-title-area {
  flex: 1;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ex2-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.ex2-meta {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}
.ex2-head-actions {
  padding: 10px 10px 10px 0;
  display: flex;
  align-items: flex-start;
}

/* Corpo do card */
.ex2-body { padding: 12px 16px 14px; }
.ex2-obs {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-2);
  line-height: 1.5;
}

/* Troca */
.btn-swap2 {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-family: var(--font-display);
  transition: all .15s;
}
.btn-swap2:hover { border-color: var(--accent); color: var(--accent); }

/* Painel swap */
.swap-panel { padding: 0 16px 14px; }

/* ── Tabela de séries ── */
.series-table { margin-bottom: 14px; }
.series-header {
  display: grid;
  grid-template-columns: 28px 1fr 18px 1fr 36px;
  gap: 6px;
  align-items: center;
  font-size: 0.67rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 2px;
  margin-bottom: 6px;
  font-weight: 700;
  font-family: var(--font-display);
}
.serie-row {
  display: grid;
  grid-template-columns: 28px 1fr 18px 1fr 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}
.serie-num {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  font-family: var(--font-display);
}
.serie-carga, .serie-reps {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  transition: border-color .15s;
  text-align: center;
}
.serie-carga:focus, .serie-reps:focus {
  border-color: var(--accent);
  outline: none;
}
.serie-sep {
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
  font-weight: 700;
}
.serie-check {
  width: 32px; height: 32px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: 50%;
  color: var(--faint);
  cursor: pointer;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  font-weight: 700;
}
.serie-check.checked {
  background: var(--green);
  border-color: var(--green);
  color: #FFF;
}

/* RPE */
.ex2-rpe-row { margin-bottom: 12px; }
.ex2-rpe-row label {
  font-size: 0.73rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
  font-weight: 600;
  font-family: var(--font-display);
}

/* Concluído toggle */
.check-toggle2 {
  width: 100%; padding: 10px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all .15s;
  font-weight: 600;
  font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.check-toggle2.checked {
  background: var(--green-bg2);
  border-color: var(--green);
  color: var(--green-dim);
}

/* Adicionar exercício */
.btn-add-ex {
  width: 100%; padding: 13px;
  background: transparent;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  margin: 4px 0 20px;
  transition: all .15s;
  font-weight: 600;
  font-family: var(--font-display);
}
.btn-add-ex:hover { border-color: var(--accent); color: var(--accent); }
.add-ex-panel { margin: 4px 0 20px; }

/* Cardio fields */
.cardio-fields select {
  width: 100%; padding: 10px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E7B96' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
}
.hiit-panel {
  background: var(--orange-bg);
  border: 1px solid rgba(255,107,53,.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
}
.hiit-label {
  font-size: 0.72rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--font-display);
}

/* Comentário */
.treino-comentario {
  width: 100%; min-height: 80px; padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  resize: vertical;
  box-sizing: border-box;
  font-family: var(--font-body);
  transition: border-color .15s;
}
.treino-comentario:focus { border-color: var(--accent); outline: none; }
.finish-btn2 { width: 100%; margin-top: 14px; padding: 15px; font-size: 1rem; border-radius: var(--radius); }

/* Exercise card (legacy, mantido pra compatibilidade) */
.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.exercise-card.done { border-color: rgba(34,197,94,.3); }
.exercise-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.exercise-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.exercise-group { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.exercise-target { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 14px; }
.exercise-target b { color: var(--text); font-weight: 600; }
.exercise-note { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; font-style: italic; }
.log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.log-grid .field { margin-bottom: 0; }
.check-toggle {
  width: 100%; padding: 11px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-2);
  background: var(--surface-2); color: var(--muted);
  font-weight: 700; font-size: 0.88rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
}
.check-toggle.checked { background: var(--green-bg2); border-color: var(--green); color: var(--green-dim); }

/* ════════════════════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════════════════════ */

@media (min-width: 600px) {
  .bottom-nav {
    max-width: 560px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius) var(--radius) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
