﻿/* ══════════════════════════════════════════════════════
   VITI TRAINING — style.css
   Visual overhaul: premium sports, dark, sharp, fluid
══════════════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; overflow: hidden; font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ── DESIGN TOKENS ── */
:root {
  /* Primária: tom base + tiers de opacidade (todos atualizados por applyTheme) */
  --primary:          #e8192c;
  --primary2:         #ff3347;
  --primary-ghost:    rgba(232,25,44,.025);
  --primary-subtle:   rgba(232,25,44,.07);
  --primary-dim:      rgba(232,25,44,.12);
  --primary-glow:     rgba(232,25,44,.22);
  --primary-mid:      rgba(232,25,44,.25);
  --primary-strong:   rgba(232,25,44,.5);
  --primary-text:     rgba(232,25,44,.75);
  --border-primary:   rgba(232,25,44,.2);
  --primary-dark:     #cc1a28;
  --primary-darker:   #8a0d18;

  /* Fundos */
  --bg:              #080808;
  --bg2:             #0f0f0f;
  --bg3:             #161616;
  --bg4:             #1f1f1f;
  --bg5:             #2a2a2a;
  --card:            #111012;
  --bg-tinted:       #1e0608;
  --bg-tinted-deep:  #100306;
  --bg-overlay:      #111827;

  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.13);

  /* Texto */
  --text:      #f2f2f2;
  --text2:     #c8c8c8;
  --muted:     #555;
  --muted2:    #999;

  /* Semânticas — status e accents fixos */
  --green:         #22c55e;
  --green-dim:     rgba(34,197,94,.12);
  --green-border:  rgba(34,197,94,.25);
  --green2:        #4ade80;

  --yellow:        #f59e0b;
  --yellow-dim:    rgba(245,158,11,.12);
  --yellow-border: rgba(245,158,11,.3);

  --danger:        #ef4444;
  --danger-dim:    rgba(239,68,68,.12);
  --danger-border: rgba(239,68,68,.25);

  --orange:        #ff8c00;
  --orange-dim:    rgba(255,140,0,.13);
  --orange-border: rgba(255,140,0,.3);

  --purple:        #a855f7;
  --purple-dim:    rgba(168,85,247,.12);
  --purple-border: rgba(168,85,247,.3);

  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;

  --ease-out:    cubic-bezier(.22,1,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-page:   cubic-bezier(.4,0,.2,1);
  --t-fast: 150ms;
  --t-mid:  240ms;
  --t-slow: 380ms;
}
/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;500;600;700;900&display=swap');

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

/* ══════════════════════════════════════════════════════
   PAGE TRANSITION SYSTEM
══════════════════════════════════════════════════════ */
.page {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  transition:
    transform 310ms var(--ease-page),
    opacity   310ms var(--ease-page);
  z-index: 1;
  will-change: transform, opacity;
}
.page.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.page.slide-left {
  transform: translateX(-22%);
  opacity: .35;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   GLOBAL LOADER
══════════════════════════════════════════════════════ */
#global-loader {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; gap: 24px;
}
.spinner {
  width: 36px; height: 36px;
  border: 2.5px solid var(--bg4);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-size: 10px; font-weight: 600;
  letter-spacing: 4px; text-transform: uppercase; color: var(--muted);
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 11px 22px;
  font-size: 13px; font-weight: 600;
  border-radius: 100px; z-index: 9998;
  display: none; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: toastIn var(--t-mid) var(--ease-spring);
}
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(10px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ══════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; height: 58px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: relative; z-index: 10;
}
.topbar::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 44px; height: 1px; background: var(--primary);
}
.topbar-logo { display: flex; align-items: center; }

.btn-back {
  background: transparent; border: none; cursor: pointer;
  color: var(--primary); font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 600;
  padding: 8px 10px 8px 0;
  display: flex; align-items: center; gap: 6px;
  transition: gap var(--t-fast) var(--ease-out), opacity var(--t-fast);
}
.btn-back:hover  { gap: 10px; }
.btn-back:active { opacity: .7; }

.btn-icon {
  background: transparent; border: none;
  color: var(--muted); font-size: 20px; cursor: pointer; padding: 6px;
  transition: color var(--t-fast);
}
.btn-icon:hover { color: var(--text2); }

.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; cursor: pointer;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary-glow);
  transition: transform var(--t-fast) var(--ease-spring);
}
.avatar-btn:active { transform: scale(.92); }

/* chips */
.chip { border-radius: 100px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.chip-red    { background: var(--primary-dim); color: var(--primary2); border: 1px solid var(--border-primary); }
.chip-gray   { background: var(--bg3); color: var(--muted2); border: 1px solid var(--border); }
.chip-orange { background: var(--orange-dim); color: var(--orange); border: 1px solid var(--orange-border); }
.chip-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple-border); }

/* empty state */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-icon  { font-size: 44px; margin-bottom: 14px; }
.empty-text  { font-size: 14px; line-height: 1.7; color: var(--muted2); }

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════ */
#page-login {
  overflow-y: auto;
  background: var(--bg);
}
/* background grid texture */
#page-login::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--primary-ghost) 1px, transparent 1px),
    linear-gradient(90deg, var(--primary-ghost) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none; z-index: 0;
}
/* bottom-left glow */
#page-login::after {
  content: ''; position: fixed;
  bottom: -20%; left: -15%;
  width: 55vw; height: 55vw;
  background: radial-gradient(circle, var(--primary-ghost) 0%, transparent 68%);
  pointer-events: none; z-index: 0;
}

.login-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; min-height: 100%;
  position: relative; z-index: 1;
  animation: loginEnter .55s var(--ease-out) both;
}
@keyframes loginEnter {
  from { opacity:0; transform:translateY(18px); }
  to   { opacity:1; transform:none; }
}

.logo-tagline {
  font-size: 10px; font-weight: 600;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--muted); margin-top: 10px; text-align: center;
}

.login-card {
  width: 100%; max-width: 360px; margin-top: 36px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl); padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.65),
              0 0 0 1px rgba(255,255,255,.03) inset;
}
.lc-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.lc-sub   { font-size: 13px; color: var(--muted2); margin-bottom: 26px; line-height: 1.5; }

.lfield { margin-bottom: 16px; }
.lfield label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 8px;
}
.lfield input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); padding: 12px 14px;
  font-family: 'Barlow', sans-serif; font-size: 15px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.lfield input:focus {
  border-color: var(--primary); background: var(--bg4);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.btn-auth {
  width: 100%; margin-top: 8px;
  background: var(--primary); border: none; border-radius: var(--r-sm);
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700; padding: 14px; cursor: pointer;
  letter-spacing: 1px; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition:
    background var(--t-fast),
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-fast);
}
.btn-auth::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg,rgba(255,255,255,.1),transparent);
  pointer-events: none;
}
.btn-auth:hover   { background: var(--primary2); box-shadow: 0 6px 28px var(--primary-glow); }
.btn-auth:active  { transform: scale(.97); box-shadow: none; }
.btn-auth:disabled { opacity:.4; cursor:not-allowed; transform:none; box-shadow:none; }

.auth-switch { text-align: center; margin-top: 20px; color: var(--muted2); font-size: 13px; }
.auth-switch a { color: var(--primary2); cursor: pointer; font-weight: 700; transition: opacity var(--t-fast); }
.auth-switch a:hover { opacity: .8; }

.auth-err {
  background: var(--primary-dim); border: 1px solid var(--primary-mid);
  border-radius: var(--r-sm); padding: 10px 14px; color: var(--primary2);
  font-size: 13px; margin-bottom: 14px; display: none;
  animation: shakeErr .35s var(--ease-out);
}
@keyframes shakeErr {
  0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)}
}

/* ══════════════════════════════════════════════════════
   ONBOARDING PAGE
══════════════════════════════════════════════════════ */
#page-onboard { overflow: hidden; }
.onboard-body { flex: 1; overflow-y: auto; padding: 24px 16px 48px; }

.onboard-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px; letter-spacing: 1.5px; line-height: 1; margin-bottom: 8px;
}
.onboard-sub { font-size: 14px; color: var(--muted2); margin-bottom: 28px; line-height: 1.6; }

.model-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 12px;
  cursor: pointer; position: relative; overflow: hidden;
  transition:
    border-color var(--t-mid) var(--ease-out),
    background var(--t-mid),
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-mid);
}
.model-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary); transform: scaleY(0); transform-origin: bottom;
  transition: transform var(--t-mid) var(--ease-out); border-radius: 0 2px 2px 0;
}
.model-card:hover::before   { transform: scaleY(.5); }
.model-card.selected::before { transform: scaleY(1); }
.model-card:active           { transform: scale(.985); }
.model-card:hover            { border-color: var(--border-primary); background: var(--card); }
.model-card.selected {
  border-color: var(--primary); background: var(--card);
  box-shadow: 0 0 0 1px var(--primary-dim) inset, 0 8px 32px rgba(0,0,0,.4);
}

.model-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.model-icon {
  font-size: 26px; width: 46px; height: 46px;
  background: var(--bg3); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--t-fast);
}
.model-card.selected .model-icon { background: var(--primary-dim); }
.model-name  { font-size: 17px; font-weight: 700; }
.model-freq  { font-size: 10px; color: var(--primary2); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.model-desc  { font-size: 13px; color: var(--muted2); line-height: 1.6; }
.model-days  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.model-day-tag {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 100px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; color: var(--muted2);
}

.btn-start {
  width: 100%; margin-top: 10px;
  background: var(--primary); border: none; border-radius: var(--r-md);
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  padding: 16px; cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition:
    background var(--t-fast),
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn-start:not(:disabled):hover { background: var(--primary2); }
.btn-start:active   { transform: scale(.97); }
.btn-start:disabled { opacity:.35; cursor:not-allowed; transform:none; box-shadow:none; }

.btn-scratch {
  width: 100%; margin-top: 10px;
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--r-md); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 600;
  padding: 14px; cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.btn-scratch:hover { border-color: var(--muted); color: var(--text); }

/* ══════════════════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════════════════ */
.home-body { flex: 1; overflow-y: auto; padding-bottom: 32px; }

.home-banner {
  padding: 26px 18px 22px;
  background: linear-gradient(150deg, var(--bg-tinted) 0%, var(--bg-tinted-deep) 50%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.home-banner::before {
  content: ''; position: absolute; top: -60%; right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--primary-dim) 0%, transparent 65%);
  pointer-events: none;
}
.home-banner::after {
  content: ''; position: absolute; bottom: -40%; left: -5%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--primary-ghost) 0%, transparent 70%);
  pointer-events: none;
}
.home-greeting {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 2px; line-height: 1;
  position: relative; z-index: 1;
}
.home-greeting em { color: var(--primary); font-style: normal; }
.home-date { font-size: 12px; color: var(--muted2); margin-top: 6px; text-transform: capitalize; position: relative; z-index: 1; letter-spacing: .3px; }

/* ── Card do treino de hoje ── */
.home-today-wrap { padding: 14px 12px 2px; }
.home-today-card {
  background: linear-gradient(135deg, var(--bg-tinted) 0%, var(--bg-tinted-deep) 55%, var(--bg-tinted-deep) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-lg);
  padding: 16px 18px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-mid), transform var(--t-fast) var(--ease-spring), box-shadow var(--t-mid);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.home-today-card::after {
  content: ''; position: absolute; top: -40%; right: -10%;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--primary-dim) 0%, transparent 65%);
  pointer-events: none;
}
.home-today-card:hover  { border-color: var(--primary-strong); box-shadow: 0 4px 24px rgba(0,0,0,.35); }
.home-today-card:active { transform: scale(.98); }
.home-today-rest        { cursor: default; opacity: .65; }
.home-today-rest:hover  { border-color: var(--border-primary); box-shadow: none; transform: none; }
.home-today-sup {
  font-size: 9px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--primary-text);
  margin-bottom: 10px; position: relative; z-index: 1;
}
.home-today-row {
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1;
}
.home-today-emoji { font-size: 34px; line-height: 1; flex-shrink: 0; }
.home-today-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px; letter-spacing: 1px; color: var(--text); line-height: 1.1;
}
.home-today-sub  { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.home-today-cta  {
  margin-top: 12px; font-size: 10px; font-weight: 800;
  letter-spacing: 2.5px; color: var(--primary); text-align: right;
  position: relative; z-index: 1;
}

.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); padding: 20px 18px 12px;
}

/* Waiting for trainer card */
.home-waiting-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--primary-subtle); border: 1.5px solid var(--primary-glow);
  border-radius: 14px; padding: 16px; margin: 0 12px 12px;
}
.home-waiting-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.home-waiting-title { font-size: 14px; font-weight: 700; color: var(--text1); margin-bottom: 5px; }
.home-waiting-sub { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Day cards */
.day-list { display: flex; flex-direction: column; padding: 0 12px; }
.day-card {
  display: flex; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 8px;
  overflow: hidden; cursor: pointer;
  position: relative; min-height: 76px;
  transition:
    border-color var(--t-mid) var(--ease-out),
    background   var(--t-mid),
    transform    var(--t-fast) var(--ease-spring),
    box-shadow   var(--t-mid);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.day-card:nth-child(1){animation-delay:.04s}
.day-card:nth-child(2){animation-delay:.09s}
.day-card:nth-child(3){animation-delay:.14s}
.day-card:nth-child(4){animation-delay:.19s}
.day-card:nth-child(5){animation-delay:.24s}
.day-card:nth-child(6){animation-delay:.29s}
.day-card:nth-child(7){animation-delay:.34s}
@keyframes cardIn {
  from { opacity:0; transform:translateY(16px) scale(.97); }
  to   { opacity:1; transform:none; }
}
.day-card:active                         { transform: scale(.975); }
.day-card:hover                          { border-color: var(--border-primary); background: var(--card); }
.day-card.today                          { border-color: var(--primary-strong); background: var(--card); box-shadow: 0 4px 24px rgba(0,0,0,.4); }
.day-card.rest                           { opacity: .52; cursor: default; }
.day-card.rest:hover                     { border-color: var(--border); background: var(--bg2); transform: none; }

.day-card-accent {
  width: 3px; align-self: stretch;
  background: linear-gradient(to bottom, var(--primary), var(--primary-darker));
  flex-shrink: 0;
}
.day-card.rest .day-card-accent { background: var(--bg5); }

.day-card-icon {
  width: 52px; height: 52px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; flex-shrink: 0; margin: 0 2px 0 10px;
}

/* Ícone PNG com fundo azul + glow para fora */
.day-card-icon--img {
  border-radius: var(--r-sm);
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  box-shadow:
    0 0 0 1px var(--primary-strong),
    0 0 12px 3px var(--primary-strong),
    0 0 28px 6px var(--primary-mid),
    0 0 52px 10px var(--primary-dim);
  overflow: visible;
}
.day-card-icon--img img {
  width: 42px; height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.3));
}
.day-card-info { flex: 1; min-width: 0; padding: 14px 8px 14px 2px; }
.day-card-name {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted);
}
.day-card.today .day-card-name { color: var(--primary); }
.day-card-label { font-size: 16px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-card.rest .day-card-label { color: var(--muted2); font-weight: 500; }
.day-card-meta { font-size: 12px; color: var(--muted2); margin-top: 3px; }
.day-card-ring { position: relative; width: 48px; height: 48px; flex-shrink: 0; margin-right: 14px; }
.day-card-ring svg { display: block; }
.day-card-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--primary2); }
.today-tag {
  position: absolute; top: 9px; right: 10px;
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  background: var(--primary); color: #fff; border-radius: 100px; padding: 2px 9px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ══════════════════════════════════════════════════════
   WORKOUT PAGE
══════════════════════════════════════════════════════ */
.workout-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 58px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: relative; z-index: 10;
}
.workout-topbar::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 44px; height: 1px; background: var(--primary);
}
.workout-topbar-title {
  font-size: 15px; font-weight: 700; flex: 1; text-align: center;
  padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workout-topbar-title span { color: var(--primary); }

.big-ring-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.big-ring-wrap svg { display: block; transform: rotate(-90deg); }
.big-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text2); }

.workout-body { flex: 1; overflow-y: auto; padding: 14px 12px 80px; }

/* Exercise row */
.ex-row {
  display: flex; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 10px;
  overflow: hidden; cursor: pointer; min-height: 88px;
  position: relative;
  transition:
    border-color var(--t-mid) var(--ease-out),
    background   var(--t-mid),
    transform    var(--t-fast) var(--ease-spring),
    opacity      var(--t-mid);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.ex-row:nth-child(1){animation-delay:.04s}
.ex-row:nth-child(2){animation-delay:.09s}
.ex-row:nth-child(3){animation-delay:.14s}
.ex-row:nth-child(4){animation-delay:.19s}
.ex-row:nth-child(5){animation-delay:.24s}

/* top shimmer on hover */
.ex-row::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0; transition: opacity var(--t-mid);
}
.ex-row:hover::after  { opacity: 1; }
.ex-row:hover         { border-color: var(--border-primary); background: var(--card); }
.ex-row:active        { transform: scale(.983); }
.ex-row.done          { opacity: .48; }

.ex-img               { width: 108px; height: 88px; flex-shrink: 0; overflow: hidden; background: var(--bg3); }
.ex-img img           { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.ex-row:hover .ex-img img { transform: scale(1.05); }
.ex-img-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  background: linear-gradient(135deg, var(--bg-tinted), var(--bg2));
}

.ex-info   { flex: 1; min-width: 0; padding: 12px 10px; }
.ex-name   { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; line-height: 1.25; }
.ex-sets   { font-size: 13px; color: var(--muted2); margin-top: 6px; line-height: 1.4; }

.ex-chk {
  width: 26px; height: 26px;
  border: 2px solid var(--bg5); border-radius: 4px;
  flex-shrink: 0; margin-right: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition:
    background     var(--t-mid) var(--ease-spring),
    border-color   var(--t-fast),
    transform      var(--t-fast) var(--ease-spring);
}
.ex-chk:hover              { border-color: var(--primary); }
.ex-chk.checked            { background: var(--primary); border-color: var(--primary); animation: checkPop .35s var(--ease-spring) both; }
.ex-chk.checked::after     { content: '✓'; color: #fff; font-size: 15px; font-weight: 800; line-height: 1; }

.btn-edit-workout {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 14px 16px;
  background: transparent; border: 1px dashed var(--primary-glow);
  border-radius: var(--r-lg); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; width: 100%;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.btn-edit-workout:hover { border-color: var(--primary); color: var(--primary2); background: var(--primary-dim); }

/* ══════════════════════════════════════════════════════
   EXERCISE DETAIL PAGE
══════════════════════════════════════════════════════ */
.ex-detail-body { flex: 1; overflow-y: auto; padding-bottom: 48px; }

.ex-hero {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-tinted), var(--bg2));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.ex-hero img { width: 100%; height: 100%; object-fit: cover; }
.ex-hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 56px; background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.ex-hero-ph  { text-align: center; color: var(--muted); }
.ex-hero-ph .big-em { font-size: 64px; margin-bottom: 8px; }

.ex-detail-content { padding: 20px 18px; }
.ex-detail-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px; letter-spacing: 1px; line-height: 1; margin-bottom: 12px;
}
.ex-chips     { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.detail-desc {
  font-size: 14px; color: var(--muted2); line-height: 1.8;
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 16px; margin-bottom: 28px;
}

.edit-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.edit-field label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px; text-align: center;
}
.edit-field input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); padding: 11px 6px;
  font-family: 'Barlow', sans-serif; font-size: 18px; font-weight: 700;
  text-align: center; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.edit-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }

.btn-save {
  width: 100%; background: var(--primary); border: none;
  border-radius: var(--r-sm); color: #fff;
  font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 1px;
  padding: 14px; cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring), box-shadow var(--t-fast);
}
.btn-save:hover  { background: var(--primary2); }
.btn-save:active { transform: scale(.97); box-shadow: none; }

/* ══════════════════════════════════════════════════════
   ADD EXERCISE SHEET
══════════════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500; display: none; align-items: flex-end;
}
.sheet-overlay.open { display: flex; animation: overlayIn var(--t-mid) ease; }
@keyframes overlayIn { from{opacity:0} to{opacity:1} }

.sheet {
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border2);
  width: 100%; max-height: 92vh;
  overflow: hidden; display: flex; flex-direction: column;
  animation: sheetUp var(--t-slow) var(--ease-spring);
  box-shadow: 0 -24px 64px rgba(0,0,0,.6);
}
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:none} }

.sheet-handle { width: 36px; height: 3px; background: var(--bg5); border-radius: 2px; margin: 14px auto 0; flex-shrink: 0; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; flex-shrink: 0; }
.sheet-title  { font-size: 18px; font-weight: 700; }
.sheet-close  {
  background: var(--bg3); border: none; color: var(--muted2);
  font-size: 15px; cursor: pointer; padding: 6px 10px; border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.sheet-close:hover { background: var(--bg4); color: var(--text); }
.sheet-body   { flex: 1; overflow-y: auto; padding: 0 16px 32px; }
.sheet-footer { padding: 12px 16px 28px; border-top: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }

/* search */
.search-wrap  { position: relative; margin-bottom: 14px; }
.search-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text);
  padding: 11px 14px 11px 42px;
  font-family: 'Barlow', sans-serif; font-size: 14px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.search-icon  { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }

/* filter chips */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; margin-bottom: 4px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--bg3); border: 1px solid var(--border); color: var(--muted2);
  transition: all var(--t-fast) var(--ease-out);
}
.filter-chip:active  { transform: scale(.93); }
.filter-chip.active  { background: var(--primary-dim); border-color: var(--primary); color: var(--primary2); }

/* exercise picker */
.ex-pick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 8px; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.ex-pick-item:active           { transform: scale(.985); }
.ex-pick-item:hover            { border-color: var(--border-primary); background: var(--bg4); }
.ex-pick-item.selected         { border-color: var(--primary); background: var(--card); }
.ex-pick-thumb                 { width: 46px; height: 46px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg4); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ex-pick-thumb img             { width: 100%; height: 100%; object-fit: cover; }
.ex-pick-info                  { flex: 1; min-width: 0; }
.ex-pick-name                  { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.ex-pick-meta                  { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.ex-pick-chk                   { width: 22px; height: 22px; border: 2px solid var(--bg5); border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all var(--t-fast) var(--ease-spring); }
.ex-pick-item.selected .ex-pick-chk        { background: var(--primary); border-color: var(--primary); }
.ex-pick-item.selected .ex-pick-chk::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 800; }

.btn-confirm {
  width: 100%; background: var(--primary); border: none; border-radius: var(--r-md);
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: .5px; padding: 15px; cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.btn-confirm:active   { transform: scale(.97); }
.btn-confirm:disabled { opacity:.35; cursor:not-allowed; transform:none; box-shadow:none; }

/* sets sheet */
.sets-sheet {
  background: var(--bg2); border-radius: 20px 20px 0 0; border-top: 1px solid var(--border2);
  width: 100%; animation: sheetUp var(--t-slow) var(--ease-spring);
}
.sets-inner { padding: 24px 20px 40px; }
.sets-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.sets-sub   { font-size: 13px; color: var(--muted2); margin-bottom: 22px; }

/* ══════════════════════════════════════════════════════
   WORKOUT COMPLETION CARD MODAL
══════════════════════════════════════════════════════ */
.wc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: flex-end;
  opacity: 0;
  transition: opacity .35s var(--ease-out);
}
.wc-overlay.open { opacity: 1; }
.wc-overlay.open .wc-sheet { transform: none; }

.wc-sheet {
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border2);
  width: 100%; max-height: 96vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .42s var(--ease-spring);
  padding-bottom: env(safe-area-inset-bottom, 24px);
  box-shadow: 0 -32px 80px rgba(0,0,0,.7);
}

.wc-handle {
  width: 36px; height: 3px; background: var(--bg5);
  border-radius: 2px; margin: 14px auto 0;
}

.wc-header {
  text-align: center; padding: 24px 24px 8px;
}
.wc-confetti {
  font-size: 52px; margin-bottom: 8px;
  animation: bounceIn .6s var(--ease-spring) .2s both;
}
@keyframes bounceIn {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}
.wc-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 2px;
  color: var(--text);
  animation: fadeUpItem .4s var(--ease-out) .3s both;
}
.wc-sub {
  font-size: 14px; color: var(--muted2); margin-top: 4px;
  animation: fadeUpItem .4s var(--ease-out) .38s both;
}
@keyframes fadeUpItem {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* tabs */
.wc-tabs {
  display: flex; gap: 8px;
  margin: 20px 20px 0; padding: 4px;
  background: var(--bg3); border-radius: var(--r-md);
  animation: fadeUpItem .4s var(--ease-out) .42s both;
}
.wc-tab {
  flex: 1; padding: 10px;
  background: transparent; border: none; border-radius: var(--r-sm);
  color: var(--muted2); font-family: 'Barlow', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.wc-tab.active {
  background: var(--bg2); color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* preview */
.wc-preview-wrap {
  margin: 16px 20px;
  border-radius: var(--r-lg); overflow: hidden;
  position: relative;
  animation: fadeUpItem .5s var(--ease-out) .46s both;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  /* show as phone-story ratio */
  max-height: 55vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
}
.wc-preview {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  max-height: 55vh;
}
.wc-preview-hint {
  position: absolute; bottom: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75); border: 1px solid var(--border2);
  color: var(--text2); font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 100px;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}

/* action buttons */
.wc-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 20px 24px;
  animation: fadeUpItem .4s var(--ease-out) .52s both;
}
.wc-btn-row {
  display: flex; gap: 10px;
}
.wc-btn-download {
  flex: 1; padding: 16px;
  background: var(--primary); border: none; border-radius: var(--r-md);
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.wc-btn-download:hover  { background: var(--primary2); }
.wc-btn-download:active { transform: scale(.97); }

.wc-btn-copy {
  flex: 1; padding: 16px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r-md); color: var(--text2);
  font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.wc-btn-copy:hover  { background: var(--bg4); border-color: var(--border2); }
.wc-btn-copy:active { transform: scale(.97); }

.wc-btn-close {
  width: 100%; padding: 14px;
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--r-md); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.wc-btn-close:hover { border-color: var(--muted); color: var(--text); }

/* copy feedback message */
.wc-copy-msg {
  text-align: center; margin: -4px 20px 12px;
  font-size: 13px; font-weight: 600; color: var(--green2);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.wc-copy-msg.visible { opacity: 1; transform: none; }


/* ══════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR
══════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--t-mid) var(--ease-out),
    transform var(--t-mid) var(--ease-out),
    visibility 0ms var(--t-mid);
}
.bottom-nav.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity var(--t-mid) var(--ease-out),
    transform var(--t-mid) var(--ease-out),
    visibility 0ms;
}

.bnav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  background: transparent; border: none;
  color: var(--muted); cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
  transition: color var(--t-fast);
  position: relative;
  padding-bottom: 4px;
}
.bnav-item::after {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; background: var(--primary);
  border-radius: 0 0 2px 2px;
  transform: scaleX(0);
  transition: transform var(--t-mid) var(--ease-spring);
}
.bnav-item.active        { color: var(--primary); }
.bnav-item.active::after { transform: scaleX(1); }
.bnav-item:active        { transform: scale(.85); opacity: .8; }

.bnav-icon {
  width: 22px; height: 22px;
  stroke: currentColor;
  transition: transform var(--t-mid) var(--ease-spring), opacity var(--t-fast);
}
.bnav-item.active .bnav-icon { transform: scale(1.18); animation: navIconPop .3s var(--ease-spring) both; }

/* ══════════════════════════════════════════════════════
   DIET PAGE
══════════════════════════════════════════════════════ */
.diet-body { flex: 1; overflow-y: auto; }

/* Meal list */
.meal-list { display: flex; flex-direction: column; gap: 0; padding: 0 12px; }

.meal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
  animation: cardIn var(--t-slow) var(--ease-out) both;
  transition: border-color var(--t-mid);
}
.meal-card:nth-child(1){animation-delay:.04s}
.meal-card:nth-child(2){animation-delay:.09s}
.meal-card:nth-child(3){animation-delay:.14s}
.meal-card:nth-child(4){animation-delay:.19s}
.meal-card:nth-child(5){animation-delay:.24s}

/* Meal header row */
.meal-head {
  display: flex; align-items: center;
  padding: 14px 16px; gap: 12px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.meal-head:active { background: var(--bg3); }

.meal-img {
  width: 52px; height: 52px; border-radius: var(--r-sm);
  object-fit: cover; flex-shrink: 0;
  background: var(--bg3);
}
.meal-img-ph {
  width: 52px; height: 52px; border-radius: var(--r-sm);
  background: var(--bg3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

.meal-info        { flex: 1; min-width: 0; }
.meal-name        { font-size: 16px; font-weight: 700; }
.meal-time        {
  font-size: 12px; color: var(--muted2); margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.meal-time::before { content: '🕐'; font-size: 11px; }
.meal-food-count  { font-size: 12px; color: var(--muted); margin-top: 2px; }

.meal-actions { display: flex; gap: 6px; flex-shrink: 0; }
.meal-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--muted2);
  font-size: 14px; padding: 6px 10px; cursor: pointer;
  transition: all var(--t-fast);
}
.meal-btn:hover        { border-color: var(--primary); color: var(--primary); }
.meal-btn:active       { transform: scale(.92); }
.meal-btn.del:hover    { border-color: var(--primary); color: var(--primary); }
.meal-btn.del:active   { transform: scale(.92); }

/* Meal foods expanded */
.meal-foods {
  border-top: 1px solid var(--border);
  padding: 0;
  max-height: 0; overflow: hidden;
  transition: max-height .3s var(--ease-out), padding .3s;
}
.meal-foods.open {
  max-height: 600px;
  padding: 8px 0;
}

.food-item {
  display: flex; align-items: center;
  padding: 9px 16px; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.food-item:last-child { border-bottom: none; }

.food-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}
.food-item-name { flex: 1; font-size: 14px; font-weight: 500; }
.food-item-qty  {
  font-size: 13px; color: var(--muted2);
  background: var(--bg3); border-radius: 100px;
  padding: 2px 10px; flex-shrink: 0;
}
.meal-notes-row {
  padding: 10px 16px; font-size: 13px;
  color: var(--muted2); font-style: italic;
  border-top: 1px solid var(--border);
}

/* Add meal button */
.btn-add-meal {
  width: 100%; padding: 16px;
  background: transparent;
  border: 1px dashed var(--primary-mid);
  border-radius: var(--r-lg); color: var(--muted2);
  font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.btn-add-meal:hover {
  border-color: var(--primary);
  color: var(--primary2);
  background: var(--primary-dim);
}
.btn-add-meal:active { transform: scale(.97); }
.btn-add-meal-icon { font-size: 20px; line-height: 1; }

/* ── DIET FORM FIELDS ── */
.diet-field { margin-bottom: 20px; }
.diet-field label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 8px;
}
.diet-field input[type="text"],
.diet-field input[type="time"],
.diet-field input[type="number"],
.diet-field textarea {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); padding: 11px 14px;
  font-family: 'Barlow', sans-serif; font-size: 15px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.diet-field input:focus,
.diet-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.diet-field textarea { resize: vertical; min-height: 72px; }

/* ── IMAGE CAROUSEL ── */
.img-carousel-wrap {
  overflow: hidden; position: relative;
  margin-bottom: 10px;
}
.img-carousel {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.img-carousel::-webkit-scrollbar { display: none; }

.carousel-item {
  flex-shrink: 0;
  width: 100px; height: 100px;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  border: 2px solid var(--border);
  transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-spring);
  position: relative;
}
.carousel-item:active      { transform: scale(.95); }
.carousel-item.selected    { border-color: var(--primary); }
.carousel-item img         { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-item .ci-ph      {
  width: 100%; height: 100%;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.carousel-item .ci-check {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary);
  display: none; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 800;
}
.carousel-item.selected .ci-check { display: flex; }
.carousel-item .ci-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6);
  font-size: 10px; font-weight: 600; color: #fff;
  padding: 3px 4px; text-align: center;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

.img-selected-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg3); border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 13px; color: var(--muted2);
  min-height: 44px;
}
.img-selected-preview img {
  width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
}

/* ── FOOD ADD ROW ── */
.food-add-row {
  display: flex; gap: 8px; align-items: center; margin-top: 10px;
}
.food-add-row input { flex: 1; min-width: 0; }
.food-add-row input:last-of-type { flex: 0 0 90px; }
.btn-food-add {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--primary); border: none; border-radius: var(--r-sm);
  color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.btn-food-add:hover  { background: var(--primary2); }
.btn-food-add:active { transform: scale(.93); }

/* food temp list (inside sheet) */
.food-temp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--bg3); border-radius: var(--r-sm);
  margin-bottom: 6px;
  animation: cardIn .2s var(--ease-out) both;
}
.food-temp-name { flex: 1; font-size: 14px; font-weight: 500; }
.food-temp-qty  { font-size: 13px; color: var(--muted2); flex-shrink: 0; }
.food-temp-del  {
  background: transparent; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 2px 4px;
  transition: color var(--t-fast);
}
.food-temp-del:hover { color: var(--primary); }

/* tall sheet variant */
.sheet-tall { max-height: 96vh; }

/* empty diet state */
.diet-empty {
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.diet-empty .de-icon { font-size: 52px; margin-bottom: 14px; }
.diet-empty .de-text { font-size: 14px; color: var(--muted2); line-height: 1.7; }

/* ══════════════════════════════════════════════════════
   EDIT WORKOUT PAGE
══════════════════════════════════════════════════════ */
.edit-body {
  flex: 1; overflow-y: auto;
  padding-bottom: 80px;
}
.edit-section { width: 100%; }
.edit-section.hidden { display: none; }

/* ── Day selector list ── */
.ew-day-list {
  display: flex; flex-direction: column;
  padding: 0 12px; gap: 0;
}
.ew-day-card {
  display: flex; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 8px;
  min-height: 72px; cursor: pointer; overflow: hidden;
  position: relative;
  transition:
    border-color var(--t-mid) var(--ease-out),
    background   var(--t-mid),
    transform    var(--t-fast) var(--ease-spring);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.ew-day-card:nth-child(1){animation-delay:.04s}
.ew-day-card:nth-child(2){animation-delay:.09s}
.ew-day-card:nth-child(3){animation-delay:.14s}
.ew-day-card:nth-child(4){animation-delay:.19s}
.ew-day-card:nth-child(5){animation-delay:.24s}
.ew-day-card:nth-child(6){animation-delay:.29s}
.ew-day-card:nth-child(7){animation-delay:.34s}
.ew-day-card:active  { transform: scale(.983); }
.ew-day-card:hover   { border-color: var(--border-primary); background: var(--card); }
.ew-day-card.rest    { opacity: .6; }

.ew-day-accent {
  width: 3px; align-self: stretch; flex-shrink: 0;
  background: linear-gradient(to bottom, var(--primary), var(--primary-darker));
}
.ew-day-card.rest .ew-day-accent { background: var(--bg5); }

.ew-day-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 6px 0 10px;
}
.ew-day-info { flex: 1; min-width: 0; padding: 12px 8px 12px 0; }
.ew-day-name {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted);
}
.ew-day-label { font-size: 16px; font-weight: 700; margin-top: 3px; }
.ew-day-card.rest .ew-day-label { color: var(--muted2); }
.ew-day-meta  { font-size: 12px; color: var(--muted2); margin-top: 2px; }

.ew-day-arrow {
  color: var(--muted); font-size: 18px;
  margin-right: 16px; flex-shrink: 0;
  transition: transform var(--t-fast), color var(--t-fast);
}
.ew-day-card:hover .ew-day-arrow { color: var(--primary); transform: translateX(3px); }

/* ── Editor panel ── */
.ew-editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 52px;
  background: var(--bg3); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ew-back-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--primary); font-family: 'Barlow', sans-serif;
  font-size: 14px; font-weight: 600; padding: 6px 0;
  transition: opacity var(--t-fast);
}
.ew-back-btn:hover { opacity: .8; }
.ew-editor-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 1px; color: var(--text);
}
.ew-save-btn {
  background: var(--primary); border: none; border-radius: var(--r-sm);
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  padding: 7px 16px; cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.ew-save-btn:hover  { background: var(--primary2); }
.ew-save-btn:active { transform: scale(.95); }

/* ── Rest toggle ── */
.ew-rest-toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.ew-rest-label-title { display: block; font-size: 15px; font-weight: 600; }
.ew-rest-label-sub   { display: block; font-size: 12px; color: var(--muted2); margin-top: 2px; }

/* iOS-style toggle switch */
.ew-toggle        { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.ew-toggle input  { opacity: 0; width: 0; height: 0; }
.ew-toggle-track  {
  position: absolute; inset: 0;
  background: var(--bg4); border-radius: 26px;
  cursor: pointer;
  transition: background var(--t-mid);
}
.ew-toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  transition: transform var(--t-mid) var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.ew-toggle input:checked + .ew-toggle-track         { background: var(--primary); }
.ew-toggle input:checked + .ew-toggle-track::after  { transform: translateX(22px); }

/* ── Day name input ── */
.ew-name-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); padding: 12px 14px;
  font-family: 'Barlow', sans-serif; font-size: 16px; font-weight: 600;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ew-name-input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim);
}

/* count badge */
.ew-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary2);
  border: 1px solid var(--border-primary);
  border-radius: 100px; padding: 1px 9px;
  font-size: 11px; font-weight: 700;
  font-family: 'Barlow', sans-serif; letter-spacing: 0;
  text-transform: none; vertical-align: middle;
}

/* ── Exercises in editor ── */
.ew-ex-list { display: flex; flex-direction: column; padding: 0 12px; gap: 8px; margin-bottom: 8px; }

.ew-ex-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 12px 14px;
  animation: cardIn .22s var(--ease-out) both;
  position: relative;
}
.ew-ex-img {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  overflow: hidden; flex-shrink: 0; background: var(--bg3);
}
.ew-ex-img img { width: 100%; height: 100%; object-fit: cover; }
.ew-ex-img-ph  {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, var(--bg-tinted), var(--bg2));
}
.ew-ex-info   { flex: 1; min-width: 0; }
.ew-ex-name   { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.ew-ex-meta   { font-size: 12px; color: var(--muted2); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.ew-ex-chip   { background: var(--bg3); border: 1px solid var(--border); border-radius: 100px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.ew-ex-chip-r { color: var(--primary2); border-color: var(--border-primary); background: var(--primary-dim); }

.ew-ex-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ew-ex-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--muted2);
  font-size: 13px; padding: 6px 10px; cursor: pointer;
  transition: all var(--t-fast);
}
.ew-ex-btn:hover      { border-color: var(--primary); color: var(--primary); }
.ew-ex-btn:active     { transform: scale(.92); }
.ew-ex-btn.del:hover  { color: var(--primary); border-color: var(--primary); }
.ew-ex-btn.del:active { transform: scale(.92); }

/* drag handle */
.ew-drag-handle {
  color: var(--muted); font-size: 18px; cursor: grab;
  padding: 4px; flex-shrink: 0; user-select: none;
  transition: color var(--t-fast);
}
.ew-drag-handle:hover { color: var(--muted2); }
.ew-drag-handle:active { cursor: grabbing; }

/* empty ex state */
.ew-empty-ex {
  text-align: center; padding: 32px 24px;
  color: var(--muted); font-size: 14px;
}

/* ── Picker filters ── */
.ew-filter-active {
  background: var(--primary-dim) !important;
  border-color: var(--primary) !important;
  color: var(--primary2) !important;
}

/* ══════════════════════════════════════════════════════
   ACTIVITIES PAGE
══════════════════════════════════════════════════════ */
.act-body {
  flex: 1; overflow-y: auto; padding-bottom: 88px;
}

/* ── Stats strip ── */
.act-stats-strip {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.act-stat {
  background: var(--bg2);
  padding: 16px 12px; text-align: center;
}
.act-stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px; color: var(--primary); line-height: 1;
}
.act-stat-lbl {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin-top: 3px;
}

/* ── Calendar ── */
.act-calendar-wrap {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 12px 20px;
}
.act-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.act-cal-nav {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--muted2);
  font-size: 20px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t-fast) var(--ease-spring);
}
.act-cal-nav:hover  { border-color: var(--primary); color: var(--primary); }
.act-cal-nav:active { transform: scale(.88); }
.act-cal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 1px; text-align: center;
}
.act-cal-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  margin-bottom: 8px;
}
.act-cal-weekdays span {
  text-align: center; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 4px 0;
}
.act-cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 4px;
}
.act-cal-day {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--muted2);
  cursor: default; position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.act-cal-day.empty    { pointer-events: none; }
.act-cal-day.today    { color: var(--text); font-weight: 700; }
.act-cal-day.today::after {
  content: ''; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.act-cal-day.done {
  background: var(--primary);
  color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.act-cal-day.done.today::after { background: #fff; }
.act-cal-day.other-month { color: var(--bg5); }

/* ── Activity list ── */
.act-list {
  display: flex; flex-direction: column;
  padding: 0 12px; gap: 8px; margin-bottom: 8px;
}

.act-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  animation: cardIn var(--t-slow) var(--ease-out) both;
  transition: border-color var(--t-fast);
}
.act-item:hover { border-color: var(--border-primary); }

.act-item-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
}
.act-item-date-badge {
  flex-shrink: 0;
  width: 48px; text-align: center;
  background: var(--primary-dim); border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); padding: 6px 4px;
}
.act-item-date-day   { font-family:'Bebas Neue',sans-serif; font-size:24px; color:var(--primary); line-height:1; }
.act-item-date-month { font-size:10px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--muted2); }

.act-item-info { flex: 1; min-width: 0; }
.act-item-name { font-size:15px; font-weight:700; }
.act-item-meta { font-size:12px; color:var(--muted2); margin-top:3px; display:flex; gap:10px; flex-wrap:wrap; }
.act-item-meta span { display:flex; align-items:center; gap:3px; }

.act-item-chevron {
  color: var(--muted); font-size:18px; flex-shrink:0;
  transition: transform var(--t-fast);
}
.act-item.open .act-item-chevron { transform: rotate(90deg); }

/* Expanded detail */
.act-item-detail {
  max-height: 0; overflow: hidden;
  transition: max-height .3s var(--ease-out);
  border-top: 0px solid var(--border);
}
.act-item.open .act-item-detail {
  max-height: 800px;
  border-top-width: 1px;
}
.act-item-ex-list { padding: 10px 16px; }
.act-item-ex {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.act-item-ex:last-child { border-bottom: none; }
.act-item-ex-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}
.act-item-ex-name { flex:1; font-size:13px; font-weight:600; text-transform:uppercase; }
.act-item-ex-sets { font-size:12px; color:var(--muted2); flex-shrink:0; }

/* empty state */
.act-empty {
  text-align:center; padding:48px 24px;
}
.act-empty .ae-icon { font-size:52px; margin-bottom:14px; }
.act-empty .ae-text { font-size:14px; color:var(--muted2); line-height:1.7; }

/* ══════════════════════════════════════════════════════
   PWA INSTALL — BOTTOM SHEET (Android + iOS)
══════════════════════════════════════════════════════ */

/* Overlay escuro atrás do sheet */
#pwa-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 7999;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
#pwa-overlay.visible { opacity: 1; pointer-events: auto; }

/* Sheet base */
#pwa-banner,
#pwa-ios-banner {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(110%);
  width: calc(100% - 24px);
  max-width: 440px;
  background: var(--bg-overlay);
  border-radius: 28px 28px 20px 20px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -4px 60px rgba(0,0,0,.8);
  padding: 12px 24px 40px;
  z-index: 8000;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.34,1.28,.64,1);
}
#pwa-banner.visible,
#pwa-ios-banner.visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Handle */
.pwa-handle {
  width: 44px; height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 2px;
  margin: 0 auto 24px;
}

/* Ícone do app */
.pwa-app-icon {
  width: 80px; height: 80px;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 18px;
  box-shadow: 0 12px 32px var(--primary-strong);
}

.pwa-title {
  font-size: 22px; font-weight: 800; letter-spacing: -.3px;
  color: #fff; text-align: center;
  margin-bottom: 8px;
}
.pwa-subtitle {
  font-size: 14px; color: rgba(255,255,255,.5);
  text-align: center; line-height: 1.55;
  margin-bottom: 24px;
}

/* Lista de benefícios (Android) */
.pwa-features {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 28px;
}
.pwa-feature {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; color: rgba(255,255,255,.85);
}
.pwa-feature span:first-child {
  font-size: 20px; width: 28px; text-align: center; flex-shrink: 0;
}

/* GIF tutorial (iOS) */
.pwa-ios-gif {
  width: 100%; border-radius: 16px;
  margin-bottom: 20px;
  max-height: 35vh; object-fit: contain;
  display: block;
}

/* Passos iOS */
.pwa-ios-steps {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 28px;
}
.pwa-ios-step {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; color: rgba(255,255,255,.85); line-height: 1.4;
}
.pwa-ios-step-num {
  width: 30px; height: 30px;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* Botão instalar (Android) */
.pwa-btn-install {
  display: block; width: 100%;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  border: none; border-radius: 16px;
  color: #fff; font-family: 'Barlow', sans-serif;
  font-size: 18px; font-weight: 700; letter-spacing: .4px;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--primary-strong);
  transition: transform .15s var(--ease-spring), box-shadow .15s ease;
  margin-bottom: 14px;
}
.pwa-btn-install:active { transform: scale(.97); box-shadow: 0 3px 12px var(--primary-mid); }

/* "Agora não" (ambos) */
.pwa-btn-dismiss {
  display: block; width: 100%;
  background: transparent; border: none;
  color: rgba(255,255,255,.38);
  font-family: 'Barlow', sans-serif;
  font-size: 14px; padding: 8px;
  cursor: pointer; text-align: center;
  transition: color .2s ease;
}
.pwa-btn-dismiss:hover { color: rgba(255,255,255,.65); }

/* ══════════════════════════════════════════════════════
   EXERCISE CARD (workout page — new series layout)
══════════════════════════════════════════════════════ */
.ex-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--t-mid), opacity var(--t-mid);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.ex-card:nth-child(1){animation-delay:.04s}
.ex-card:nth-child(2){animation-delay:.09s}
.ex-card:nth-child(3){animation-delay:.14s}
.ex-card:nth-child(4){animation-delay:.19s}
.ex-card:nth-child(5){animation-delay:.24s}
.ex-card:hover        { border-color: var(--border-primary); }
.ex-card.done         { opacity: .52; }

.ex-card-header {
  display: flex; align-items: center;
  cursor: pointer; min-height: 76px;
  transition: background var(--t-fast);
}
.ex-card-header:active { background: var(--bg3); }

.ex-card-info  { flex: 1; min-width: 0; padding: 12px 10px; }
.ex-card-name  {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; line-height: 1.3;
}
.ex-card-arrow {
  color: var(--muted); font-size: 18px;
  margin-right: 14px; flex-shrink: 0;
  transition: color var(--t-fast);
}
.ex-card-header:hover .ex-card-arrow { color: var(--primary); }

/* Type badge on exercise card */
.ex-type-badge {
  display: inline-block; margin-top: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; border-radius: 100px; padding: 2px 8px;
}
.ex-type-dropset {
  background: var(--orange-dim); color: var(--orange);
  border: 1px solid var(--orange-border);
}
.ex-type-biset {
  background: var(--purple-dim); color: var(--purple);
  border: 1px solid var(--purple-border);
}
/* Dropset cascade text inside card */
.ex-drop-cascade {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--orange); margin-top: 4px;
}

/* Biset partner bar inside workout card */
.ex-biset-bar {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 14px;
  background: var(--purple-dim); border: none;
  border-top: 1px solid var(--purple-border);
  cursor: pointer; text-align: left;
  transition: background var(--t-fast);
}
.ex-biset-bar:active { background: var(--purple-dim); }
.ex-biset-bar-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--purple); flex-shrink: 0;
}
.ex-biset-bar-name {
  font-size: 12px; font-weight: 600; color: var(--text2);
  flex: 1; text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ex-biset-bar-arr { color: var(--purple); font-size: 16px; flex-shrink: 0; }

/* Drop arrow between series buttons */
.drop-arr {
  font-size: 11px; color: var(--orange); font-weight: 700;
  align-self: center; flex-shrink: 0;
}

/* Biset partner link in exercise detail page */
.ex-detail-biset-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 18px; margin: 8px 0;
  background: var(--purple-dim);
  border: 1px solid var(--purple-border);
  border-radius: var(--r-sm); cursor: pointer; text-align: left;
  transition: background var(--t-fast);
}
.ex-detail-biset-link:active { background: var(--purple-dim); }
.ex-detail-biset-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--purple); flex-shrink: 0;
}
.ex-detail-biset-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  flex: 1; text-transform: uppercase; letter-spacing: .3px;
}
.ex-detail-biset-arr { color: var(--purple); font-size: 18px; flex-shrink: 0; }

/* Series buttons row */
.ex-series-row {
  display: flex; gap: 6px;
  padding: 8px 10px 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.ex-serie-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; flex-shrink: 0;
  font-family: 'Barlow', sans-serif;
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-spring);
}
.ex-serie-btn:active { transform: scale(.88); }
.ex-serie-btn:hover  { border-color: var(--primary); }
.ex-serie-btn.done   {
  background: var(--primary-dim); border-color: var(--primary);
  animation: serieDone .32s var(--ease-spring) both;
}
.ex-serie-btn.dropset:not(.done) { border-style: dashed; }

.serie-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted2);
}
.ex-serie-btn.done .serie-label { color: var(--primary2); }

.serie-info {
  font-size: 12px; font-weight: 600; color: var(--muted2); line-height: 1.2;
}
.ex-serie-btn.done .serie-info { color: var(--text2); }

.serie-check { font-size: 12px; color: var(--primary2); font-weight: 800; }

/* ══════════════════════════════════════════════════════
   EXERCISE DETAIL — series edit list
══════════════════════════════════════════════════════ */
.ex-series-edit-list { padding: 0 18px; }

.detail-serie-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.detail-serie-row:last-child { border-bottom: none; }

.detail-serie-num {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--primary2);
  background: var(--primary-dim); border: 1px solid var(--border-primary);
  border-radius: 4px; padding: 4px 8px; flex-shrink: 0; margin-top: 2px;
}

.detail-serie-fields { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }

.detail-serie-field { flex: 1; min-width: 54px; }
.detail-serie-field label {
  display: block; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.detail-serie-field input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); padding: 8px 6px;
  font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 700;
  text-align: center; outline: none;
  transition: border-color var(--t-fast);
}
.detail-serie-field input:focus { border-color: var(--primary); }

.ex-series-edit-footer { padding: 10px 18px 20px; }
.ex-series-edit-btns   { display: flex; gap: 8px; margin-bottom: 12px; }

/* ── Check button per series on exercise detail ── */
.detail-serie-chk {
  width: 38px; height: 38px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%; border: 2px solid var(--border);
  background: transparent; color: var(--primary2);
  font-size: 17px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.detail-serie-chk:active { transform: scale(.84); }
.detail-serie-chk.done {
  background: var(--primary-dim); border-color: var(--primary);
  animation: serieDone .32s var(--ease-spring) both;
}
.detail-serie-row.done .detail-serie-num {
  color: var(--primary2); background: var(--primary-dim); border-color: var(--border-primary);
}

.btn-serie-add, .btn-serie-rem {
  flex: 1; padding: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: all var(--t-fast);
}
.btn-serie-add:hover { border-color: var(--primary); color: var(--primary); }
.btn-serie-rem:hover { border-color: var(--primary); color: var(--primary); }

/* ══════════════════════════════════════════════════════
   SETS SHEET — tipo selector + series list
══════════════════════════════════════════════════════ */

/* Make sets sheet scrollable */
.sets-sheet {
  max-height: 92vh !important;
  overflow-y: auto;
}

/* Tipo chips */
.sets-tipo-row {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.tipo-chip {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: all var(--t-fast);
}
.tipo-chip.active {
  background: var(--primary-dim); border-color: var(--primary); color: var(--primary2);
}
.tipo-chip:hover:not(.active) { border-color: var(--border2); color: var(--text2); }
.tipo-chip:active              { transform: scale(.93); }

/* Biset section */
.sets-biset-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.sets-biset-selected {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--primary-dim); border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--primary2);
}
.sets-biset-selected button {
  background: transparent; border: none; color: var(--muted2);
  cursor: pointer; font-size: 16px; transition: color var(--t-fast);
}
.sets-biset-selected button:hover { color: var(--primary); }

.sets-biset-results {
  max-height: 160px; overflow-y: auto;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); margin-bottom: 12px;
}
.sets-biset-results:empty { display: none; }
.sets-biset-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.sets-biset-item:last-child { border-bottom: none; }
.sets-biset-item:hover   { background: var(--bg4); }
.sets-biset-item.selected { background: var(--primary-dim); }
.sets-biset-item-name { font-size: 13px; font-weight: 600; }

/* Series list in sets sheet */
.sets-series-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted);
}
.sets-add-btn {
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--r-sm); color: var(--muted2);
  font-family: 'Barlow', sans-serif; font-size: 12px; font-weight: 600;
  padding: 4px 10px; cursor: pointer; letter-spacing: 0; text-transform: none;
  transition: all var(--t-fast);
}
.sets-add-btn:hover { border-color: var(--primary); color: var(--primary); }

.sets-series-list { margin-bottom: 4px; }

.sets-serie-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.sets-serie-row:last-child { border-bottom: none; }

.sets-serie-num {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--primary2);
  background: var(--primary-dim); border: 1px solid var(--border-primary);
  border-radius: 4px; padding: 3px 6px; flex-shrink: 0; min-width: 28px;
  text-align: center;
}

.sets-serie-inputs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }

.sets-serie-inp {
  flex: 1; min-width: 52px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  padding: 9px 6px; font-family: 'Barlow', sans-serif;
  font-size: 14px; font-weight: 600; text-align: center; outline: none;
  transition: border-color var(--t-fast);
}
.sets-serie-inp:focus { border-color: var(--primary); }

.sets-serie-del {
  background: transparent; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 4px 2px; flex-shrink: 0;
  transition: color var(--t-fast);
}
.sets-serie-del:hover { color: var(--primary); }

/* ── Extra chips for edit-workout exercise list ── */
.ew-ex-chip-orange {
  color: var(--orange);
  border-color: var(--orange-border) !important;
  background: var(--orange-dim) !important;
}
.ew-ex-chip-purple {
  color: var(--purple);
  border-color: var(--purple-border) !important;
  background: var(--purple-dim) !important;
}

/* Corpo scrollável genérico para páginas sem bottom-nav */
.page-scroll-body {
  flex: 1;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════════════════ */
.prof-body {
  flex: 1; overflow-y: auto; padding-bottom: 48px;
}

/* Dados pessoais — rótulo de seção */
.dados-section-label {
  padding: 20px 20px 4px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted);
}

.prof-photo-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 20px 20px; cursor: pointer; user-select: none;
  transition: opacity var(--t-fast);
}
.prof-photo-wrap:active { opacity: .75; }

.prof-foto-circle {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow', sans-serif;
  font-size: 34px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary-glow);
  overflow: hidden;
  transition: box-shadow var(--t-mid) var(--ease-spring),
              transform  var(--t-fast) var(--ease-spring);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.prof-photo-wrap:active .prof-foto-circle { transform: scale(.94); }

/* ══════════════════════════════════════════════════════
   MOBILE INTERACTION ANIMATIONS
══════════════════════════════════════════════════════ */

/* Satisfying pop when a series button is marked done */
@keyframes serieDone {
  0%   { transform: scale(1); }
  35%  { transform: scale(.84); }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Checkbox completion pop */
@keyframes checkPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(.72); }
  65%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* Bottom nav icon bounce when tab becomes active */
@keyframes navIconPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(.78); }
  75%  { transform: scale(1.22); }
  100% { transform: scale(1.18); }
}

/* Scratch button active state */
.btn-scratch:active { transform: scale(.97); opacity: .8; }

/* Sheet close button active */
.sheet-close:active { transform: scale(.92); }

/* Wc-btn-close active */
.wc-btn-close:active { transform: scale(.97); opacity: .8; }

/* Sets biset item tap */
.sets-biset-item:active { background: var(--bg4); }

/* Ex-pick-item stronger active */
.ex-pick-item:active { transform: scale(.978); }

/* Activity item head tap */
.act-item-head:active { background: var(--bg3); }
/* ══════════════════════════════════════════════════════
   FINANCEIRO (status card)
══════════════════════════════════════════════════════ */

/* Wrapper externo — mesma margem horizontal dos section-labels */
#financeiro-card,
#financeiro-card-treino {
  padding: 0 12px 4px;
}

.fin-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  animation: cardIn var(--t-slow) var(--ease-out) both;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}
.fin-card:hover {
  border-left-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

/* Variantes de estado */
.fin-card--em-dia  { border-left-color: var(--green); }
.fin-card--alerta  { border-left-color: var(--yellow); }
.fin-card--vencido { border-left-color: var(--danger); }

/* Círculo com ícone */
.fin-card-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

/* Textos centrais */
.fin-card-info     { flex: 1; min-width: 0; }
.fin-card-heading  {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.fin-card-plan     {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.fin-card-due      {
  font-size: 12px;
  color: var(--muted2);
}
.fin-card--alerta  .fin-card-due { color: var(--yellow); }
.fin-card--vencido .fin-card-due { color: var(--danger); }

/* Badge de status */
.fin-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fin-badge--em-dia {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-border);
}
.fin-badge--alerta {
  background: var(--yellow-dim);
  color: var(--yellow);
  border-color: var(--yellow-border);
}
.fin-badge--vencido {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ══════════════════════════════════════════════════════
   PAGE FINANCEIRO (página dedicada)
══════════════════════════════════════════════════════ */

.fin-page-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-left: 4px solid var(--green);
  border-radius: 14px;
  padding: 20px;
  transition: border-color var(--t-mid);
}
.fin-page-card--vencido { border-left-color: var(--danger); }

.fin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.fin-page-plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text1);
  flex: 1;
  min-width: 0;
}
.fin-page-duracao {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.fin-page-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid var(--border2);
  padding-top: 14px;
}
.fin-page-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
.fin-page-label {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.fin-page-value {
  color: var(--text2);
  text-align: right;
}
.fin-page-value--vencido { color: var(--danger); font-weight: 600; }
.fin-page-dependente .fin-page-value { color: var(--accent); }

.fin-page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}
.fin-page-empty-icon { font-size: 48px; }
.fin-page-empty-text { font-size: 16px; font-weight: 600; color: var(--text2); }
.fin-page-empty-sub  { font-size: 13px; color: var(--muted); }

/* ══════════════════════════════════════════════════════
   AVALIAÇÃO FÍSICA — cards e chips
══════════════════════════════════════════════════════ */

.av-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 14px 16px;
}

.av-chip {
  display: inline-flex;
  flex-direction: column;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  line-height: 1.3;
}

.av-chip-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}

/* ══════════════════════════════════════════════════════
   NOVIDADES (news timeline)
══════════════════════════════════════════════════════ */

/* Container — linha vertical de timeline à esquerda */
.news-list {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 4px 12px 32px 12px;
  gap: 12px;
}
.news-list::before {
  content: '';
  position: absolute;
  left: 24px;                         /* alinha com o centro do dot */
  top: 14px; bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary) 0%, transparent 100%);
  opacity: .18;
  pointer-events: none;
}

/* Card base */
.news-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition:
    border-color var(--t-mid),
    box-shadow var(--t-mid),
    transform var(--t-fast) var(--ease-spring);
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
.news-card:hover {
  border-color: var(--border2);
  border-left-color: var(--primary);
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
  transform: translateY(-1px);
}

/* Post mais recente: destaque com borda azul */
.news-card--featured {
  border-left-color: var(--primary);
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
}

/* Corpo do card */
.news-card-body {
  padding: 14px 16px;
}

/* Linha de meta: dot + data + badge */
.news-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

/* Ponto colorido da timeline */
.news-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.news-card--featured .news-card-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Data */
.news-card-date {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

/* Badge "Novo" */
.news-card-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-dim);
  border: 1px solid var(--border-primary);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Título */
.news-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 7px;
}
.news-card--featured .news-card-title {
  font-size: 16px;
}

/* Texto do post */
.news-card-text {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.65;
}

/* Estado vazio */
.news-empty {
  padding: 32px 0 8px;
  text-align: center;
}
.news-empty-icon { font-size: 36px; margin-bottom: 10px; }
.news-empty-text { font-size: 13px; color: var(--muted); }

/* ══════════════════════════════════════════════════════
   SIDEBAR (menu lateral)
══════════════════════════════════════════════════════ */

/* Overlay escurecendo o fundo */
#sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-page);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Painel lateral */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border2);
  z-index: 501;
  transform: translateX(-100%);
  transition: transform 320ms var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 8px 0 40px rgba(0,0,0,.55);
}
#sidebar.open {
  transform: translateX(0);
}

/* Cabeçalho do sidebar */
.sidebar-header {
  padding: 52px 20px 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg2) 100%);
  flex-shrink: 0;
}

/* Botão fechar (X) */
.sidebar-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--muted2);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1;
}
.sidebar-close:hover { background: var(--bg5); color: var(--text); }

/* Avatar no header do sidebar */
.sidebar-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--primary-glow);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-spring);
  flex-shrink: 0;
}
.sidebar-avatar:active { transform: scale(.93); }

/* Nome do usuário */
.sidebar-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}

/* Chip de status */
.sidebar-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.status-ativo    { background: var(--green-dim);  color: var(--green); border: 1px solid var(--green-border); }
.status-pendente { background: var(--yellow-dim);  color: var(--yellow); border: 1px solid var(--yellow-border); }
.status-inativo  { background: var(--danger-dim);   color: var(--danger); border: 1px solid var(--danger-border); }

/* Área de navegação — cresce e rola se necessário */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* Item de menu */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-item:hover  { background: var(--bg3); color: var(--text); }
.sidebar-item:active { background: var(--bg4); }

/* ── Item ativo ── */
.sidebar-item--active {
  color: var(--text);
  background: var(--bg3);
  /* inset shadow = borda esquerda 3px sem afetar layout */
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-item--active .sidebar-item-icon {
  color: var(--primary);
}
/* Hover sobre item ativo mantém a cor azul no ícone */
.sidebar-item--active:hover .sidebar-item-icon {
  color: var(--primary2);
}

.sidebar-item-icon {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted2);
  transition: color var(--t-fast);
}
/* O ícone herda a cor do item pai no hover/active */
.sidebar-item:hover  .sidebar-item-icon,
.sidebar-item:active .sidebar-item-icon { color: var(--text); }
.sidebar-logout:hover .sidebar-item-icon { color: var(--danger); }

/* SVGs dentro do sidebar usam currentColor automaticamente */
.sidebar-item-icon svg { display: block; }

/* Divisor visual entre grupos */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 20px;
}

/* Rodapé com logout */
.sidebar-footer {
  padding: 6px 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logout         { color: var(--muted2); }
.sidebar-logout:hover   { color: var(--danger); background: var(--danger-dim); }

/* ── Animações de entrada ────────────────────────────── */

/* Itens de menu: slide da esquerda + fade */
@keyframes sidebarItemIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

/* Header body: slide para baixo + fade */
@keyframes sidebarHdrIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* Só animam quando a classe .sidebar-animating está presente */
#sidebar.sidebar-animating .sidebar-header-body {
  animation: sidebarHdrIn 300ms var(--ease-out) 30ms both;
}

/* Todos os filhos diretos do nav + botão de logout */
#sidebar.sidebar-animating .sidebar-nav > *,
#sidebar.sidebar-animating .sidebar-footer .sidebar-item {
  animation: sidebarItemIn 260ms var(--ease-out) both;
}

/* Stagger: 40ms entre cada filho */
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(1) { animation-delay:  70ms; }
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(2) { animation-delay: 110ms; }
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(3) { animation-delay: 150ms; }
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(4) { animation-delay: 190ms; } /* divider */
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(5) { animation-delay: 190ms; }
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(6) { animation-delay: 230ms; }
#sidebar.sidebar-animating .sidebar-nav > *:nth-child(7) { animation-delay: 270ms; }
#sidebar.sidebar-animating .sidebar-footer .sidebar-item  { animation-delay: 310ms; }

/* ── Botão hamburguer (SVG 3 linhas) ── */
.btn-hamburger {
  background: transparent;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
}
.btn-hamburger:hover  { color: var(--text2); }
.btn-hamburger svg    { display: block; }


.news-card-img {
  width: 100%;
  display: block;
  max-height: 220px;
  object-fit: cover;
  border-top: 1px solid var(--border);
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}
