/* ============================================================
   بدنساز هوشمند — Main Stylesheet
   Dark theme, gold accents, RTL Persian, bodybuilding brand
   ============================================================ */

:root {
  /* Brand */
  --bg:        #09090f;
  --bg-2:      #0c0c14;
  --surf1:     #111118;
  --surf2:     #181820;
  --surf3:     #1f1f2a;
  --border:    #2c2c3a;
  --border2:   #3a3a4e;
  --gold:      #d4a843;
  --gold2:     #e8c070;
  --gold-dim:  rgba(212,168,67,.13);
  --gold-glow: rgba(212,168,67,.25);
  --push:      #e05c4a;
  --pull:      #4a8de0;
  --legs:      #3ebc78;
  --core:      #c46be0;
  --text:      #dde0ea;
  --text-2:    #b8bcc8;
  --muted:     #7e8398;
  --dim:       #4a4d62;
  --warn:      #e0944a;
  --danger:    #e0533a;
  --success:   #3ebc78;
  --r:         16px;
  --r-md:      12px;
  --r-sm:      9px;
  --shadow:    0 10px 40px -10px rgba(0,0,0,.5);
  --shadow-gold: 0 10px 40px -10px rgba(212,168,67,.3);
  --maxw:      1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.public-layout { background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(9,9,15,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s, background .3s;
}
.site-header.scrolled { box-shadow: 0 6px 24px -8px rgba(0,0,0,.6); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand-mark { color: var(--gold); display: flex; }
.brand-name { background: linear-gradient(90deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a {
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--text-2); transition: all .2s; white-space: nowrap;
}
.site-nav > a:hover, .site-nav > a.active { color: var(--gold); background: var(--gold-dim); }

.nav-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1208 !important; font-weight: 700 !important; padding: 9px 20px !important;
  border-radius: 10px; transition: transform .2s, box-shadow .2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-gold); background: linear-gradient(135deg, var(--gold2), var(--gold)) !important; }
.nav-cta.ghost { background: transparent !important; color: var(--text-2) !important; border: 1px solid var(--border2); }
.nav-cta.ghost:hover { border-color: var(--gold); color: var(--gold) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: 68px; right: 0; bottom: 0;
    width: 280px; max-width: 85vw; flex-direction: column; align-items: stretch;
    background: var(--surf1); border-right: 1px solid var(--border);
    padding: 18px; gap: 6px; transform: translateX(100%); transition: transform .3s;
    overflow-y: auto;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav > a { padding: 14px 16px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 12px; font-size: 14.5px; font-weight: 700;
  border: none; cursor: pointer; transition: all .25s; white-space: nowrap;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1a1208; box-shadow: var(--shadow-gold); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px rgba(212,168,67,.45); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-outline-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(212,168,67,.3); }
.btn-outline-gold:hover { background: rgba(212,168,67,.2); }
.btn-danger { background: rgba(224,83,58,.15); color: var(--danger); border: 1px solid rgba(224,83,58,.3); }
.btn-danger:hover { background: rgba(224,83,58,.25); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ============================================================
   LANDING — HERO
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  padding: 70px 0 90px;
  background:
    radial-gradient(ellipse 80% 50% at 80% 0%, rgba(212,168,67,.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 30%, rgba(196,107,224,.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0);
  background-size: 38px 38px; opacity: .6; pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-dim); border: 1px solid rgba(212,168,67,.3);
  color: var(--gold); font-size: 12.5px; font-weight: 700;
  padding: 7px 16px; border-radius: 30px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px); font-weight: 900; line-height: 1.18;
  margin-bottom: 18px; letter-spacing: -.01em;
}
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--text-2); font-size: 17px; line-height: 1.8; max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 32px; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stat .num { font-size: 28px; font-weight: 900; color: var(--gold); line-height: 1; }
.hero-stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Hero visual — animated phone mockup */
.hero-visual { position: relative; display: flex; justify-content: center; }
.phone-mock {
  width: 300px; max-width: 80vw; aspect-ratio: 9/19;
  background: linear-gradient(160deg, var(--surf2), var(--surf1));
  border: 1px solid var(--border2); border-radius: 36px; padding: 14px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(212,168,67,.08);
  position: relative; animation: floaty 5s ease-in-out infinite;
}
.phone-mock::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 6px; background: var(--bg); border-radius: 4px;
}
.phone-screen { background: var(--bg); border-radius: 26px; height: 100%; padding: 26px 14px 14px; overflow: hidden; }
.ps-eyebrow { font-size: 8px; color: var(--gold); font-weight: 800; letter-spacing: .1em; }
.ps-title { font-size: 14px; font-weight: 800; margin: 6px 0 12px; }
.ps-day { display: flex; align-items: center; gap: 8px; background: var(--surf2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.ps-day .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ps-day .nm { font-size: 11px; font-weight: 700; }
.ps-day .lb { font-size: 9px; color: var(--muted); margin-right: auto; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.floating-chip {
  position: absolute; background: var(--surf2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 10px 14px; font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
  animation: floaty 4s ease-in-out infinite;
}
.fc-1 { top: 8%; right: -10px; color: var(--legs); }
.fc-2 { bottom: 14%; left: -20px; color: var(--gold); animation-delay: 1.2s; }
.fc-3 { top: 44%; left: -34px; color: var(--core); animation-delay: 2.2s; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .floating-chip { display: none; }
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.section-eyebrow {
  display: inline-block; color: var(--gold); font-size: 13px; font-weight: 800;
  letter-spacing: .08em; margin-bottom: 14px;
}
.section-title { font-size: clamp(26px, 4vw, 38px); font-weight: 900; line-height: 1.25; margin-bottom: 14px; }
.section-desc { color: var(--text-2); font-size: 16px; }

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.feature-card {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r);
  padding: 30px; transition: transform .3s, border-color .3s; position: relative; overflow: hidden;
}
.feature-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px;
  background: radial-gradient(circle, var(--gold-dim), transparent 70%); opacity: 0; transition: opacity .3s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(212,168,67,.3); }
.feature-card:hover::after { opacity: 1; }
.feature-icon {
  width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim); color: var(--gold); font-size: 26px; margin-bottom: 18px;
}
.feature-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.feature-card p { color: var(--text-2); font-size: 14.5px; line-height: 1.8; }

/* ============================================================
   AI ADVANTAGES (vs traditional coaches)
   ============================================================ */
.adv-section { background: var(--bg-2); }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.adv-col { padding: 36px 32px; }
.adv-col.trad { background: var(--surf1); border-left: 1px solid var(--border); }
.adv-col.ai { background: linear-gradient(160deg, var(--surf1), var(--gold-dim)); }
.adv-col h3 { font-size: 20px; font-weight: 800; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.adv-col.trad h3 { color: var(--muted); }
.adv-col.ai h3 { color: var(--gold); }
.adv-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.adv-item:last-child { border-bottom: none; }
.adv-ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.adv-col.trad .adv-ic { background: rgba(224,83,58,.12); color: var(--danger); }
.adv-col.ai .adv-ic { background: rgba(62,188,120,.12); color: var(--success); }
.adv-item p { font-size: 14px; line-height: 1.7; }
.adv-col.trad .adv-item p { color: var(--muted); }
.adv-col.ai .adv-item p { color: var(--text); }
@media (max-width: 760px) { .adv-grid { grid-template-columns: 1fr; } .adv-col.trad { border-left: none; border-bottom: 1px solid var(--border); } }

/* ============================================================
   HOW IT WORKS — steps
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.step { text-align: center; position: relative; }
.step-num {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--surf1); border: 2px solid var(--gold); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900;
  position: relative; z-index: 2;
}
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 28px; right: -50%; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--gold-dim), transparent); z-index: 1;
}
.step h4 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 13.5px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } .step:not(:last-child)::after { display: none; } }
@media (max-width: 440px) { .steps { grid-template-columns: 1fr; } }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.testi-card { background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r); padding: 28px; }
.testi-stars { color: var(--gold); font-size: 16px; letter-spacing: 2px; margin-bottom: 14px; }
.testi-text { font-size: 15px; line-height: 1.9; color: var(--text); margin-bottom: 20px; }
.testi-user { display: flex; align-items: center; gap: 12px; }
.testi-ava { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--core)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #1a1208; }
.testi-user .nm { font-weight: 700; font-size: 14px; }
.testi-user .lb { font-size: 12px; color: var(--muted); }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--surf1), var(--surf2));
  border: 1px solid rgba(212,168,67,.25); border-radius: 24px;
  padding: 56px 40px; text-align: center; position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ''; position: absolute; top: -50%; left: -10%; width: 60%; height: 200%;
  background: radial-gradient(ellipse, var(--gold-glow), transparent 60%); opacity: .4;
}
.cta-banner h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 900; margin-bottom: 14px; position: relative; }
.cta-banner p { color: var(--text-2); font-size: 16px; margin-bottom: 28px; max-width: 540px; margin-left: auto; margin-right: auto; position: relative; }
.cta-banner .hero-cta { justify-content: center; position: relative; }

/* ============================================================
   AUTH PAGES (login/register)
   ============================================================ */
.auth-wrap { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 50px 20px; background: radial-gradient(ellipse at top, var(--gold-dim), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surf1); border: 1px solid var(--border); border-radius: 22px; padding: 40px 36px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 560px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .brand { justify-content: center; font-size: 22px; }
.auth-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-label .req { color: var(--gold); }
.form-control {
  width: 100%; padding: 13px 15px; background: var(--surf2); border: 1px solid var(--border2);
  border-radius: 11px; color: var(--text); font-size: 15px; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.form-control::placeholder { color: var(--dim); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%237e8398' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 15px center; padding-left: 38px; }

.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.input-ic { position: relative; }
.input-ic .form-control { padding-right: 44px; }
.input-ic .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }

/* checkbox / radio cards */
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.check-card {
  position: relative; display: block; padding: 16px 14px; background: var(--surf2);
  border: 1px solid var(--border2); border-radius: 12px; cursor: pointer; transition: all .2s; text-align: center;
}
.check-card input { position: absolute; opacity: 0; }
.check-card:hover { border-color: var(--border2); }
.check-card:has(input:checked) { border-color: var(--gold); background: var(--gold-dim); }
.check-card .cc-ic { font-size: 26px; margin-bottom: 8px; }
.check-card .cc-lb { font-size: 13px; font-weight: 600; }

.auth-foot { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--gold); font-weight: 600; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-wrap { margin-top: 16px; }
.flash { padding: 13px 18px; border-radius: 11px; margin-bottom: 10px; font-size: 14px; font-weight: 500; }
.flash-error { background: rgba(224,83,58,.12); border: 1px solid rgba(224,83,58,.3); color: #ff8a72; }
.flash-success { background: rgba(62,188,120,.12); border: 1px solid rgba(62,188,120,.3); color: #6ee0a0; }
.flash-info { background: var(--gold-dim); border: 1px solid rgba(212,168,67,.3); color: var(--gold2); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--surf1); border-top: 1px solid var(--border); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; padding: 56px 20px 40px; }
.footer-brand-col .brand { margin-bottom: 16px; }
.footer-desc { color: var(--muted); font-size: 14px; max-width: 320px; margin-bottom: 18px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; background: var(--surf2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); transition: all .2s; }
.footer-social a:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.footer-col h4 { font-size: 14px; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.footer-col a, .footer-col span { display: block; color: var(--muted); font-size: 13.5px; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-bottom span, .footer-bottom a { font-size: 13px; color: var(--muted); }
.footer-bottom a:hover { color: var(--gold); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }

/* ============================================================
   SCROLL TOP
   ============================================================ */
.scroll-top {
  position: fixed; bottom: 24px; left: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surf2); border: 1px solid var(--border2); color: var(--gold); font-size: 20px;
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 900; box-shadow: var(--shadow);
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--gold); color: #1a1208; transform: translateY(-2px); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.app-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-sidebar {
  background: var(--surf1); border-left: 1px solid var(--border); padding: 22px 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .brand { margin-bottom: 26px; padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 11px;
  color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: all .2s;
}
.side-nav a:hover { background: var(--surf2); color: var(--text); }
.side-nav a.active { background: var(--gold-dim); color: var(--gold); font-weight: 700; }
.side-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-nav .sep { height: 1px; background: var(--border); margin: 12px 6px; }
.app-main { padding: 30px; min-width: 0; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.app-title { font-size: 22px; font-weight: 800; }
.app-user { display: flex; align-items: center; gap: 12px; }
.app-ava { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--core)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #1a1208; }

.sidebar-toggle { display: none; }

@media (max-width: 880px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; top: 0; right: 0; z-index: 1100; width: 260px; max-width: 85vw;
    transform: translateX(100%); transition: transform .3s;
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .app-main { padding: 18px 14px; }
}

/* cards */
.card { background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 17px; font-weight: 800; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; position: relative; overflow: hidden; }
.stat-card .ic { font-size: 22px; margin-bottom: 12px; }
.stat-card .num { font-size: 30px; font-weight: 900; color: var(--gold); line-height: 1; }
.stat-card .lb { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* table */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 600px; }
table.tbl th { background: var(--surf3); padding: 13px 15px; font-size: 12px; font-weight: 700; text-align: right; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 13px 15px; font-size: 14px; border-bottom: 1px solid rgba(44,44,58,.6); }
table.tbl tbody tr:hover { background: rgba(212,168,67,.04); }
table.tbl tbody tr:last-child td { border-bottom: none; }

/* badges */
.badge-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-green { background: rgba(62,188,120,.13); color: var(--success); }
.badge-red { background: rgba(224,83,58,.13); color: var(--danger); }
.badge-gray { background: var(--surf3); color: var(--muted); }
.badge-purple { background: rgba(196,107,224,.13); color: var(--core); }

/* empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { font-size: 44px; margin-bottom: 14px; opacity: .5; }
.empty h3 { font-size: 17px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.empty p { font-size: 14px; }

/* ============================================================
   PROGRAM DISPLAY (workout template)
   ============================================================ */
.prog-wrap { background: var(--bg); min-height: 100vh; }
.prog-hero {
  padding: 36px 20px 28px; background: linear-gradient(160deg, var(--bg) 0%, #12121e 60%, #151525 100%);
  border-bottom: 1px solid var(--border); position: relative; overflow: hidden;
}
.prog-hero::after { content: ''; position: absolute; top: -80px; right: -80px; width: 360px; height: 360px; background: radial-gradient(circle, rgba(212,168,67,.07), transparent 70%); pointer-events: none; }
.prog-hero-inner { max-width: 960px; margin: 0 auto; position: relative; z-index: 1; }
.prog-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-dim); border: 1px solid rgba(212,168,67,.25); color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 14px; border-radius: 20px; margin-bottom: 14px; }
.prog-hero h1 { font-size: clamp(22px, 5vw, 34px); font-weight: 900; line-height: 1.2; margin-bottom: 6px; }
.prog-hero h1 em { font-style: normal; color: var(--gold); }
.prog-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.prog-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.prog-chip { background: var(--surf2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; display: flex; flex-direction: column; gap: 2px; }
.prog-chip .cl { color: var(--dim); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
.prog-chip .cv { color: var(--gold); font-size: 12.5px; font-weight: 700; }
.v-badge { display: inline-block; background: rgba(196,107,224,.15); border: 1px solid rgba(196,107,224,.3); color: var(--core); font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; }

.prog-nav-wrap { background: var(--surf1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.prog-nav-inner { max-width: 960px; margin: 0 auto; display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 6px; }
.prog-nav-inner::-webkit-scrollbar { display: none; }
.prog-tab { flex-shrink: 0; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 13px 15px; cursor: pointer; transition: color .2s, border-color .2s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.prog-tab:hover { color: var(--text); }
.prog-tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.prog-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dp { background: var(--push) } .dl { background: var(--pull) } .dg { background: var(--legs) } .dc { background: var(--core) } .di { background: var(--gold) } .dr { background: var(--dim) }

.prog-main { max-width: 960px; margin: 0 auto; padding: 22px 16px 70px; }
.prog-sec { display: none; }
.prog-sec.on { display: block; }

.dh { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 22px; }
.dh-badge { width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; line-height: 1.3; text-align: center; }
.bp { background: rgba(224,92,74,.11); color: var(--push); border: 1px solid rgba(224,92,74,.3) }
.bl { background: rgba(74,141,224,.11); color: var(--pull); border: 1px solid rgba(74,141,224,.3) }
.bg { background: rgba(62,188,120,.11); color: var(--legs); border: 1px solid rgba(62,188,120,.3) }
.br { background: rgba(60,62,80,.15); color: var(--dim); border: 1px solid var(--border) }
.bc { background: rgba(196,107,224,.11); color: var(--core); border: 1px solid rgba(196,107,224,.3) }
.core-t { background: rgba(196,107,224,.11); color: var(--core); }
.dh-info h2 { font-size: 16px; font-weight: 800; margin-bottom: 5px; }
.dh-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.dh-tag { font-size: 10.5px; padding: 2px 9px; border-radius: 4px; background: var(--surf3); border: 1px solid var(--border); color: var(--muted); }
.dh-tag.hi { background: var(--gold-dim); border-color: rgba(212,168,67,.3); color: var(--gold); }

.ph { margin-bottom: 22px; }
.ph-title { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding-bottom: 9px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.ph-title .bar { width: 18px; height: 2px; background: var(--gold); border-radius: 2px; flex-shrink: 0; }
.ph-title .num { background: var(--gold-dim); color: var(--gold); font-size: 9px; font-weight: 900; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.tw { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table.prog-tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.prog-tbl thead tr { background: var(--surf3); }
table.prog-tbl th { padding: 9px 12px; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
table.prog-tbl tbody tr { border-bottom: 1px solid rgba(44,44,58,.7); transition: background .15s; }
table.prog-tbl tbody tr:last-child { border-bottom: none; }
table.prog-tbl tbody tr:hover { background: rgba(212,168,67,.04); }
table.prog-tbl td { padding: 11px 12px; font-size: 12.5px; vertical-align: top; text-align: right; }
td.tnum { color: var(--dim); font-size: 10.5px; font-weight: 800; width: 28px; }
.ex-name-fa { color: var(--text); font-weight: 700; line-height: 1.4; display: block; }
.ex-name-en { color: var(--dim); font-size: 10px; font-weight: 400; display: block; margin-top: 1px; }
.tb-pill { display: inline-block; background: var(--surf3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.sb { display: inline-flex; align-items: center; gap: 4px; }
.ss { font-weight: 800; color: var(--gold); font-size: 13px; }
.sx { color: var(--dim); font-size: 10px; }
.sr { color: var(--text); }
.rt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tip { color: var(--muted); font-size: 11.5px; line-height: 1.65; max-width: 230px; }
.tip strong { color: var(--gold2); font-weight: 600; }

a.ex-link { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(212,168,67,.4); transition: color .15s, border-color .15s; display: inline; }
a.ex-link:hover { color: var(--gold2); border-bottom-color: var(--gold2); }
.act-row td { background: rgba(212,168,67,.04); }
.act-row .ex-name-fa { color: var(--gold2); }
.mmc-row td { background: rgba(196,107,224,.04); }
.mmc-row .ex-name-fa { color: #d49ee8; }
.stag { display: inline-block; background: rgba(212,168,67,.18); border: 1px solid rgba(212,168,67,.35); color: var(--gold); font-size: 8.5px; font-weight: 800; padding: 1px 5px; border-radius: 3px; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; margin-left: 3px; }
.ctag { display: inline-block; background: rgba(196,107,224,.18); border: 1px solid rgba(196,107,224,.35); color: var(--core); font-size: 8.5px; font-weight: 800; padding: 1px 5px; border-radius: 3px; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; margin-left: 3px; }
.atag { display: inline-block; background: rgba(212,168,67,.1); border: 1px solid rgba(212,168,67,.2); color: var(--gold2); font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; margin-left: 3px; }

.warmup { background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 16px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.warmup .ic { font-size: 18px; }

.ng { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
@media (max-width: 600px) { .ng { grid-template-columns: 1fr; } }
.nc { background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 15px; }
.nc.full { grid-column: 1 / -1; }
.nc h4 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.nc ul { padding-right: 16px; color: var(--muted); font-size: 12px; line-height: 1.9; list-style: disc; }
.nc p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.nc li strong { color: var(--text); font-weight: 600; }

.warn-box { background: rgba(224,148,74,.07); border: 1px solid rgba(224,148,74,.22); border-radius: var(--r-sm); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #c08050; margin-top: 10px; }
.mmc-box { background: rgba(196,107,224,.07); border: 1px solid rgba(196,107,224,.2); border-radius: var(--r-sm); padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #b880d0; margin-bottom: 12px; }

.ig { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 22px; }
.ic-card { background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.ic-card h3 { font-size: 12.5px; font-weight: 800; color: var(--gold); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ic-card ul, .ic-card p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.ic-card ul { padding-right: 16px; list-style: disc; }
.ic-card li strong { color: var(--text); font-weight: 600; }

.wo { background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 18px; }
.wo h3 { font-size: 13px; font-weight: 800; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.wk-row { display: flex; flex-direction: column; gap: 7px; }
.wd { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surf3); }
.wd-n { font-size: 12px; font-weight: 700; width: 75px; flex-shrink: 0; }
.wd-t { font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 4px; flex-shrink: 0; white-space: nowrap; }
.push-t { background: rgba(224,92,74,.11); color: var(--push); }
.pull-t { background: rgba(74,141,224,.11); color: var(--pull); }
.legs-t { background: rgba(62,188,120,.11); color: var(--legs); }
.rest-t { background: rgba(62,65,88,.15); color: var(--dim); }
.wd-d { color: var(--muted); font-size: 11px; }

.mcov { background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 18px; }
.mcov h3 { font-size: 13px; font-weight: 800; color: var(--gold); margin-bottom: 14px; }
.mcov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mcov-item { background: var(--surf3); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcov-name { font-size: 12px; font-weight: 600; }
.mcov-freq { font-size: 10px; font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: 4px; }
.f2 { background: rgba(62,188,120,.15); color: var(--legs); }
.f3 { background: rgba(212,168,67,.15); color: var(--gold); }
.f4 { background: rgba(196,107,224,.15); color: var(--core); }

.ptab { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.ptab th, .ptab td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.ptab th { color: var(--dim); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; background: var(--surf3); }
.ptab td { color: var(--muted); }
.ptab td:first-child { color: var(--gold); font-weight: 700; }

.sh { text-align: center; color: var(--dim); font-size: 10px; padding: 5px 0 0; display: none; }
@media (max-width: 640px) { .sh { display: block; } }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-stat { color: var(--gold); }

/* misc */
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }

/* loader */
.loader { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* page content (editable pages) */
.page-content { max-width: 800px; margin: 0 auto; padding: 50px 20px; }
.page-content h1 { font-size: 30px; font-weight: 900; margin-bottom: 24px; color: var(--gold); }
.page-content h2 { font-size: 22px; font-weight: 800; margin: 28px 0 14px; }
.page-content p { color: var(--text-2); line-height: 2; margin-bottom: 16px; font-size: 15.5px; }
.page-content ul { padding-right: 22px; margin-bottom: 16px; }
.page-content li { color: var(--text-2); line-height: 2; }
