/* ============================================================
   PÁGINA DE PERFIL (dashboard.html) — estilo app mobile
   Layout idêntico à referência enviada, com as cores da MetaRun
   ============================================================ */

/* Remove as setinhas de incremento/decremento dos inputs numéricos */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

:root {
  --profile-accent: var(--orange);
  --profile-accent-dark: var(--orange-light);
  --profile-glow: rgba(255, 107, 53, 0.45);
}

.profile-page-body {
  background: var(--dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding-bottom: 90px;
  overflow-x: hidden;
  overflow-y: auto !important;
}

.profile-app {
  width: 100%;
  max-width: 480px;
  padding: 0 18px;
  min-width: 0;
}

/* O design é baseado numa referência de celular (mockup que a cliente
   mandou), então no celular fica exatamente 480px como pedido. Só que no
   PC essa faixa fina no meio de uma tela gigante parecia "cortada"/
   errada — aqui é só uma esticadinha progressiva pra telas maiores
   aproveitarem mais espaço, sem mudar o layout em si (mesmas colunas,
   mesmos cards, só mais largos e respirando mais). */
@media (min-width: 640px) {
  .profile-app {
    max-width: 600px;
  }
}

@media (min-width: 1000px) {
  .profile-app {
    max-width: 720px;
  }
}

@media (min-width: 1400px) {
  .profile-app {
    max-width: 820px;
  }
}

/* TOPBAR */
.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 4px 10px;
}

.profile-topbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.profile-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  font-size: 1.1rem;
  transition: 0.2s ease;
}

.profile-icon-btn:hover {
  color: var(--profile-accent);
  border-color: var(--profile-glow);
}

/* HEADER CARD */
.profile-header-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  padding: 26px 18px 20px;
  margin-bottom: 16px;
  min-width: 0;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.profile-avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--profile-accent);
  box-shadow: 0 0 16px var(--profile-glow);
}

.profile-avatar-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--profile-accent);
  box-shadow: 0 0 16px var(--profile-glow);
  background: var(--dark3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 1.6rem;
}

.profile-avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--dark2);
  color: var(--profile-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border: 2px solid var(--profile-accent);
  transition: 0.2s ease;
}

.profile-avatar-edit:hover {
  background: var(--profile-accent);
  color: var(--black);
}

@media (hover: none) {
  .profile-avatar-edit {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }
}

.profile-header-info {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
  max-width: 100%;
}

.profile-name {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-level-badge {
  background: var(--profile-accent);
  color: var(--black);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--profile-glow);
}

.profile-tagline {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 14px;
}

.profile-xp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.profile-xp-track {
  flex: 1;
  height: 7px;
  background: var(--dark3);
  border-radius: 99px;
  overflow: hidden;
}

.profile-xp-fill {
  height: 100%;
  background: var(--profile-accent);
  border-radius: 99px;
  box-shadow: 0 0 8px var(--profile-glow);
}

.profile-xp-text {
  font-size: 0.68rem;
  color: var(--gray-400);
  white-space: nowrap;
  font-weight: 600;
}

/* STATS GRID */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.profile-stat-card {
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.profile-stat-card i {
  color: var(--profile-accent);
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px var(--profile-glow));
}

.profile-stat-card strong {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
}

.profile-stat-card span {
  font-size: 0.6rem;
  color: var(--gray-400);
  line-height: 1.3;
}

/* SECTIONS */
.profile-section {
  margin-bottom: 26px;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.profile-section-header h2 {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

.profile-section-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--profile-accent);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* MEDALHAS */
.profile-medals-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.profile-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 74px;
  text-align: center;
}

.profile-medal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--white);
  position: relative;
  line-height: 1.1;
}

.medal-gold {
  background: linear-gradient(135deg, #f5c542, #d99a1b);
}

.medal-blue {
  background: linear-gradient(135deg, #5aa9ff, #2f7de0);
}

.medal-teal {
  background: linear-gradient(135deg, #38d9a9, #12a884);
}

.medal-orange {
  background: linear-gradient(135deg, #ff9a5a, #ff6b35);
}

.medal-purple {
  background: linear-gradient(135deg, #b18cf5, #8b5cf6);
}

.medal-star {
  position: absolute;
  top: -4px;
  font-size: 0.7rem;
  color: #fff9c4;
}

.profile-medal-title {
  font-size: 0.66rem;
  color: var(--gray-300);
  font-weight: 600;
  line-height: 1.3;
}

/* ---- MEDALHAS DESBLOQUEADAS: brilho colorido + hover ---- */
.profile-medal-icon.medal-gold {
  box-shadow: 0 0 20px rgba(245, 197, 66, 0.45);
}

.profile-medal-icon.medal-blue {
  box-shadow: 0 0 20px rgba(90, 169, 255, 0.45);
}

.profile-medal-icon.medal-teal {
  box-shadow: 0 0 20px rgba(56, 217, 169, 0.45);
}

.profile-medal-icon.medal-orange {
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.45);
}

.profile-medal-icon.medal-purple {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45);
}

.profile-medal:not(.locked) {
  cursor: default;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-medal:not(.locked):hover {
  transform: translateY(-4px) scale(1.06);
}

.profile-medal:not(.locked):hover .profile-medal-icon {
  filter: brightness(1.08);
}

/* Pequeno brilho "correndo" pela medalha desbloqueada, pra dar vida sem
   depender só do GSAP (roda sempre; o GSAP entra na entrada/desbloqueio) */
.profile-medal-icon.medal-gold,
.profile-medal-icon.medal-blue,
.profile-medal-icon.medal-teal,
.profile-medal-icon.medal-orange,
.profile-medal-icon.medal-purple {
  position: relative;
  overflow: hidden;
}

.profile-medal-icon.medal-gold::after,
.profile-medal-icon.medal-blue::after,
.profile-medal-icon.medal-teal::after,
.profile-medal-icon.medal-orange::after,
.profile-medal-icon.medal-purple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  background-size: 220% 220%;
  background-position: -100% -100%;
  animation: medalShine 3.2s ease-in-out infinite;
}

@keyframes medalShine {

  0%,
  30% {
    background-position: -100% -100%;
  }

  55% {
    background-position: 100% 100%;
  }

  100% {
    background-position: 100% 100%;
  }
}

/* ---- Conquistas (lista) com a mesma cor da medalha ---- */
.profile-achievement-icon.medal-gold,
.profile-achievement-icon.medal-blue,
.profile-achievement-icon.medal-teal,
.profile-achievement-icon.medal-orange,
.profile-achievement-icon.medal-purple {
  color: var(--white);
}

/* CONQUISTAS */
.profile-achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 14px;
  padding: 12px 14px;
}

.profile-achievement-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--gray-400);
  background: var(--dark3);
  flex-shrink: 0;
  transition: background .2s ease, color .2s ease;
}

.profile-achievement-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-achievement-info strong {
  font-size: 0.82rem;
  color: var(--white);
  font-weight: 700;
}

.profile-achievement-info span {
  font-size: 0.72rem;
  color: var(--gray-400);
}

.profile-achievement-date {
  font-size: 0.68rem;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Espaço reservado antes da barra de navegação fixa do rodapé — o valor
   anterior (70px) ainda deixava o final de cards mais longos (tipo Plano,
   Admin) perto demais da barra fixa. Aumentado bem mais pra garantir uma
   folga clara e visível em qualquer aba/página. */
.profile-bottom-spacer {
  height: 140px;
}

/* BOTÃO FLUTUANTE DO CONSOLE (só admin) */
#adminConsoleFab {
  position: fixed;
  right: 20px;
  bottom: 110px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
  z-index: 150;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#adminConsoleFab:hover {
  transform: scale(1.08);
}

/* BOTÃO FLUTUANTE DE CONTATO (todo mundo vê) — fica acima do de admin,
   pra nunca sobrepor quando os dois aparecem juntos pra uma conta admin */
#contactFab {
  position: fixed;
  right: 20px;
  bottom: 172px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
  z-index: 150;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#contactFab:hover {
  transform: scale(1.08);
}

/* BOTTOM NAV — fundo var(--dark), mais escuro que os cards (var(--dark2)),
   de propósito: antes os dois usavam a mesma cor, então se algum conteúdo
   encostasse na barra, ficava invisível ("grudado"), sem nenhuma quebra
   visual. Com cores diferentes + sombra por cima, a barra sempre aparece
   destacada do conteúdo, não importa o quão perto ele chegue. */
.profile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  border-top: 1px solid var(--dark-border);
  box-shadow: 0 -16px 24px -12px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 8px 14px;
  z-index: 100;
}

.profile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--gray-500);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.profile-nav-item i {
  font-size: 1.15rem;
}

.profile-nav-item.active,
.profile-nav-item:hover {
  color: var(--profile-accent);
}

@media (max-width: 420px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- LOCKED MEDAL (ainda não conquistada) ---- */
.profile-medal.locked .profile-medal-icon {
  background: var(--dark3);
  border: 1px solid var(--dark-border);
  color: var(--gray-500);
  box-shadow: none;
}

.profile-medal.locked .profile-medal-lock {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--gray-400);
}

.profile-medal.locked .profile-medal-title {
  color: var(--gray-500);
}

/* ---- EMPTY STATE ---- */
.profile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px;
  background: var(--dark2);
  border: 1px dashed var(--dark-border);
  border-radius: 16px;
}

.profile-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark3);
  color: var(--profile-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.profile-empty-state strong {
  font-size: 0.88rem;
  color: var(--white);
  font-weight: 700;
}

.profile-empty-state span {
  font-size: 0.78rem;
  color: var(--gray-400);
  line-height: 1.5;
  max-width: 280px;
}

.profile-empty-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--profile-accent);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 99px;
  box-shadow: 0 0 14px var(--profile-glow);
}

/* ---- GREETING (Início) ---- */
.profile-greeting {
  margin-bottom: 18px;
}

.profile-greeting h1 {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 2px;
}

.profile-greeting p {
  font-size: 0.82rem;
  color: var(--gray-400);
}

/* ---- QUICK ACTIONS (Início) ---- */
.profile-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.profile-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  transition: 0.2s ease;
}

.profile-quick-action:hover {
  border-color: var(--profile-accent);
}

.profile-quick-action i {
  font-size: 1.3rem;
  color: var(--profile-accent);
  filter: drop-shadow(0 0 6px var(--profile-glow));
}

.profile-quick-action strong {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 700;
}

/* ---- WEEK PLAN LIST (Treinos) ---- */
.profile-week-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-week-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 14px;
  padding: 12px 14px;
}

.profile-week-day {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dark3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gray-400);
  flex-shrink: 0;
}

.profile-week-info {
  flex: 1;
  min-width: 0;
}

.profile-week-info strong {
  display: block;
  font-size: 0.82rem;
  color: var(--white);
  font-weight: 700;
}

.profile-week-info span {
  font-size: 0.72rem;
  color: var(--gray-500);
}

/* Dia de hoje em destaque + tipo de treino colorido (reaproveita as
   cores de medal-* já usadas em Conquistas, pra manter a mesma
   linguagem visual em vez de inventar uma paleta nova) */
.profile-week-row.is-today {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange-glow);
}

.profile-week-delete-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dark3);
  border: 1px solid var(--dark-border);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-week-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

@media (hover: none) {
  .profile-week-delete-btn {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

.profile-week-day.medal-gold,
.profile-week-day.medal-blue,
.profile-week-day.medal-teal,
.profile-week-day.medal-orange,
.profile-week-day.medal-purple {
  color: var(--white);
}

/* ---- PROGRESS PLACEHOLDER CHART (Progresso) ---- */
.profile-chart-card {
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.profile-chart-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.profile-chart-placeholder {
  height: 90px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, var(--dark3) 0 1px, transparent 1px 24px);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.profile-chart-placeholder .bar {
  width: 8%;
  background: var(--dark3);
  border-radius: 4px 4px 0 0;
  margin-right: 2%;
}

/* ---- MODAL DE CONFIRMAÇÃO (Sair, Excluir conta, etc) ---- */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.app-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.app-modal {
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 22px;
  padding: 34px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(24px) scale(0.94);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.app-modal-overlay.show .app-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.app-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--dark3);
  color: var(--profile-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.app-modal-icon--danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red, #ef4444);
}

.app-modal-title {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
}

.app-modal-text {
  font-size: 0.82rem;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 20px;
}

.app-modal-confirm-label {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-bottom: 8px;
  text-align: left;
}

.app-modal-confirm-label strong {
  color: var(--white);
  letter-spacing: 0.05em;
}

.app-modal-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1.5px solid var(--dark-border);
  background: var(--dark3);
  color: var(--white);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.app-modal-input:focus {
  border-color: var(--red, #ef4444);
}

.app-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 9999px;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: filter 0.15s ease, transform 0.12s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.app-modal-btn:active {
  transform: scale(0.97);
}

.app-modal-btn--ghost {
  background: var(--dark3);
  color: var(--gray-300);
}

.app-modal-btn--ghost:hover {
  background: var(--dark-border);
}

.app-modal-btn--danger {
  background: var(--red, #ef4444);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(239, 68, 68, 0.5);
}

.app-modal-btn--danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.app-modal-btn--danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Treino ainda pendente pode ser clicado pra abrir o detalhe */
.training-workout-row {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.training-workout-row:hover {
  border-color: var(--gray-600);
  transform: translateY(-1px);
}

/* ---- MODAL DE DETALHE DO TREINO (Passo a passo / Resumo) ---- */
.workout-modal {
  max-width: 420px;
  text-align: left;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.workout-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark3);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.workout-modal-close:hover {
  color: var(--white);
}

.workout-modal-name {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
  padding-right: 30px;
}

.workout-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 20px;
}

.workout-modal-meta>span {
  background: var(--dark3);
  padding: 5px 10px;
  border-radius: 999px;
}

.workout-modal-pace-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dark3);
  padding: 5px 10px;
  border-radius: 999px;
}

.workout-unit-toggle {
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
}

.workout-modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--dark-border);
}

.workout-tab {
  padding: 10px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.workout-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.workout-tab-panel {
  display: none;
}

.workout-tab-panel.active {
  display: block;
}

.workout-step {
  margin-bottom: 16px;
}

.workout-step strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin-bottom: 4px;
}

.workout-step p {
  font-size: 0.86rem;
  color: var(--gray-300);
  line-height: 1.5;
  margin: 0;
}

.workout-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--dark-border);
  font-size: 0.82rem;
}

.workout-summary-row:last-child {
  border-bottom: none;
}

.workout-summary-row span {
  color: var(--gray-500);
}

.workout-summary-row strong {
  color: var(--white);
}

.workout-modal-done {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-border);
  text-align: center;
}

.workout-modal-done p {
  font-size: 0.85rem;
  color: var(--white);
  font-weight: 600;
  margin-bottom: 12px;
}

.workout-done-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.workout-done-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.workout-done-btn--yes {
  background: #22c55e;
  color: #fff;
}

.workout-done-btn--no {
  background: var(--dark3);
  color: var(--gray-300);
}

.workout-modal-form {
  display: none;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-border);
}

.workout-modal-form .onb-field {
  margin-bottom: 14px;
}

.workout-modal-form .onb-field label {
  font-size: 0.75rem;
  color: var(--gray-400);
  display: block;
  margin-bottom: 6px;
}

.workout-modal-form .onb-field input {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-size: 0.9rem;
}

.workout-form-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}

.workout-modal-done-msg {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--gray-400);
  text-align: center;
}

/* Confete da celebração de objetivo concluído — absoluto, sem bloquear clique */
.goal-confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

/* ---- CLASSES DO ONBOARDING REAPROVEITADAS NO MODAL "NOVO OBJETIVO" ----
   (versão local, sem o body{} global de onboarding.css, que quebraria o
   layout do app-shell se importado direto nessa página) */
.onb-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onb-options.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.onb-option-btn {
  background: var(--dark3);
  border: 2px solid var(--dark-border);
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--white);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.onb-option-btn:hover {
  border-color: var(--orange);
}

.onb-option-btn.selected {
  border-color: var(--orange);
  background: var(--orange-glow);
}

.onb-option-btn i {
  font-size: 1.1rem;
  color: var(--orange);
}

.onb-option-btn.compact {
  padding: 10px;
  justify-content: center;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.onb-subform {
  display: none;
}

.onb-subform.active {
  display: block;
}

.onb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.onb-field label {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.onb-field input {
  background: var(--dark3);
  border: 1px solid var(--dark-border);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9rem;
  outline: none;
}

.onb-field input:focus {
  border-color: var(--orange);
}

/* --- MOBILE POLISH --- */
@media (max-width: 480px) {
  .profile-page-body {
    padding-bottom: 70px !important;
  }

  .profile-app {
    padding: 16px !important;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .profile-stat-card {
    padding: 12px !important;
  }
}

/* Em tela de toque não tem hover pra "avisar" que é clicável — aumenta
   um pouco os alvos de toque pequenos demais */
@media (hover: none) {
  .profile-avatar-edit {
    width: 34px;
    height: 34px;
  }

  .profile-week-delete-btn {
    width: 36px;
    height: 36px;
  }
}

/* Scrollbar com a cara da marca, igual a landing page */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--orange) var(--dark);
}

::-webkit-scrollbar {
  width: 11px;
}

::-webkit-scrollbar-track {
  background: var(--dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--orange), var(--orange-deep, #E85C28));
  border-radius: 10px;
  border: 3px solid var(--dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--orange-light, #FF8C5E);
}