/* =========================================================
   CORE.CSS — Correr Lisboa Performance Center
   Versão reorganizada com Admin Command Center
   ---------------------------------------------------------
   O que este ficheiro faz:
   1. Define base global, layout, tipografia e utilitários
   2. Mantém a área do atleta funcional
   3. Reorganiza o admin com navegação premium e submenus
   4. Normaliza cards, KPIs, forms, listas e estados
   5. Inclui responsive para mobile/tablet
   ========================================================= */

/* =========================================================
   01. RESET / BASE GLOBAL
   ---------------------------------------------------------
   Normaliza comportamento visual base em todas as páginas.
   ========================================================= */

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* =========================================================
   02. LAYOUT GLOBAL
   ---------------------------------------------------------
   Estruturas comuns: página, container e shell larga.
   ========================================================= */

.page {
  min-height: 100vh;
  padding: 18px 22px 42px;
  background:
    radial-gradient(circle at top right, rgba(255,212,0,.16), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.athlete-shell {
  max-width: 1180px;
}

.section {
  margin-bottom: 28px;
}

.hidden {
  display: none !important;
}

/* =========================================================
   03. BRAND / IDENTIDADE
   ---------------------------------------------------------
   Logótipo CL usado no admin, atleta e footer.
   ========================================================= */

.brand,
.mini-brand,
.athlete-clean-brand,
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.athlete-clean-logo {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 15px;
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 18px;
}

.athlete-clean-logo {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
}

/* =========================================================
   04. TIPOGRAFIA GLOBAL
   ---------------------------------------------------------
   Títulos, parágrafos, tags e alinhamentos.
   ========================================================= */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(42px, 9vw, 72px);
  line-height: .9;
  letter-spacing: -2px;
  margin-bottom: 18px;
  font-weight: 950;
}

h2 {
  font-size: 28px;
  margin-bottom: 18px;
}

h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.text-primary {
  color: var(--primary);
}

.text-center {
  text-align: center;
}

.tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255,212,0,.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* =========================================================
   05. BOTÕES
   ---------------------------------------------------------
   Botões globais usados no admin e atleta.
   ========================================================= */

.btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-small {
  width: auto;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

/* =========================================================
   06. CARDS / COMPONENTES BASE
   ---------------------------------------------------------
   Cards, cabeçalhos de cards e links internos.
   ========================================================= */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.dashboard-card {
  max-width: none;
  margin: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-head h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.card-head p {
  margin-bottom: 0;
  font-size: 14px;
}

.card-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

/* =========================================================
   07. KPI / MÉTRICAS
   ---------------------------------------------------------
   Blocos de números para dashboards e perfis.
   ========================================================= */

.dashboard-grid,
.dashboard-grid.compact,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.kpi,
.kpi-card {
  background: linear-gradient(180deg, var(--card), var(--card-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.kpi-label,
.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.kpi-value,
.kpi-card strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
  margin-bottom: 10px;
  color: var(--primary);
}

.kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

.kpi-link {
  color: var(--text);
  transition: .2s ease;
}

.kpi-link:hover {
  transform: translateY(-3px);
  border-color: rgba(255,212,0,.35);
  box-shadow: var(--glow);
}

/* =========================================================
   08. LISTAS / STATUS / AÇÕES RÁPIDAS
   ---------------------------------------------------------
   Listas de estados, atividades e ações rápidas.
   ========================================================= */

.status-list,
.activity-list,
.quick-actions,
.plan-session-list,
.workout-structure,
.workout-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.status-item:last-child {
  border-bottom: 0;
}

.status-item span,
.status-item strong {
  font-size: 14px;
}

.status-item span {
  color: var(--muted);
}

.status-item strong {
  color: var(--text);
}

.quick-action {
  display: block;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

.quick-action strong {
  display: block;
  font-weight: 900;
  margin-bottom: 5px;
}

.quick-action span {
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   09. BADGES / ESTADOS VISUAIS
   ---------------------------------------------------------
   Etiquetas pequenas: sucesso, alerta, perigo.
   ========================================================= */

.mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(255,255,255,.08);
  color: var(--muted);
}

.mini-badge.success {
  background: rgba(104, 211, 145, .15);
  color: #68d391;
}

.mini-badge.yellow {
  background: rgba(255, 212, 0, .15);
  color: var(--primary);
}

.mini-badge.danger {
  background: rgba(255, 107, 107, .15);
  color: #ff6b6b;
}

/* =========================================================
   10. FORMS / INPUTS
   ---------------------------------------------------------
   Inputs, labels, mensagens e ações de formulário.
   ========================================================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group.full {
  grid-column: 1 / -1;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  color: var(--text);
  padding: 0 15px;
  font-size: 15px;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
}

textarea.input {
  min-height: 110px;
  padding-top: 14px;
  resize: vertical;
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.message {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: none;
  font-weight: 700;
}

.message.ok {
  background: rgba(104, 211, 145, .15);
  color: #68d391;
  border: 1px solid rgba(104, 211, 145, .25);
}

.message.error {
  background: rgba(255, 107, 107, .15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, .25);
}

.checkbox-line a,
.legal-content a {
  color: var(--primary);
  font-weight: 700;
}

/* =========================================================
   11. ESTADOS GERAIS
   ---------------------------------------------------------
   Loading, vazio e caixas JSON/debug.
   ========================================================= */

.loading {
  padding: 30px 0;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}

.empty small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.json-box {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
/* =========================================================
   12. ADMIN — COMMAND CENTER NAVIGATION
   ========================================================= */

.admin-page {
  padding: 20px;
  overflow-x: hidden;
}

.admin-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 42px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255,212,0,.13), transparent 34%),
    rgba(10,10,10,.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 70px rgba(0,0,0,.35);
}

.admin-header .mini-brand {
  min-width: 170px;
}

.admin-header .brand-text {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.05;
}

.admin-header .brand-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.admin-menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.07);
  color: var(--text);
  border-radius: 16px;
  min-height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
}

.admin-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.nav-group {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: -12px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  transition: .2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.07);
}

.nav-link.active {
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: 0 10px 28px rgba(255,212,0,.22);
}

.nav-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 230px;
  padding: 12px 10px 10px;
  border-radius: 20px;
  background: rgba(15,15,15,.98);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 24px 70px rgba(0,0,0,.50);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-submenu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.nav-submenu a:hover {
  color: var(--primary);
  background: rgba(255,212,0,.10);
}

.admin-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}

.nav-logout:hover {
  color: #ff6b6b;
  background: rgba(255,107,107,.10);
}

/* MOBILE MENU SIMPLES */

.admin-mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .admin-header {
    top: 10px;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 10px;
    border-radius: 22px;
  }

  .admin-header .mini-brand {
    min-width: 0;
  }

  .admin-header .brand-mark {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
  }

  .admin-header .brand-text {
    font-size: 15px;
  }

  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .admin-nav,
  .admin-header-actions {
    display: none !important;
  }

  .admin-mobile-nav {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .admin-header.mobile-open .admin-mobile-nav {
    display: grid;
  }

  .admin-mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text);
    font-weight: 900;
  }

  .admin-mobile-nav a:hover {
    color: var(--primary);
    background: rgba(255,212,0,.10);
  }

  .admin-mobile-nav a.danger {
    justify-content: center;
    color: #ff6b6b;
  }
}
/* =========================================================
   13. ATHLETE HEADER
   ---------------------------------------------------------
   Header limpo da área do atleta.
   ========================================================= */

.athlete-clean-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 34px;
}

.athlete-clean-brand {
  color: var(--text);
  flex: 0 0 auto;
}

.athlete-clean-text strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.05;
}

.athlete-clean-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.athlete-clean-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.athlete-clean-menu::-webkit-scrollbar {
  display: none;
}

.athlete-clean-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition: .2s ease;
}

.athlete-clean-menu a:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.athlete-clean-menu a.active {
  background: var(--primary);
  color: var(--primary-text);
}

.athlete-clean-exit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  transition: .2s ease;
}

.athlete-clean-exit:hover {
  color: #ff6b6b;
  background: rgba(255,107,107,.10);
}

.athlete-menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}

/* =========================================================
   14. HERO / PÁGINA ATLETA
   ---------------------------------------------------------
   Hero da área do atleta e ações principais.
   ========================================================= */

.athlete-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  position: relative;
  margin-bottom: 34px;
}

.athlete-page-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,212,0,.15), transparent 70%);
  pointer-events: none;
}

.athlete-page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: .95;
  letter-spacing: -1.4px;
  margin-bottom: 14px;
}

.athlete-page-hero p {
  max-width: 680px;
  font-size: 14px;
}

.athlete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* =========================================================
   15. DASHBOARD ATLETA / GARMIN
   ---------------------------------------------------------
   Grid principal do dashboard do atleta.
   ========================================================= */

.athlete-dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  align-items: start;
}

.athlete-dashboard-grid .full-row {
  grid-column: 1 / -1;
}

.today-workout-box {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.today-workout-box h3 {
  margin: 14px 0 8px;
  font-size: 20px;
}

.garmin-card {
  position: relative;
  overflow: hidden;
}

.garmin-card::before {
  content: "";
  position: absolute;
  inset: -80px -80px auto auto;
  width: 180px;
  height: 180px;
  background: rgba(255,212,0,.10);
  border-radius: 999px;
  pointer-events: none;
}

.garmin-card .btn-ghost:hover {
  color: #ff6b6b;
  background: rgba(255,107,107,.08);
}

/* =========================================================
   16. PERFIL / MÉTRICAS / AVATAR
   ---------------------------------------------------------
   Componentes visuais do perfil de atleta.
   ========================================================= */

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-meta-item,
.info-box,
.activity-row {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
}

.profile-meta-item span,
.info-box span,
.activity-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.profile-meta-item span {
  font-size: 12px;
  margin-bottom: 6px;
}

.profile-meta-item strong,
.info-box strong,
.activity-row strong {
  display: block;
  font-size: 16px;
}

.profile-meta-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.athlete-profile-card {
  padding: 26px;
}

.athlete-profile-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.athlete-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 20px;
  text-transform: uppercase;
}

.athlete-avatar.large {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 28px;
}

/* =========================================================
   17. ATIVIDADES
   ---------------------------------------------------------
   Lista, linha e estatísticas de atividades.
   ========================================================= */

.activities-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.activity-row p {
  margin-top: 8px;
  margin-bottom: 0;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 220px;
}

.activity-link {
  text-decoration: none;
  color: var(--text);
  transition: .2s ease;
}

.activity-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,0,.35);
  box-shadow: var(--glow);
}

.activity-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.activity-inline-stats span {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

/* =========================================================
   18. PLANOS / DETALHE DE TREINO
   ---------------------------------------------------------
   Página do plano e detalhe de sessão.
   ========================================================= */

.plan-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}

.plan-grid .full-row {
  grid-column: 1 / -1;
}

.plan-session-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  border: 1px solid var(--border);
}

.plan-session-date strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.plan-session-date span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.plan-session-main h3,
.workout-block h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.plan-session-main p,
.workout-block p {
  margin-bottom: 0;
  font-size: 14px;
}

.plan-session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workout-block {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  border: 1px solid var(--border);
}

.workout-step {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
}

.workout-step strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.workout-step span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   19. RECORDES
   ---------------------------------------------------------
   Grelha de recordes e cards associados.
   ========================================================= */

.records-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.records-grid .full-row {
  grid-column: 1 / -1;
}

.record-card {
  min-height: 170px;
}

.record-card .card-link {
  display: inline-flex;
  margin-top: 12px;
}

/* =========================================================
   20. EDIÇÃO DE PERFIL
   ---------------------------------------------------------
   Layout corrigido para página de perfil/formulários longos.
   ========================================================= */

.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
}

.profile-edit-grid > .card,
.profile-edit-grid .footer-actions,
.profile-edit-grid .full-width,
.profile-edit-grid > section.card {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1;
}

.profile-edit-grid .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}

.profile-edit-grid .input-group.full {
  grid-column: 1 / -1;
}

.profile-edit-grid .input,
.profile-edit-grid select,
.profile-edit-grid textarea {
  width: 100%;
  box-sizing: border-box;
}

.profile-edit-grid textarea.input {
  min-height: 120px;
  resize: vertical;
}

/* =========================================================
   21. ONBOARDING
   ---------------------------------------------------------
   Layout para onboarding inicial do atleta.
   ========================================================= */

.onboarding-container {
  max-width: 820px;
}

.onboarding-header {
  margin-bottom: 42px;
}

.onboarding-hero {
  max-width: 720px;
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.onboarding-card {
  padding: 26px;
}

.onboarding-card h2 {
  margin-bottom: 20px;
}

.onboarding-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.choice-card {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  color: var(--text);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,0,.35);
  box-shadow: var(--glow);
}

.choice-card strong {
  display: block;
  font-size: 17px;
  margin-bottom: 8px;
}

.choice-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* =========================================================
   22. PÁGINAS LEGAIS
   ---------------------------------------------------------
   Termos, privacidade e conteúdos longos.
   ========================================================= */

.legal-content h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal-content h3 {
  margin-top: 18px;
  margin-bottom: 8px;
}

.legal-content p {
  line-height: 1.7;
  margin-bottom: 14px;
}

/* =========================================================
   23. FOOTER PREMIUM ATLETA
   ---------------------------------------------------------
   Footer com links, marca e nota final.
   ========================================================= */

.athlete-premium-footer {
  margin-top: 44px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at top left, rgba(255,212,0,.13), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  box-shadow: 0 24px 70px rgba(0,0,0,.36);
  overflow: hidden;
}

.footer-brand {
  padding: 28px 28px 0;
}

.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.footer-brand span {
  color: var(--muted);
  font-size: 13px;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 28px;
  padding: 28px;
}

.footer-columns nav {
  display: grid;
  gap: 12px;
}

.footer-columns nav strong {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .12em;
}

.footer-columns nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.footer-columns nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   24. SHORTCUTS DE PERFIL
   ---------------------------------------------------------
   Cards de acesso rápido usados no perfil.
   ========================================================= */

.profile-shortcuts {
  max-width: 1120px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.profile-shortcut-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,212,0,.10), transparent 42%),
    rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  color: inherit;
  text-decoration: none;
  transition: .2s ease;
}

.profile-shortcut-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,0,.35);
}

.profile-shortcut-card span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.profile-shortcut-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.profile-shortcut-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

/* =========================================================
   25. UTILITÁRIOS
   ---------------------------------------------------------
   Pequenas classes reutilizáveis.
   ========================================================= */

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* =========================================================
   26. RESPONSIVE — TABLET
   ---------------------------------------------------------
   Ajustes gerais até 980px.
   ========================================================= */

@media (max-width: 980px) {
  .admin-page {
    padding: 14px;
    overflow-x: hidden;
  }

  .admin-header {
    position: sticky;
    top: 10px;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 28px;
    padding: 10px;
    border-radius: 22px;
    overflow: visible;
  }

  .admin-header .mini-brand {
    min-width: 0;
    max-width: calc(100vw - 160px);
  }

  .admin-header .brand-mark {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
  }

  .admin-header .brand-text {
    font-size: 15px;
    line-height: 1.05;
  }

  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 16px;
    background: rgba(255,255,255,.07);
  }

  .admin-nav {
    grid-column: 1 / -1;
    position: static;
    display: none;
    width: 100%;
    max-width: 100%;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 8px;
    padding: 0 2px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .admin-nav.is-open {
    display: flex;
  }

  .nav-group {
    width: 100%;
    padding: 0;
    margin: 0;
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.075);
    overflow: hidden;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
  }

  .nav-link.active {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: none;
  }

  .nav-submenu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    min-width: 0;
    width: 100%;
    display: block;
    margin: 0;
    padding: 8px 10px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-group:hover .nav-submenu,
  .nav-group:focus-within .nav-submenu,
  .nav-submenu:hover {
    transform: none;
  }

  .nav-submenu a {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 14px;
  }

  .nav-submenu a:hover {
    color: var(--primary);
    background: rgba(255,212,0,.10);
  }

  .admin-header-actions {
    grid-column: 1 / -1;
    display: none;
    position: static;
    width: 100%;
    justify-content: stretch;
  }

  .admin-header.menu-open .admin-header-actions {
    display: flex;
  }

  .nav-logout {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    padding: 0 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--border);
  }

  .athlete-clean-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
  }

  .athlete-clean-brand {
    min-width: 0;
  }

  .athlete-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .athlete-clean-menu {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    margin-left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: visible;
  }

  .athlete-clean-menu.is-open {
    display: flex;
  }

  .athlete-clean-menu a {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
  }

  .athlete-clean-exit {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    text-align: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.035);
  }

  .athlete-clean-header.menu-open .athlete-clean-exit {
    display: flex;
  }

  .athlete-dashboard-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .dashboard-grid.compact,
  .profile-meta-grid {
    grid-template-columns: 1fr;
  }

  .athlete-page-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .athlete-actions {
    justify-content: flex-start;
  }

  .records-grid {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .profile-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 981px) {
  .athlete-clean-menu {
    display: flex !important;
  }
}

/* =========================================================
   27. RESPONSIVE — MOBILE
   ---------------------------------------------------------
   Ajustes para telemóvel.
   ========================================================= */

@media (max-width: 700px) {
  .page,
  .admin-page {
    padding: 14px;
  }

  .admin-header {
    top: 10px;
    padding: 10px;
  }

  .admin-header .brand-text {
    font-size: 13px;
  }

  h1 {
    font-size: clamp(38px, 15vw, 58px);
  }

  .athlete-page-hero h1 {
    font-size: clamp(34px, 12vw, 46px);
  }

  .athlete-page-hero p {
    font-size: 14px;
  }

  .card,
  .onboarding-card {
    padding: 16px;
  }

  .card-head {
    flex-direction: column;
  }

  .kpi-grid,
  .form-grid,
  .onboarding-choice-grid,
  .profile-edit-grid .form-grid {
    grid-template-columns: 1fr;
  }

  .btn-small,
  .athlete-actions .btn,
  .footer-actions .btn {
    width: 100%;
  }

  .activity-row {
    flex-direction: column;
  }

  .activity-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  .kpi-card strong,
  .kpi-value {
    font-size: 28px;
  }

  .plan-session-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .plan-session-actions {
    justify-content: space-between;
    width: 100%;
  }

  .profile-shortcuts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-header {
    border-radius: 20px;
  }
}

@media (max-width: 800px) {
  .profile-edit-grid {
    max-width: 100%;
  }

  .profile-edit-grid .form-grid {
    grid-template-columns: 1fr;
  }
}