/* ============================================================
   MV.GYM — design system
   Direção A "Volt Performance" (ver docs/identidade-mvgym.md)
   Trocar de direção = trocar os tokens abaixo.
   ============================================================ */

:root {
  --bg: #0B0C0E;
  --surface: #14161A;
  --surface-2: #1B1E24;
  --border: #262B33;
  --text: #F2F4F6;
  --muted: #99A1AD;
  --accent: #D7FF3E;
  --accent-ink: #0B0C0E;
  --accent-dim: rgba(215, 255, 62, 0.12);
  --danger: #FF6B6B;
  --danger-dim: rgba(255, 107, 107, 0.12);
  --ok: #3DDC97;
  --ok-dim: rgba(61, 220, 151, 0.12);
  --warn: #FBBF24;
  --warn-dim: rgba(251, 191, 36, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Archivo', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --nav-h: 64px;
  --top-h: 60px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

img, svg { display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- tipografia ---------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.wordmark .dot { color: var(--accent); }
.wordmark .gym { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout do app ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: rgba(11, 12, 14, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .wordmark { font-size: 19px; }
.topbar-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page {
  padding: calc(var(--top-h) + 18px) 16px calc(var(--nav-h) + 96px);
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
}
.page.no-fab { padding-bottom: calc(var(--nav-h) + 28px); }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: rgba(11, 12, 14, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .nav-ico { width: 22px; height: 22px; }
.bottom-nav a.active .nav-ico { filter: drop-shadow(0 0 10px rgba(215, 255, 62, 0.35)); }

/* ---------- cabeçalho de página ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.page-head .grow { flex: 1; min-width: 0; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }

.back-btn, .icon-btn {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.back-btn:hover, .icon-btn:hover { border-color: var(--muted); }
.icon-btn.danger { color: var(--danger); border-color: rgba(255,107,107,.3); }
.icon-btn.danger:hover { background: var(--danger-dim); }
.icon-btn.muted { color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  transition: transform .12s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 19px; height: 19px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .45; }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }

.btn-danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255,107,107,.28); }
.btn-danger:hover { background: rgba(255,107,107,.2); }

.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }

/* ---------- formulários ---------- */

.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* evita zoom no iOS */
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder, .textarea::placeholder { color: #5C6470; }
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2399A1AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .grid-2 { grid-template-columns: 1fr; } }

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* ---------- cards e listas ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.card-title h3 { flex: 1; }

.list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, transform .12s ease;
}
.list-item:hover { text-decoration: none; border-color: #39404B; }
.list-item:active { transform: scale(0.99); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .chev { color: var(--muted); flex-shrink: 0; }
.list-item .chev svg { width: 18px; height: 18px; }

.avatar {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
}
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar svg { width: 19px; height: 19px; }
.avatar.sm svg { width: 17px; height: 17px; }

.item-title { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- badges e chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-dim); color: var(--ok); }
.badge-warn { background: var(--warn-dim); color: var(--warn); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-accent { background: var(--accent-dim); color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip.accent { background: var(--accent-dim); border-color: rgba(215,255,62,.25); color: var(--accent); }

/* ---------- fichas ---------- */

.ficha-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.ficha-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
}
.ficha-head .grow { flex: 1; min-width: 0; }
.ficha-head .chev { color: var(--muted); transition: transform .2s ease; }
.ficha-head .chev svg { width: 18px; height: 18px; }
.ficha-card.open .ficha-head .chev { transform: rotate(180deg); }
.ficha-body {
  border-top: 1px solid var(--border);
  padding: 6px 16px 14px;
}
.ficha-accent { width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); flex-shrink: 0; }

.ex-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(38, 43, 51, 0.6);
}
.ex-row:last-child { border-bottom: none; }
.ex-num {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ex-main { flex: 1; min-width: 0; }
.ex-name { font-weight: 600; font-size: 14.5px; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ex-obs { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- exercícios combinados (bi-set / tri-set) ---------- */

.grupo-set {
  position: relative;
  margin: 6px 0;
  padding: 2px 12px 2px 14px;
  border: 1px solid rgba(215, 255, 62, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: rgba(215, 255, 62, 0.035);
}
.grupo-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0 1px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.grupo-tag svg { width: 14px; height: 14px; }
.grupo-tag .grupo-nota {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.grupo-set .ex-row { border-bottom-color: rgba(215, 255, 62, 0.14); }
.grupo-set .ex-num { background: var(--accent-dim); color: var(--accent); }

/* editor de ficha */
.card.par-combinado { border-left: 3px solid var(--accent); }
.par-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px dashed rgba(215, 255, 62, 0.35);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.par-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.par-toggle:has(input:checked) { color: var(--accent); border-style: solid; background: rgba(215, 255, 62, 0.05); }

/* ---------- programas de treino ---------- */

.prog-bloco { margin-bottom: 28px; }
.prog-bloco h2 { font-size: 16px; }

.div-letra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  margin-right: 6px;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  vertical-align: -3px;
}

.div-item { gap: 10px; }
.div-item .div-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.div-item.atual,
.ficha-card.atual { border-color: rgba(215, 255, 62, 0.35); }

/* ---------- barra de busca ---------- */

.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap .input { padding-left: 42px; }

/* ---------- FAB ---------- */

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 45;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -6px rgba(215, 255, 62, 0.35);
  transition: transform .12s ease;
}
.fab:active { transform: scale(0.94); }
.fab svg { width: 26px; height: 26px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 90;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: #1E232B;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  animation: toast-in .22s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--ok); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- sheet / modal ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 6, 8, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: sheet-up .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 4px;
  background: var(--border);
  margin: 4px auto 16px;
}
.sheet h2 { margin-bottom: 8px; }
.sheet p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.lista-instrucoes { margin: 0 0 14px; padding-left: 18px; }
.lista-instrucoes li { color: var(--text); font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.lista-instrucoes strong { color: var(--accent); }
.lista-instrucoes em { font-style: normal; color: var(--muted); }

@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--border); }
}

/* ---------- senha temporária ---------- */

.temp-pass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--accent-dim);
  border: 1px dashed rgba(215,255,62,.4);
  margin: 14px 0;
}
.temp-pass code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  word-break: break-all;
}

/* ---------- passos do import ---------- */

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.step .n {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
}
.step.active { color: var(--accent); }
.step.active .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .n { background: var(--ok-dim); border-color: transparent; color: var(--ok); }
.step-line { flex: 1; height: 1px; background: var(--border); }

.prompt-box {
  background: #0E1013;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #C7CDD6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* ---------- alertas ---------- */

.alert {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.alert-warn { background: var(--warn-dim); border: 1px solid rgba(251,191,36,.3); color: #FFD98A; }
.alert-danger { background: var(--danger-dim); border: 1px solid rgba(255,107,107,.3); color: #FFA8A8; }
.alert-ok { background: var(--ok-dim); border: 1px solid rgba(61,220,151,.3); color: #8CE9C4; }

/* ---------- empty state ---------- */

.empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--muted);
}
.empty svg { width: 44px; height: 44px; margin: 0 auto 14px; opacity: .5; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; max-width: 300px; margin: 0 auto; }

/* ---------- skeleton ---------- */

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: skeleton 1.2s linear infinite;
  height: 74px;
  margin-bottom: 10px;
}
@keyframes skeleton { to { background-position: -200% 0; } }

/* ---------- login ---------- */

.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom, 0px));
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  width: 520px; height: 420px;
  background: radial-gradient(closest-side, rgba(215,255,62,.09), transparent);
  pointer-events: none;
}
.login-brand { text-align: center; margin-bottom: 30px; position: relative; }
.login-brand .wordmark { font-size: 40px; }
.login-brand p { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 22px;
  position: relative;
}
.login-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}
.login-foot a { color: var(--muted); text-decoration: underline; }

/* ---------- boot ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.boot .wordmark { font-size: 30px; }
.spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- progresso ---------- */

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card strong { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat-card > span:last-child { font-size: 12.5px; color: var(--muted); }
.stat-card .stat-ico { color: var(--muted); margin-bottom: 6px; }
.stat-card .stat-ico svg { width: 20px; height: 20px; }
.stat-card.destaque { border-color: rgba(215, 255, 62, .35); background: rgba(215, 255, 62, .04); }
.stat-card.destaque strong,
.stat-card.destaque .stat-ico { color: var(--accent); }

.cal { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 5px; margin-top: 12px; }
.cal-dia {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--surface-2);
}
.cal-dia.on { background: var(--accent); }
.cal-dia.on.mais { box-shadow: 0 0 10px rgba(215, 255, 62, .45); }
.cal-dia[data-futuro] { opacity: .25; }
.cal-legenda { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.cal-legenda .cal-dia { width: 12px; height: 12px; aspect-ratio: auto; flex: 0 0 auto; }

/* ---------- execução de treino (modo foco) ---------- */

.page.foco { padding-top: 18px; }
.exec-wrap { padding-bottom: 96px; }

.exec-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exec-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.exec-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(215, 255, 62, .7);
  animation: pulso 1.6s ease-in-out infinite;
}
@keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.exec-top h1 { margin-top: 14px; font-size: 22px; }
.exec-timer {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 6px;
}
.exec-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  margin-top: 16px;
  overflow: hidden;
}
.exec-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}
.exec-contador { margin-top: 8px; }

.exec-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.exec-ex {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.exec-ex:active { transform: scale(.995); }
.exec-check {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.exec-check svg { width: 16px; height: 16px; }
.exec-ex.done { border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .06); }
.exec-ex.done .exec-check { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.exec-ex.done .ex-name { color: var(--muted); text-decoration: line-through; }
.exec-info { flex: 1; min-width: 0; }
.exec-info .ex-meta { margin-top: 6px; }

.exec-item { display: flex; flex-direction: column; gap: 8px; }
.exec-log { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.exec-log-input {
  width: 92px;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 14px;
  text-align: center;
  border-radius: 10px;
}
.exec-log-x { color: var(--muted); font-size: 13px; }
.exec-item.done .exec-log-input { opacity: .55; }
.chip.ref { gap: 5px; color: var(--accent); border-color: rgba(215, 255, 62, .25); background: var(--accent-dim); }
.chip.ref svg { width: 13px; height: 13px; }

.exec-grupo {
  border: 1px dashed rgba(215, 255, 62, .25);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(215, 255, 62, .03);
}
.exec-grupo .grupo-tag { margin-bottom: 0; }
.exec-grupo .exec-ex { border-radius: var(--radius-sm); }

.exec-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 12, 14, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.exec-footer .btn { max-width: 680px; margin: 0 auto; }

.exec-resumo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
}
.exec-resumo-ico {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--ok-dim);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.exec-resumo-ico svg { width: 38px; height: 38px; }
.exec-resumo h1 { font-size: 26px; }
.exec-resumo > p { margin-top: 6px; }
.exec-stats { display: flex; gap: 12px; margin-top: 24px; width: 100%; }
.exec-stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exec-stat strong { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.exec-stat span { font-size: 12px; color: var(--muted); }
.exec-resumo .btn { width: 100%; max-width: 680px; }
.exec-acoes { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 24px; }

/* ---------- execução enxuta (nome + check + seta) ---------- */
.exec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 12px 14px;
}
.exec-item.done .exec-row { border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .06); }
.exec-check {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  flex-shrink: 0;
  padding: 0;
}
.exec-check svg { width: 16px; height: 16px; }
.exec-item.done .exec-check { background: var(--ok); border-color: var(--ok); }
.ex-name { flex: 1; min-width: 0; font-weight: 600; }
.exec-item.done .ex-name { color: var(--muted); text-decoration: line-through; }
.exec-toggle {
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px;
  display: flex;
  flex-shrink: 0;
  transition: transform .2s ease, color .2s ease;
}
.exec-toggle svg { width: 20px; height: 20px; }
.exec-toggle[aria-expanded="true"] { transform: rotate(180deg); color: var(--accent); }
.exec-panel { display: flex; flex-direction: column; gap: 10px; padding: 10px 2px 2px; }
.exec-panel-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.exec-panel-meta:empty { display: none; }

/* ---------- calendário mensal ---------- */
.cal-mes {
  grid-template-rows: none;
  grid-auto-flow: row;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 6px; }
.cal-dow span { font-weight: 700; }
.cal-mes .cal-dia {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid transparent;
  background: var(--surface-2);
  padding: 0;
}
.cal-mes .cal-dia.vazio { background: transparent; }
.cal-mes .cal-dia.on { background: var(--accent); color: var(--accent-ink); }
.cal-mes .cal-dia.on.mais { box-shadow: 0 0 10px rgba(215, 255, 62, .45); }
.cal-mes .cal-dia.hoje { border-color: var(--accent); }
.cal-mes .cal-dia.futuro { opacity: .3; }
.cal-mes .cal-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 14px; height: 14px;
  border-radius: 999px;
  background: #0B0C0E;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* ---------- treino livre ---------- */
.livre-banner {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-color: rgba(215, 255, 62, .35);
  background: rgba(215, 255, 62, .04);
  margin-bottom: 12px;
}
.livre-banner .bold { display: flex; align-items: center; gap: 8px; }
.livre-banner .bold svg { width: 18px; height: 18px; color: var(--accent); }

/* ---------- treino de hoje (destaque no topo) ---------- */
.hoje-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.hoje-card .hoje-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.15;
}
.hoje-card .hoje-titulo .div-letra {
  min-width: 28px;
  height: 28px;
  margin-right: 0;
  border-radius: 9px;
  font-size: 15px;
}

/* ---------- imagem do story (overlay) ---------- */
.story-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.story-sheet {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.story-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.story-canvas-wrap { overflow-y: auto; background: #0B0C0E; padding: 10px; }
.story-canvas { width: 100%; height: auto; border-radius: 10px; display: block; }
.story-acoes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
}

/* ---------- utilidades ---------- */

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-center { text-align: center; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.link-arrow svg { width: 16px; height: 16px; }

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