/* ═══════════════════════════════════════════════════════
   BODY SUPPORT — Premium Design System v4
   Dark Fitness Platform • Neon Lime • Ultra Premium
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

/* ── Design Tokens ──────────────────────────────────── */
:root {
  color-scheme: dark;

  /* Backgrounds */
  --bg:         #080808;
  --bg-2:       #0C0C0C;

  /* Surfaces */
  --surf:       #111111;
  --surf-2:     #171717;
  --surf-3:     #1E1E1E;
  --surf-hover: #222222;

  /* Borders */
  --border:     #1A1A1A;
  --border-2:   #262626;
  --border-3:   #363636;

  /* Text */
  --text:       #F2F2F2;
  --text-2:     #8A8A8A;
  --text-3:     #4E4E4E;

  /* Accent — Neon Lime */
  --lime:       #C2F03C;
  --lime-dim:   #A8D429;
  --lime-10:    rgba(194,240,60,.10);
  --lime-15:    rgba(194,240,60,.15);
  --lime-30:    rgba(194,240,60,.30);

  /* Status */
  --green:      #22D494;
  --green-10:   rgba(34,212,148,.10);
  --amber:      #F8A500;
  --amber-10:   rgba(248,165,0,.10);
  --red:        #FF4444;
  --red-10:     rgba(255,68,68,.10);
  --blue:       #4A9EFF;
  --blue-10:    rgba(74,158,255,.10);
  --purple:     #9B6DFF;
  --purple-10:  rgba(155,109,255,.10);

  /* Layout */
  --sidebar-w:  240px;
  --topbar-h:   64px;
  --max-w:      1200px;

  /* Radius */
  --r-xs:   5px;
  --r-sm:   8px;
  --r:      12px;
  --r-md:   14px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 4px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.4);
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.6);
  --shadow-xl: 0 16px 64px rgba(0,0,0,.7);

  /* Transitions */
  --t-fast: 120ms ease;
  --t:      200ms ease;
  --t-slow: 360ms cubic-bezier(.4,0,.2,1);

  /* Fonts */
  --font-head: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ── Base Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
}
p { color: var(--text-2); line-height: 1.65; }
.kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
}
.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
  display: block;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════
   MEMBER SHELL LAYOUT
   ═══════════════════════════════════════════════════════ */
.member-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 72px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.sidebar-brand .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
  background: none;
  width: 100%;
  cursor: pointer;
  border: 1px solid transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: var(--surf); color: var(--text); }
.nav-item.active {
  background: var(--lime-10);
  color: var(--lime);
  font-weight: 600;
  border-color: var(--lime-15);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .65; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }
.nav-label { flex: 1; }

.sidebar-sep { height: 1px; background: var(--border); margin: 8px 10px; }

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  transition: background var(--t-fast);
  cursor: default;
}
.sidebar-user:hover { background: var(--surf); }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--lime-10);
  border: 2px solid var(--lime-30);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--lime);
  flex-shrink: 0;
  font-family: var(--font-head);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ── Member Body ────────────────────────────────────── */
.member-body {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center; /* center member-main horizontally when viewport > max-width */
}

/* ── Member Topbar (mobile header) ─────────────────────── */
.member-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  flex-shrink: 0;
  height: 56px; /* slightly shorter = more content space */
  background: rgba(8,8,8,.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
}
.topbar-brand .brand-mark { width: 26px; height: 26px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surf);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.topbar-btn:hover { background: var(--surf-3); color: var(--text); }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--lime-10);
  border: 2px solid var(--lime-30);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  color: var(--lime);
  font-family: var(--font-head);
  cursor: pointer;
}

/* ── Member Main ────────────────────────────────────── */
.member-main {
  flex: 1;
  padding: 28px 32px 40px;
  max-width: 1240px;
  width: 100%;
}
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: clamp(20px,2.5vw,26px);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.035em;
  margin-top: 4px;
  color: var(--text);
}
.page-desc { margin-top: 6px; font-size: 14px; color: var(--text-2); }

/* ── Bottom Nav (mobile) — floating pill ────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: #101010;
  border: 1px solid rgba(194,240,60,.28);
  border-radius: var(--r-2xl);
  box-shadow: 0 0 14px rgba(194,240,60,.08), 0 8px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.3);
  width: calc(100% - 32px);
  max-width: 430px;
  height: 64px;
  overflow: hidden;
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  width: 100%;
  padding: 0 4px;
  gap: 0;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 5px;
  border-radius: var(--r-md);
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  transition: color 160ms ease, transform 120ms ease;
  flex: 1;
  max-width: 80px;
  min-height: 52px;
  text-transform: none;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.bnav-item svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
  transition: transform 120ms ease;
}
.bnav-item span {
  white-space: nowrap;
  line-height: 1;
}
.bnav-item:active { transform: scale(.94); }
.bnav-item:active svg { transform: scale(.9); }

/* Active state: lime dot above icon */
.bnav-item::before {
  content: "";
  display: block;
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0;
  transition: opacity 160ms ease;
}
.bnav-item.active::before { opacity: 1; }
.bnav-item.active {
  color: var(--lime);
  background: none;
}
.bnav-item.active svg {
  filter: drop-shadow(0 0 4px rgba(194,240,60,.35));
}

/* ── Sidebar Overlay ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 99;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.visible { display: block; }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color var(--t), box-shadow var(--t);
}
.card-hover:hover {
  border-color: var(--border-3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  cursor: pointer;
}
.card-sm  { padding: 16px; border-radius: var(--r); }
.card-xs  { padding: 12px; border-radius: var(--r-sm); }
.inner-card {
  background: var(--surf-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
}

/* ── Stats Card ─────────────────────────────────────── */
.stat-card {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t);
}
.stat-card:hover { border-color: var(--border-3); }
.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text);
  line-height: 1;
}
.stat-sub { font-size: 12px; color: var(--text-3); }
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }

/* ── Grids ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 14px; }

/* ── Section Header ─────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 16px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
}
.section-kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 4px;
  display: block;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  background: var(--lime);
  color: #080808;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { background: #d0ff50; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(194,240,60,.25); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn-sm  { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-md  { height: 38px; padding: 0 14px; font-size: 13px; }
.btn-lg  { height: 50px; padding: 0 26px; font-size: 15px; border-radius: var(--r-md); }
.btn-xl  { height: 58px; padding: 0 36px; font-size: 16px; border-radius: var(--r-lg); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--surf-2); color: var(--text); border-color: var(--border-3); transform: none; box-shadow: none; }

.btn-surface {
  background: var(--surf-2);
  color: var(--text);
  border-color: var(--border-2);
}
.btn-surface:hover { background: var(--surf-3); border-color: var(--border-3); transform: none; box-shadow: none; }

.btn-danger {
  background: var(--red-10);
  color: var(--red);
  border-color: rgba(255,68,68,.2);
}
.btn-danger:hover { background: rgba(255,68,68,.15); transform: none; box-shadow: none; }

.btn-lime-outline {
  background: transparent;
  color: var(--lime);
  border-color: var(--lime-30);
}
.btn-lime-outline:hover { background: var(--lime-10); transform: none; box-shadow: none; }

.btn-full  { width: 100%; }
.btn-icon  { width: 42px; padding: 0; }
.btn-icon-sm { width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm); }

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.input, .select, .textarea {
  height: 42px;
  padding: 0 14px;
  background: var(--surf-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--lime-30);
  box-shadow: 0 0 0 3px var(--lime-10);
}
.input::placeholder { color: var(--text-3); }
.input-lg { height: 50px; font-size: 15px; }
.textarea {
  height: auto;
  min-height: 80px;
  padding: 12px 14px;
  resize: vertical;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234E4E4E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ── Input Group ────────────────────────────────────── */
.input-group { display: flex; gap: 0; }
.input-group .input { border-radius: var(--r) 0 0 var(--r); flex: 1; }
.input-group .btn { border-radius: 0 var(--r) var(--r) 0; flex-shrink: 0; }

/* ─── Search Input ───────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 40px; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════════════════ */
.bar {
  height: 6px;
  background: var(--surf-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width .7s cubic-bezier(.34,1.2,.64,1);
  min-width: 0;
}
.bar-fill-green  { background: var(--green); }
.bar-fill-amber  { background: var(--amber); }
.bar-fill-blue   { background: var(--blue); }
.bar-fill-purple { background: var(--purple); }
.bar-fill-red    { background: var(--red); }
.bar-lg { height: 10px; }
.bar-sm { height: 3px; }
.bar-xl { height: 14px; border-radius: var(--r); }

/* ═══════════════════════════════════════════════════════
   BADGES & PILLS
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-lime   { background: var(--lime-10); color: var(--lime); }
.badge-green  { background: var(--green-10); color: var(--green); }
.badge-amber  { background: var(--amber-10); color: var(--amber); }
.badge-red    { background: var(--red-10); color: var(--red); }
.badge-blue   { background: var(--blue-10); color: var(--blue); }
.badge-purple { background: var(--purple-10); color: var(--purple); }
.badge-dim    { background: var(--surf-3); color: var(--text-2); }

/* ── Status Tags ────────────────────────────────────── */
.status-pending { background: var(--amber-10); color: var(--amber); }
.status-paid    { background: var(--green-10);  color: var(--green); }
.status-expired { background: var(--red-10);   color: var(--red); }
.status-active  { background: var(--blue-10);  color: var(--blue); }

/* ═══════════════════════════════════════════════════════
   LEVEL / XP DISPLAY
   ═══════════════════════════════════════════════════════ */
.level-card {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: border-color var(--t), transform var(--t);
}
.level-card:hover { border-color: var(--lime-30); transform: translateY(-1px); }
.level-badge-el {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--lime-10);
  border: 2px solid var(--lime-30);
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  color: var(--lime);
  letter-spacing: .06em;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}
.level-info { flex: 1; min-width: 0; }
.level-name-el { font-size: 16px; font-weight: 700; font-family: var(--font-head); }
.level-xp-el { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.level-xp-big { font-size: 22px; font-weight: 700; font-family: var(--font-head); color: var(--lime); text-align: right; white-space: nowrap; }

/* ── Score Circle ───────────────────────────────────── */
.score-ring {
  position: relative;
  width: 88px; height: 88px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring-num {
  font-family: var(--font-head);
  font-size: 16px; font-weight: 700;
  line-height: 1; color: var(--text);
}
.score-ring-lbl {
  font-size: 7.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   ACCORDION
   ═══════════════════════════════════════════════════════ */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.acc-item {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.acc-item.open { border-color: var(--border-3); }
.acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--t-fast);
}
.acc-trigger:hover { background: var(--surf-2); }
.acc-trigger-left { display: flex; align-items: center; gap: 12px; }
.acc-trigger-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-head);
}
.acc-trigger-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.acc-chevron {
  width: 18px; height: 18px;
  color: var(--text-3);
  transition: transform var(--t);
  flex-shrink: 0;
}
.acc-item.open .acc-chevron { transform: rotate(180deg); }
.acc-body {
  display: none;
  padding: 0 20px 20px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.acc-item.open .acc-body { display: block; animation: fadeIn .18s ease; }

/* ── Day Badge ──────────────────────────────────────── */
.day-badge {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--surf-2);
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  color: var(--text-3);
  letter-spacing: .06em;
  flex-shrink: 0;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}
.day-badge.done { background: var(--lime-10); border-color: var(--lime-30); color: var(--lime); }

/* ── Exercise Row ───────────────────────────────────── */
.exercise-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  transition: border-color var(--t-fast);
}
.ex-row:hover { border-color: var(--border-3); }
.ex-num {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surf-3);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}
.ex-info { flex: 1; min-width: 0; }
.ex-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ex-note { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ex-stats { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.ex-stat {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 1px;
  padding: 6px 10px;
  background: var(--surf-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  min-width: 48px;
}
.ex-stat-lbl { font-size: 9px; font-weight: 700; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }
.ex-stat-val { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── Muscle Map ─────────────────────────────────────── */
.muscle-map-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.muscle-svg-panel {
  background: var(--surf-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 16px;
  flex: 0 0 auto;
  text-align: center;
}
.muscle-svg-label { font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .1em; }
.muscle-svg-panel svg { width: 100px; }
.muscle-svg-panel svg .muscle { fill: var(--surf-3); transition: fill .3s ease; }
.muscle-svg-panel svg .m-primary   { fill: var(--lime); opacity: .9; }
.muscle-svg-panel svg .m-secondary { fill: var(--amber); opacity: .8; }
.muscle-svg-panel svg .m-support   { fill: var(--blue); opacity: .6; }
.muscle-svg-panel svg .m-outline   { fill: none; stroke: var(--border-3); stroke-width: 1.5; }
.muscle-legend { display: flex; flex-direction: column; gap: 8px; }
.muscle-legend-item { display: flex; align-items: center; gap: 8px; }
.muscle-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.muscle-legend-text { font-size: 12px; color: var(--text-2); }
.muscle-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ═══════════════════════════════════════════════════════
   MEAL PLAN
   ═══════════════════════════════════════════════════════ */
.meal-slot {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 16px;
}
.meal-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.meal-slot-name {
  font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3);
}
.meal-slot-cals { font-size: 12px; font-weight: 600; color: var(--amber); }
.meal-food { font-size: 14px; font-weight: 600; color: var(--text); }
.meal-food-desc { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.meal-macros { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.macro-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  background: var(--surf-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.macro-chip .mc-dot { width: 6px; height: 6px; border-radius: 50%; }
.mc-protein { background: var(--blue); }
.mc-carbs   { background: var(--amber); }
.mc-fat     { background: var(--purple); }

/* ═══════════════════════════════════════════════════════
   FOOD LOG
   ═══════════════════════════════════════════════════════ */
.food-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  transition: border-color var(--t-fast);
}
.food-row:hover { border-color: var(--border-3); }
.food-icon {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--surf-2);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.food-info { flex: 1; min-width: 0; }
.food-name { font-size: 14px; font-weight: 600; color: var(--text); }
.food-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.food-cals { text-align: right; }
.food-cals b { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.food-cals span { font-size: 11px; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   HABITS
   ═══════════════════════════════════════════════════════ */
.habit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  transition: all var(--t-fast);
}
.habit-row.done { background: var(--lime-10); border-color: var(--lime-30); }
.habit-check {
  width: 26px; height: 26px;
  border: 2px solid var(--border-3);
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
  background: transparent;
  color: transparent;
}
.habit-row.done .habit-check {
  background: var(--lime);
  border-color: var(--lime);
  color: #080808;
}
.habit-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.habit-streak {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--amber);
}

/* ═══════════════════════════════════════════════════════
   ACHIEVEMENTS
   ═══════════════════════════════════════════════════════ */
.ach-card {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all var(--t);
}
.ach-card.unlocked { border-color: var(--lime-30); background: var(--lime-10); }
.ach-card.locked   { opacity: .45; }
.ach-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: var(--surf-3);
  display: grid; place-items: center;
  font-size: 24px;
  transition: all var(--t);
}
.ach-card.unlocked .ach-icon { background: var(--lime-10); border: 2px solid var(--lime-30); }
.ach-name { font-size: 13px; font-weight: 700; color: var(--text); }
.ach-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.ach-xp   { font-size: 12px; font-weight: 700; color: var(--amber); }

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeInBg .2s ease;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(540px,100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 26px;
  box-shadow: var(--shadow-xl);
  animation: scaleIn .2s ease;
}
.modal-head {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; font-family: var(--font-head); }
.modal-close {
  width: 34px; height: 34px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surf-2);
  color: var(--text-2);
  cursor: pointer; display: grid; place-items: center;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--surf-3); color: var(--text); }

/* ═══════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.tbl th {
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3);
  background: var(--surf-2);
  white-space: nowrap;
}
.tbl th:first-child { border-radius: var(--r-sm) 0 0 0; }
.tbl th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.tbl tbody tr:hover td { background: var(--surf-2); }
.tbl .tbl-name { font-weight: 600; color: var(--text); }

/* ── Table Container ────────────────────────────────── */
.tbl-wrap {
  background: var(--surf);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tbl-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.tbl-foot { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════
   CHART AREA
   ═══════════════════════════════════════════════════════ */
.chart-wrap { position: relative; width: 100%; }
.chart-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════ */
.toast-zone {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: min(340px, calc(100vw - 32px));
}
.toast {
  background: var(--surf-3);
  border: 1px solid var(--border-3);
  border-radius: var(--r-full);
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: fadeIn .2s ease, fadeOut .25s ease 2.7s forwards;
  pointer-events: all;
  white-space: nowrap;
}
.toast.ok  { border-color: var(--lime-30); color: var(--lime); }
.toast.err { border-color: rgba(255,68,68,.3); color: var(--red); }
.toast.info{ border-color: var(--blue-10); color: var(--blue); }
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px); } }

/* ═══════════════════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════════════════ */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surf-2) 25%, var(--surf-3) 50%, var(--surf-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes fadeIn   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn  { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes glow     { 0%,100% { box-shadow: 0 0 0 0 var(--lime-10); } 50% { box-shadow: 0 0 20px 4px var(--lime-10); } }

.fade-in  { animation: fadeIn .3s ease forwards; }
.scale-in { animation: scaleIn .2s ease forwards; }

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   DIVIDERS & UTILITIES
   ═══════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); }
.hidden   { display: none !important; }
.invis    { visibility: hidden; }
.text-c   { text-align: center; }
.text-r   { text-align: right; }
.text-lime  { color: var(--lime) !important; }
.text-green { color: var(--green) !important; }
.text-amber { color: var(--amber) !important; }
.text-red   { color: var(--red) !important; }
.text-blue  { color: var(--blue) !important; }
.text-muted { color: var(--text-2) !important; }
.text-dim   { color: var(--text-3) !important; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.font-head { font-family: var(--font-head); }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-c    { align-items: center; }
.items-s    { align-items: flex-start; }
.j-between  { justify-content: space-between; }
.j-center   { justify-content: center; }
.gap-4  { gap: 4px; }   .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }  .gap-12 { gap: 12px; } .gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }  .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4  { margin-top: 4px; }   .mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }   .mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }  .mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }  .mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }  .mt-28 { margin-top: 28px; }
.mb-8  { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px;} .mb-20 { margin-bottom: 20px; }
.w-full   { width: 100%; }
.min-w-0  { min-width: 0; }
.of-h     { overflow: hidden; }
.nowrap   { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pointer  { cursor: pointer; }

/* ── Premium Gate (polished) ────────────────────────── */
.premium-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.premium-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8,8,8,.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.premium-gate-card {
  position: relative;
  z-index: 1;
  background: var(--surf);
  border: 1px solid var(--border-3);
  border-radius: var(--r-2xl);
  padding: 40px 36px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,.8), 0 0 40px rgba(194,240,60,.06), 0 0 0 1px rgba(194,240,60,.06);
  animation: scaleIn .28s cubic-bezier(.34,1.2,.64,1);
}
.premium-gate-lock {
  width: 80px; height: 80px;
  border-radius: var(--r-2xl);
  background: var(--surf-2);
  border: 1px solid var(--border-3);
  display: grid; place-items: center;
  margin: 0 auto 20px;
  color: var(--text-2);
}
.premium-gate-title {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: 10px;
}
.premium-gate-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
}
.premium-gate-perks {
  background: var(--surf-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  text-align: left;
}
.perk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}
.perk-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  flex-shrink: 0;
}
.main-blurred {
  filter: blur(10px) brightness(.9);
  pointer-events: none;
  user-select: none;
  transition: filter .4s ease;
  will-change: filter;
}

/* ── Spacers ────────────────────────────────────────── */
.spacer-8  { height: 8px; }
.spacer-12 { height: 12px; }
.spacer-16 { height: 16px; }
.spacer-20 { height: 20px; }
.spacer-24 { height: 24px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* ── Tablet / Mobile (≤1024px) ──────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-slow);
    box-shadow: 4px 0 40px rgba(0,0,0,.7);
  }
  .sidebar.open { transform: translateX(0); }
  .member-body  { margin-left: 0; }
  .member-topbar { display: flex; }
  .bottom-nav   { display: flex; }
  /* padding-bottom: floating pill (64px) + 14px gap + 16px breathing room */
  .member-main  { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .grid-4       { grid-template-columns: repeat(2,1fr); }
  /* Topbar avatar slightly smaller */
  .topbar-avatar { width: 32px; height: 32px; font-size: 11px; }
  .topbar-btn    { width: 36px; height: 36px; }
  .topbar-brand  { font-size: 14px; }
}

/* ── Mobile (≤640px) ────────────────────────────────── */
@media (max-width: 640px) {
  /* Layout */
  .member-main { padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); gap: 10px; }

  /* Cards */
  .card    { padding: 14px; }
  .card-sm { padding: 12px; }
  .inner-card { padding: 12px; }
  .stat-card  { padding: 14px; gap: 6px; }
  .stat-value { font-size: 22px; }

  /* Inputs: 16px prevents iOS zoom */
  .input, .select, .textarea { font-size: 16px; }

  /* Modal → bottom sheet */
  .modal-bg {
    align-items: flex-end;
    padding: 0;
    border-radius: 0;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 90dvh;
    padding: 0 20px calc(20px + env(safe-area-inset-bottom, 0px));
    padding-top: 8px;
    animation: slideUp .28s cubic-bezier(.32,0,.15,1);
  }
  /* Drag handle */
  .modal::before {
    content: "";
    display: block;
    width: 36px; height: 4px;
    background: var(--border-3);
    border-radius: 99px;
    margin: 0 auto 16px;
  }
  .modal-head { margin-bottom: 16px; }

  /* Level card: hide big XP on tiny screens to prevent overflow */
  .level-xp-big { display: none; }
  .level-card    { gap: 12px; }

  /* Exercise rows: keep stats visible but stacked */
  .ex-stats { gap: 5px; }
  .ex-stat  { min-width: 42px; padding: 5px 8px; }
  .ex-stat-val { font-size: 12px; }

  /* Accordion: more vertical space for tappability */
  .acc-trigger { padding: 16px 16px; }

  /* Section head: allow wrapping */
  .section-head { flex-wrap: wrap; gap: 10px; }

  /* Page header: better mobile stack */
  .page-header.flex { align-items: flex-start; }

  /* Habit row: ensure min touch target */
  .habit-row { padding: 14px 12px; }
  .habit-check { width: 28px; height: 28px; }

  /* Food row */
  .food-row { padding: 10px 12px; }
  .food-icon { width: 36px; height: 36px; font-size: 16px; }

  /* Achievement grid: 3-col on mobile */
  .grid-3.ach-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .ach-card { padding: 14px 8px; }
  .ach-icon { width: 42px; height: 42px; font-size: 20px; }
  .ach-name { font-size: 11px; }
  .ach-desc { font-size: 10px; }

  /* Buttons: full-touch */
  .btn-sm { height: 36px; }

  /* Progress charts: 2-col stays but smaller height */
  .chart-wrap[style*="height:200px"] { height: 160px !important; }

  /* Toast: prevent overflow */
  .toast { font-size: 12.5px; padding: 9px 16px; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }
}

/* ── Small Mobile (≤400px) ──────────────────────────── */
@media (max-width: 400px) {
  .member-main { padding: 12px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .grid-4      { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .grid-3.ach-grid { grid-template-columns: repeat(2,1fr); }

  /* Bottom nav: tighter padding on very small screens */
  .bnav-item { padding: 6px 3px 5px; max-width: 72px; font-size: 9px; }
  .bnav-item svg { width: 21px; height: 21px; }

  /* Smaller page titles */
  .page-title { font-size: 20px; }

  /* Macro chips: compact */
  .macro-chip { font-size: 10px; padding: 3px 6px; }
}

/* ── Very small (≤360px): icon-only nav ──────────────── */
@media (max-width: 360px) {
  .bnav-item span { display: none; }
  .bnav-item { gap: 0; padding: 0 6px; justify-content: center; }
  .bnav-item svg { width: 24px; height: 24px; }
}

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
