/* ==========================================================================
   F9 Fitness — design system
   Font: self-hosted Cairo (see assets/fonts/fonts.css), no external requests.
   ========================================================================== */

:root {
  /* --- type scale -------------------------------------------------------
     One ramp for the whole product. Sizes step ~1.2x, the top of the ramp is
     fluid so display headings never need a media-query override. */
  --fs-2xs: 0.6875rem; /* 11px  micro labels, chart axes */
  --fs-xs: 0.75rem; /* 12px  badges, table meta */
  --fs-sm: 0.8125rem; /* 13px  secondary copy */
  --fs-base: 0.9375rem; /* 15px  body */
  --fs-md: 1rem; /* 16px  lead paragraphs */
  --fs-lg: 1.125rem; /* 18px  card titles */
  --fs-xl: 1.3125rem; /* 21px  panel headings */
  --fs-2xl: 1.75rem; /* 28px  page titles */
  --fs-3xl: clamp(1.875rem, 1.35rem + 2.1vw, 2.75rem);
  --fs-4xl: clamp(2.25rem, 1.3rem + 3.8vw, 3.5rem);
  --fs-5xl: clamp(2.5rem, 1rem + 6.2vw, 5rem);

  --lh-tight: 1.12;
  --lh-snug: 1.35;
  --lh-body: 1.7;

  --ls-display: -0.035em;
  --ls-heading: -0.02em;
  --ls-wide: 0.1em;

  --fw-regular: 400;
  --fw-medium: 600;
  --fw-bold: 700;
  --fw-black: 800;

  /* --- spacing ---------------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 26px;
  --sp-7: 34px;
  --sp-8: 44px;
  --sp-9: 60px;

  /* --- colour ----------------------------------------------------------- */
  --lime: #b7ff34;
  --lime-dim: #8edb16;
  --lime-ink: #0b1009;
  --bg: #080b09;
  --surface: #0f1511;
  --surface-2: #141c16;
  --surface-3: #1b241d;
  --text: #f5f8f3;
  --muted: #9aa69d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --nav: rgba(8, 11, 9, 0.82);
  --ok: #63e58b;
  --warn: #ffc85a;
  --danger: #ff5d68;
  --lime-soft: rgba(183, 255, 52, 0.11);
  --lime-line: rgba(183, 255, 52, 0.28);

  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);

  --font: 'Cairo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-num: 'Cairo', ui-monospace, 'SF Mono', Menlo, monospace;
}

:root[data-theme='light'] {
  --bg: #f4f7f1;
  --surface: #ffffff;
  --surface-2: #eef3ea;
  --surface-3: #e4ece0;
  --text: #111611;
  --muted: #5f6b61;
  --line: rgba(16, 27, 19, 0.1);
  --line-strong: rgba(16, 27, 19, 0.18);
  --nav: rgba(255, 255, 255, 0.9);
  --lime-soft: rgba(120, 190, 20, 0.14);
  --lime-line: rgba(120, 190, 20, 0.4);
  --shadow: 0 18px 45px rgba(31, 54, 37, 0.1);
  --ok: #1f9d55;
  --warn: #b5760a;
  --danger: #c62b38;
}

/* --- base ---------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}

/* Arabic sits lower and tighter than Latin at the same size; give it room. */
body[dir='rtl'] {
  line-height: calc(var(--lh-body) + 0.08);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

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

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.section {
  padding: var(--sp-9) 0;
}

.section-tight {
  padding: var(--sp-8) 0;
}

.muted {
  color: var(--muted);
}

.lime {
  color: var(--lime);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* --- type helpers -------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--lime);
}

.section-title {
  font-size: var(--fs-3xl);
  letter-spacing: var(--ls-display);
  margin: var(--sp-2) 0 var(--sp-3);
}

.section-lead {
  font-size: var(--fs-md);
  color: var(--muted);
  max-width: 62ch;
}

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

/* --- controls ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn[aria-busy='true'] {
  opacity: 0.6;
  pointer-events: none;
}

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

.btn-secondary {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--lime-line);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 0 var(--sp-4);
  font-size: var(--fs-sm);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: var(--fs-md);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--lime-line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--lime-line);
  background: var(--lime-soft);
  color: var(--lime);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  line-height: 1.5;
  white-space: nowrap;
}

:root[data-theme='light'] .pill {
  color: #3f6b00;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  flex: 0 0 auto;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  line-height: 1.6;
  white-space: nowrap;
}

.status.ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}

.status.warn {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.status.bad {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}

.status.info {
  background: var(--surface-2);
  color: var(--muted);
}

/* --- public navigation --------------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 0 0 auto;
}

.brand img {
  width: 74px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy b {
  font-size: var(--fs-sm);
  font-weight: var(--fw-black);
  letter-spacing: 0.04em;
}

.brand-copy span {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.nav-links a {
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.mobile-menu {
  display: none;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 640px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
      90deg,
      rgba(4, 7, 5, 0.97) 0%,
      rgba(4, 7, 5, 0.74) 45%,
      rgba(4, 7, 5, 0.2) 100%
    ),
    url('hero-athlete.jpg') center/cover no-repeat;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 170px;
  background: linear-gradient(transparent, var(--bg));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  padding: var(--sp-9) 0;
}

.hero h1 {
  font-size: var(--fs-5xl);
  letter-spacing: var(--ls-display);
  margin: var(--sp-4) 0 var(--sp-5);
}

.hero p {
  font-size: var(--fs-md);
  color: #c8d1ca;
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-7);
  max-width: 46rem;
}

.hero-kpi {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(8, 13, 10, 0.62);
  backdrop-filter: blur(8px);
}

.hero-kpi b {
  display: block;
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  line-height: 1.2;
}

.hero-kpi span {
  font-size: var(--fs-sm);
  color: #aab5ad;
}

/* --- public sections ----------------------------------------------------- */

.facility-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.facility-card {
  position: relative;
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0d0a;
}

.facility-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.facility-card:hover img {
  transform: scale(1.04);
}

.facility-card::after {
  content: '';
  position: absolute;
  inset: 0;
  /* These plates carry their own baked-in captions along the bottom edge, so the
     scrim has to be near-opaque there for the real labels to read cleanly. */
  background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.88) 58%, rgba(0, 0, 0, 0.97) 100%);
}

.facility-copy {
  position: absolute;
  z-index: 2;
  inset: auto var(--sp-4) var(--sp-4);
}

.facility-copy h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-1);
}

.facility-copy p {
  margin: 0;
  font-size: var(--fs-sm);
  color: #c8d0c9;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.stat-block {
  padding: var(--sp-6);
  background: var(--surface);
}

.stat-block b {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  line-height: 1.2;
}

.stat-block span {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-7);
  align-items: center;
}

/* Editorial two-column block: heading on one side, body copy on the other. */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--sp-8);
  align-items: start;
}

.about-grid .section-title {
  margin-bottom: 0;
}

.about-grid p + p {
  margin-top: var(--sp-4);
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
  }
}

.media-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.media-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.7));
}

.feature-list {
  display: grid;
  gap: var(--sp-1);
  margin: var(--sp-6) 0 0;
}

.feature-row {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}

.feature-row:last-child {
  border-bottom: 0;
}

.feature-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--lime-soft);
  color: var(--lime);
  font-size: var(--fs-md);
  font-weight: var(--fw-black);
}

.feature-row b {
  display: block;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

.feature-row span {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.plans-grid {
  display: grid;
  /* 300px keeps six plans as two even rows of three instead of four plus two. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.plan {
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  position: relative;
}

.plan.featured {
  border-color: var(--lime-line);
  box-shadow: 0 0 0 1px var(--lime-line), var(--shadow);
}

.plan-badge {
  position: absolute;
  top: var(--sp-4);
  inset-inline-end: var(--sp-4);
}

.plan h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
}

.plan .price {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-heading);
  margin: var(--sp-4) 0;
}

.plan .price small {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.plan ul {
  list-style: none;
  margin: 0 0 var(--sp-6);
  padding: 0;
  display: grid;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-base);
}

.plan li {
  display: flex;
  gap: var(--sp-2);
}

.plan li::before {
  content: '✓';
  color: var(--lime);
  font-weight: var(--fw-black);
}

.plan .btn {
  margin-top: auto;
}

.trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: var(--sp-6);
  border: 1px solid var(--lime-line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--lime-soft), transparent);
}

.cta-band h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-1);
}

.location-card {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  overflow: hidden;
}

.location-photo {
  min-height: 360px;
  /* The photograph carries its own address card on the right edge; framing the
     left keeps that out of shot so it cannot compete with the real details. */
  background: url('building.jpg') 18% center/cover;
}

.location-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-7);
}

.location-info h2 {
  font-size: var(--fs-2xl);
}

.footer {
  padding: var(--sp-8) 0 var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--sp-7);
}

.footer-links {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: var(--fs-base);
  color: var(--muted);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* --- page head ----------------------------------------------------------- */

.page-head {
  padding: var(--sp-8) 0 var(--sp-6);
  background: linear-gradient(180deg, var(--lime-soft), transparent);
}

.page-head h1 {
  font-size: var(--fs-4xl);
  letter-spacing: var(--ls-display);
  margin: var(--sp-2) 0 var(--sp-3);
}

.pricing-note {
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--lime-line);
  border-radius: var(--radius-sm);
  background: var(--lime-soft);
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-6);
}

/* --- auth ---------------------------------------------------------------- */

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-7);
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.75)),
    url('gym-floor.jpg') center/cover;
}

.auth-visual h1 {
  font-size: var(--fs-4xl);
  letter-spacing: var(--ls-display);
  margin: var(--sp-4) 0 var(--sp-4);
}

.auth-visual p {
  color: #d7dfd9;
  max-width: 34rem;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: var(--sp-7) var(--sp-6);
}

.auth-card {
  width: min(440px, 100%);
  padding: var(--sp-7);
}

.auth-card h1 {
  font-size: var(--fs-2xl);
  margin: var(--sp-7) 0 var(--sp-1);
}

.form-group {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.form-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field:focus {
  border-color: var(--lime-line);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.field[aria-invalid='true'] {
  border-color: var(--danger);
}

.form-message {
  display: none;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.form-message[data-tone='error'] {
  display: block;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.form-message[data-tone='ok'] {
  display: block;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  color: var(--ok);
}

.auth-footnote {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: center;
}

/* --- dashboard shell ----------------------------------------------------- */

.dashboard-body {
  min-height: 100vh;
}

.dash-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--sp-4);
  border-inline-end: 1px solid var(--line);
  background: var(--surface);
}

.sidebar .brand {
  padding: var(--sp-2) var(--sp-2) var(--sp-5);
}

.side-nav {
  display: grid;
  gap: 3px;
  overflow-y: auto;
}

.side-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  transition: background 0.16s ease, color 0.16s ease;
}

.side-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-link[aria-current='true'] {
  background: var(--lime-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--lime);
}

body[dir='rtl'] .side-link[aria-current='true'] {
  box-shadow: inset -3px 0 0 var(--lime);
}

.side-link .ico {
  width: 20px;
  text-align: center;
  color: var(--lime);
  font-size: var(--fs-md);
  flex: 0 0 auto;
}

.side-bottom {
  display: grid;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-4);
}

.dash-main {
  min-width: 0;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 74px;
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--line);
  background: var(--nav);
  backdrop-filter: blur(16px);
}

.dash-top-left,
.dash-top-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.dash-topbar .date-chip {
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--lime-line);
  flex: 0 0 auto;
}

.dash-content {
  padding: var(--sp-6);
}

.dash-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dash-title-row h1 {
  font-size: var(--fs-2xl);
}

.dash-title-row p {
  margin: var(--sp-1) 0 0;
  color: var(--muted);
  font-size: var(--fs-base);
}

/* --- dashboard blocks ---------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: var(--sp-3);
}

/* Six KPIs land as three even rows rather than a row of five plus an orphan. */
@media (min-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.kpi-card {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--lime-soft);
  color: var(--lime);
  font-size: var(--fs-md);
  font-weight: var(--fw-black);
  flex: 0 0 auto;
}

.kpi-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  line-height: 1.15;
  letter-spacing: var(--ls-heading);
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: calc(var(--sp-3) * -1 + 2px);
}

.delta {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.delta.down {
  color: var(--danger);
}

.delta.flat {
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.dash-grid.equal {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel {
  padding: var(--sp-5);
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.panel-title h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.panel-title .panel-meta {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* charts */

.chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  height: 240px;
  padding: var(--sp-5) var(--sp-2) var(--sp-2);
  border-bottom: 1px solid var(--line);
}

.chart::before,
.chart::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  border-top: 1px dashed var(--line);
}

.chart::before {
  top: 33%;
}

.chart::after {
  top: 66%;
}

.bar {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 8px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--lime), color-mix(in srgb, var(--lime) 22%, transparent));
  transition: filter 0.2s ease, transform 0.2s ease;
}

.bar:hover {
  filter: brightness(1.08);
  transform: translateY(-3px);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.donut-wrap {
  display: grid;
  place-items: center;
  padding: var(--sp-3) 0 var(--sp-5);
}

.donut {
  position: relative; /* the inner hole is absolutely placed inside this */
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  border-radius: 50%;
}

.donut::after {
  content: '';
  position: absolute;
  inset: 33px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.donut-inner b {
  display: block;
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.donut-inner span {
  font-size: var(--fs-2xs);
  color: var(--muted);
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.legend span {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--lime);
  flex: 0 0 auto;
}

/* quick actions */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.quick {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  text-align: start;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.quick:hover {
  border-color: var(--lime-line);
  transform: translateY(-1px);
}

/* tables */

.table-wrap {
  overflow-x: auto;
  margin-inline: calc(var(--sp-5) * -1);
  padding-inline: var(--sp-5);
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--sp-3) var(--sp-3);
  text-align: start;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-base);
  white-space: nowrap;
}

.data-table th {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: var(--surface-2);
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
}

/* lists */

.schedule {
  display: grid;
  gap: var(--sp-2);
}

.schedule-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.schedule-item.is-live {
  box-shadow: inset 0 0 0 1px var(--lime-line);
}

.schedule-time {
  font-size: var(--fs-base);
  font-weight: var(--fw-black);
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.schedule-item b {
  display: block;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

.schedule-item span.sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.progress-list {
  display: grid;
  gap: var(--sp-3);
}

.progress-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 1.4fr) 44px;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}

.progress-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-item b {
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.progress-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--lime);
}

.progress-bar i.low {
  background: var(--warn);
}

/* member specifics */

.member-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.workout-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: #080b09;
}

.workout-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workout-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
}

.workout-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  padding: var(--sp-6);
  color: #fff;
}

.workout-copy h2 {
  font-size: var(--fs-2xl);
  margin: var(--sp-2) 0 var(--sp-3);
}

.workout-copy p {
  color: #cfd7d1;
}

.workout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.qr-card {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5);
  text-align: center;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 0 0 3px var(--lime-line);
}

.qr-frame svg,
.qr-frame img {
  width: 100%;
  height: 100%;
}

.qr-card .pass-id {
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}

.qr-card .pass-meta {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.metric {
  padding: var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.metric b {
  display: block;
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}

.metric span {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Promo panel with a photo behind it: the scrim has to be strong enough that
   whatever text the photo already contains cannot read as page copy. */
.promo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  padding: var(--sp-6);
  overflow: hidden;
  color: #fff;
}

.promo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Blurring the plate keeps it as texture; the scale hides the soft edge a
     blur would otherwise leave at the border. */
  filter: blur(4px);
  transform: scale(1.06);
}

.promo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(4, 7, 5, 0.97) 30%, rgba(4, 7, 5, 0.86) 100%);
}

.promo-card > *:not(img) {
  position: relative;
  z-index: 2;
}

.promo-card h2 {
  font-size: var(--fs-2xl);
  margin: var(--sp-2) 0 var(--sp-5);
}

/* --- feedback ------------------------------------------------------------ */

.empty {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-base);
}

.empty .feature-icon {
  background: var(--surface-2);
  color: var(--muted);
}

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.toast-stack {
  position: fixed;
  z-index: 300;
  inset-block-end: var(--sp-5);
  inset-inline-end: var(--sp-5);
  display: grid;
  gap: var(--sp-2);
  max-width: min(360px, calc(100vw - 2 * var(--sp-5)));
}

.toast {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
}

.toast[data-tone='ok'] {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

.toast[data-tone='error'] {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

/* --- modal dialog -------------------------------------------------------- */

.dialog-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.dialog {
  width: min(460px, 100%);
  padding: var(--sp-6);
  margin: auto;
}

.dialog h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-2);
}

.dialog-form .form-group:first-of-type {
  margin-top: var(--sp-3);
}

.field-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}

.dialog select.field {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

body[dir='rtl'] .dialog select.field {
  background-position: 20px center, 15px center;
}

.dialog input[type='datetime-local'],
.dialog input[type='date'] {
  font-variant-numeric: tabular-nums;
}

/* --- search field -------------------------------------------------------- */

.search-field {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-base);
  outline: none;
}

.search-field:focus {
  border-color: var(--lime-line);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.mobile-side-toggle {
  display: none;
}

.scrim {
  display: none;
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 1080px) {
  .nav-links {
    display: none;
  }

  .mobile-menu {
    display: grid;
  }

  /* The mobile menu is a popover, not a rewritten inline style, so resizing
     back to desktop cannot leave the bar in a broken state. */
  .nav-links[data-open='true'] {
    position: absolute;
    inset-inline: var(--sp-4);
    inset-block-start: calc(100% + var(--sp-2));
    display: grid;
    gap: var(--sp-1);
    padding: var(--sp-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav-links[data-open='true'] a {
    padding: var(--sp-3);
    border-radius: var(--radius-sm);
  }

  .nav-links[data-open='true'] a:hover {
    background: var(--surface-2);
  }

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

  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .sidebar {
    padding: var(--sp-3) var(--sp-2);
  }

  .sidebar .brand-copy,
  .sidebar .brand img {
    display: none;
  }

  .sidebar .brand::after {
    content: 'F9';
    font-size: var(--fs-lg);
    font-weight: var(--fw-black);
    color: var(--lime);
  }

  .side-link {
    justify-content: center;
    padding: var(--sp-3);
  }

  .side-link .label {
    display: none;
  }

  .side-link[aria-current='true'] {
    box-shadow: inset 0 0 0 1px var(--lime-line);
  }

  .side-bottom .btn .label {
    display: none;
  }

  .side-bottom .btn {
    width: 46px;
    padding: 0;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .section {
    padding: var(--sp-8) 0;
  }

  .hero {
    min-height: 560px;
  }

  .hero::before {
    background: linear-gradient(
        180deg,
        rgba(4, 7, 5, 0.5) 0%,
        rgba(4, 7, 5, 0.92) 58%,
        rgba(4, 7, 5, 0.98) 100%
      ),
      url('hero-athlete.jpg') 62% center/cover no-repeat;
  }

  .hero-content {
    padding: var(--sp-8) 0 var(--sp-7);
  }

  .hero-kpis,
  .facility-grid,
  .stats-strip,
  .split,
  .location-card,
  .footer-grid,
  .member-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: var(--sp-5) var(--sp-4);
  }

  .auth-card {
    padding: var(--sp-5);
  }

  /* The sidebar becomes an off-canvas drawer with a real scrim. */
  .dash-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 120;
    inset-block: 0;
    inset-inline-start: 0;
    width: 262px;
    padding: var(--sp-4);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body[dir='rtl'] .sidebar {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform: translateX(105%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .brand img,
  .sidebar .brand-copy {
    display: flex;
  }

  .sidebar .brand::after {
    display: none;
  }

  .side-link {
    justify-content: flex-start;
  }

  .side-link .label,
  .side-bottom .btn .label {
    display: inline;
  }

  .side-bottom .btn {
    width: auto;
    justify-self: stretch;
    padding: 0 var(--sp-5);
  }

  .mobile-side-toggle {
    display: grid;
  }

  .scrim[data-open='true'] {
    display: block;
    position: fixed;
    z-index: 110;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }

  .dash-topbar {
    padding: 0 var(--sp-4);
  }

  .dash-topbar .date-chip {
    display: none;
  }

  .dash-content {
    padding: var(--sp-4);
  }

  .dash-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .chart {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 24px);
  }

  .brand-copy {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .progress-item {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .progress-item .progress-bar {
    display: none;
  }

  .schedule-item {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .schedule-item .status {
    grid-column: 2;
    justify-self: start;
  }
}
