/* ============ Tokens ============ */
:root {
  --bg: #0d0f12;
  --surface: #15191e;
  --surface-2: #1c2128;
  --border: #2a313a;
  --text: #f1f3f5;
  --muted: #9aa4af;
  --accent: #c8f031;
  --accent-ink: #11140a;
  --accent-soft: rgba(200, 240, 49, 0.12);
  --accent-text: #c8f031;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Oswald', 'Inter', sans-serif;
  --max: 1180px;
  color-scheme: dark;
}
[dir='rtl'] {
  --font-body: 'Cairo', system-ui, sans-serif;
  --font-head: 'Cairo', system-ui, sans-serif;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); text-transform: uppercase; }
h3 { font-size: 1.2rem; }
[dir='rtl'] h1, [dir='rtl'] h2 { text-transform: none; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; }
.accent { color: var(--accent-text); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Buttons & forms ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 0.95rem var(--font-body);
  cursor: pointer; text-decoration: none; transition: transform 0.12s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #3a434e; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #d6fa52; border-color: #d6fa52; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font: inherit; }
.link-btn.danger { color: var(--danger); }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type='checkbox'] { width: auto; accent-color: var(--accent); }
textarea { min-height: 100px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hp { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.form-card { max-width: 460px; margin: 48px auto; }
.inline-form { display: inline; }

/* ============ Cards, badges, alerts ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-title h3, .card-title h2 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.active, .badge.confirmed, .badge.joined, .badge.booked { color: var(--ok); border-color: rgba(74, 222, 128, 0.35); }
.badge.expiring, .badge.frozen, .badge.pending, .badge.waitlist, .badge.contacted { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.badge.expired, .badge.declined, .badge.cancelled { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.badge.new, .badge.staff, .badge.trial { color: var(--info); border-color: rgba(96, 165, 250, 0.35); }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.alert-success { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.35); color: #bbf7d0; }
.alert-error { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }
.alert-warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.35); color: #fde68a; }
.flash-wrap { padding-top: 18px; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ============ Header ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(13, 15, 18, 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 1.25rem var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1rem; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.current { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.lang-link { color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 6px 10px; }
.menu-toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
@media (max-width: 960px) {
  .menu-toggle { display: block; }
  .nav-links, .nav-actions { display: none; }
  .nav.open { flex-wrap: wrap; height: auto; padding: 14px 0; }
  .nav.open .nav-links, .nav.open .nav-actions { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin: 0; }
  .nav.open .nav-actions { flex-direction: row; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
}

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden; padding: 96px 0 80px;
  background:
    radial-gradient(800px 400px at 85% 10%, rgba(200, 240, 49, 0.14), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(96, 165, 250, 0.08), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin-bottom: 18px; }
.hero h1 .accent { display: block; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 64px 0 56px; } }

/* Crowd meter */
.crowd { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.crowd h3 { font-family: var(--font-body); font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.crowd-level { display: flex; align-items: baseline; gap: 10px; font: 700 2rem var(--font-head); margin-bottom: 12px; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width 0.6s; }
.crowd.moderate .meter > span { background: var(--warn); }
.crowd.busy .meter > span { background: var(--danger); }
.crowd.quiet .crowd-level { color: var(--ok); }
.crowd.moderate .crowd-level { color: var(--warn); }
.crowd.busy .crowd-level { color: var(--danger); }
.crowd .hours { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.92rem; }
.crowd .hours div { display: flex; justify-content: space-between; gap: 12px; }

/* Features */
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin-bottom: 14px; }
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ============ Plans ============ */
.plan { position: relative; display: flex; flex-direction: column; padding: 28px 24px; }
.plan.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan .ribbon { position: absolute; top: -12px; inset-inline-start: 24px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.plan h3 { font-size: 1.35rem; text-transform: uppercase; }
.price { font: 700 2.4rem var(--font-head); margin: 4px 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 7px 0; display: flex; gap: 10px; color: #d5dae0; border-bottom: 1px dashed var(--border); }
.plan li::before { content: '✓'; color: var(--accent-text); font-weight: 700; }

/* ============ Schedule ============ */
.class-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.class-item + .class-item { margin-top: 10px; }
.class-time { font: 700 1.1rem var(--font-head); min-width: 62px; color: var(--accent-text); }
.class-info { flex: 1; min-width: 0; }
.class-info strong { display: block; }
.class-info .meta { color: var(--muted); font-size: 0.86rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.day-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 160px; }
.day-col.today { border-color: var(--accent); }
.day-col h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; display: flex; justify-content: space-between; }
.slot { padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border-inline-start: 3px solid var(--accent); margin-bottom: 8px; font-size: 0.86rem; }
.slot b { display: block; font-size: 0.92rem; }
.slot .t { color: var(--accent-text); font-weight: 700; }
.slot .meta { color: var(--muted); }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } .day-col { min-height: 0; } }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ============ Trainers ============ */
.trainer { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.trainer-photo { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #1f262e, #12161b); display: grid; place-items: center; }
.trainer-photo img { width: 100%; height: 100%; object-fit: cover; }
.initials { font: 700 3rem var(--font-head); color: var(--accent-text); opacity: 0.85; }
.trainer-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.trainer-body .specialty { color: var(--accent-text); font-weight: 600; font-size: 0.92rem; margin-bottom: 10px; }
.trainer-body p { color: var(--muted); font-size: 0.95rem; }
.trainer-body .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.trainer-body .btn { margin-top: auto; align-self: flex-start; }

/* ============ Gallery ============ */
.gallery { columns: 3 260px; column-gap: 14px; }
.gallery figure { margin: 0 0 14px; break-inside: avoid; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.gallery figcaption { padding: 10px 14px; color: var(--muted); font-size: 0.9rem; }

/* ============ Contact / BMI ============ */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.info-list { list-style: none; padding: 0; margin: 0 0 18px; }
.info-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.info-list li span:first-child { color: var(--muted); }
.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); filter: grayscale(0.3) invert(0.9) hue-rotate(180deg); }
.bmi-result { display: none; margin-top: 24px; }
.bmi-result.show { display: block; }
.bmi-scale { position: relative; height: 12px; border-radius: 999px; margin: 18px 0 8px; background: linear-gradient(90deg, var(--info) 0 21%, var(--ok) 21% 43%, var(--warn) 43% 64%, var(--danger) 64%); }
[dir='rtl'] .bmi-scale { transform: scaleX(-1); }
.bmi-scale i { position: absolute; top: -5px; width: 4px; height: 22px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); transition: left 0.4s; }
.big-num { font: 700 3rem var(--font-head); line-height: 1; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; margin-top: 40px; color: var(--muted); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: var(--text); font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Floating WhatsApp button */
.wa-float { position: fixed; bottom: 20px; inset-inline-end: 20px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); z-index: 40; }
.wa-float svg { width: 28px; height: 28px; }

/* ============ Member area ============ */
.page-head { padding-top: 36px; padding-bottom: 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.tabs a { padding: 12px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.current { color: var(--text); border-bottom-color: var(--accent); }
.status-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.status-card .big-num { color: var(--accent-text); }
.qr-box { text-align: center; }
.qr-box img { margin: 0 auto 10px; border-radius: 12px; background: #fff; padding: 8px; width: 200px; }
.qr-code-text { font: 600 1.05rem ui-monospace, Consolas, monospace; letter-spacing: 0.15em; }
.day-block + .day-block { margin-top: 26px; }
.day-block h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat .value { font: 700 2rem var(--font-head); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 0.82rem; }
.stat a.value { color: var(--text); display: block; }

/* ============ Charts ============ */
.chart-box { position: relative; height: 280px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 0.85rem; box-shadow: var(--shadow); white-space: nowrap; opacity: 0; transition: opacity 0.1s; z-index: 5; }
.chart-tip b { display: block; font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { opacity: 0.55; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#areaFill); }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
details.table-toggle summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; margin-top: 10px; }

/* ============ Admin ============ */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin > div { min-width: 0; }
.admin-side { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { padding: 4px 8px 20px; font-size: 1.05rem; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 0.94rem; }
.admin-side nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.admin-side nav a.current { color: var(--accent-ink); background: var(--accent); }
.admin-side nav .count { margin-inline-start: auto; font-size: 0.75rem; background: var(--info); color: #0b1220; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.admin-side .side-group { color: #6b7580; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 16px 12px 6px; }
.admin-main { padding: 28px 32px 60px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.8rem; margin: 0; }
.admin-mobile-bar { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-side { display: none; position: fixed; inset: 0; z-index: 60; height: 100vh; width: 260px; }
  .admin.side-open .admin-side { display: block; }
  .admin-main { padding: 16px; }
  .admin-mobile-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
}
.edit-row td { background: var(--bg); }
details.edit summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 0.88rem; list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { grid-column: 1 / -1; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Check-in desk */
.checkin-input { font-size: 1.4rem; padding: 16px 18px; text-align: center; letter-spacing: 0.1em; }
.checkin-result { margin-top: 18px; padding: 24px; border-radius: var(--radius); text-align: center; border: 2px solid var(--border); display: none; }
.checkin-result.show { display: block; }
.checkin-result.ok { border-color: var(--ok); background: rgba(74, 222, 128, 0.07); }
.checkin-result.bad { border-color: var(--danger); background: rgba(248, 113, 113, 0.07); }
.checkin-result .who { font: 700 1.8rem var(--font-head); }
#qr-reader { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border) !important; }

/* Error page */
.error-page { text-align: center; padding: 100px 16px; }
.error-page .code { font: 700 6rem var(--font-head); color: var(--accent-text); line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.split { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* Admin setup checklist */
.setup-card { border-color: rgba(200, 240, 49, 0.4); }
.setup-list { list-style: none; padding: 0; margin: 0; }
.setup-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.setup-list li:last-child { border-bottom: 0; }
.setup-list .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.setup-list li.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.setup-list li.done span:not(.tick) { color: var(--muted); text-decoration: line-through; }

/* Keep the admin sidebar from scrolling sideways; long names are shortened with "…". */
.admin-side { overflow-x: hidden; }
.admin-side nav a > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-side .brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Live (rotating) QR code on the member page */
.qr-head { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 10px; }
.qr-box img.qr-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); margin: 0; padding: 0; background: none; flex: none; }
.qr-live { position: relative; width: 236px; margin: 0 auto; }
.qr-live #qr-img { width: 220px; height: 220px; margin: 8px auto 0; transition: opacity 0.2s; }
.qr-ring { position: absolute; top: -6px; right: -14px; width: 34px; height: 34px; transform: rotate(-90deg); }
.qr-ring circle { fill: none; stroke-width: 3.5; }
.qr-ring circle:first-child { stroke: var(--surface-2); }
#qr-ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 4px; animation: live-pulse 1.6s infinite; vertical-align: middle; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Check-in desk */
.desk-result { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; text-align: start; }
.desk-photo { width: 140px; height: 140px; border-radius: 16px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 0.8rem; text-align: center; padding: 8px; }
img.desk-photo { padding: 0; }
.checkin-result.warn { border-color: var(--warn); background: rgba(251, 191, 36, 0.08); }
.inside-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.inside-row:last-child { border-bottom: 0; }
.inside-row .mini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--accent-text); }
.member-photo { width: 160px; height: 160px; border-radius: 16px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
@media (max-width: 560px) { .desk-result { flex-direction: column; text-align: center; } }

/* Workout & diet plans */
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.plan-day { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.plan-day h4 { font-family: var(--font-body); font-size: 0.95rem; color: var(--accent-text); margin: 0 0 8px; }
.plan-day ol, .plan-day ul { margin: 0; padding-inline-start: 20px; }
.plan-day li { padding: 3px 0; font-size: 0.93rem; }
.plan-notes { margin-top: 14px; padding: 12px 14px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px; }
.plan-notes p { margin: 4px 0 0; white-space: pre-line; }
.macro-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.macro { flex: 1; min-width: 90px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; }
.macro-val { font: 700 1.4rem var(--font-head); }
.macro-val small { font-size: 0.8rem; color: var(--muted); }
.code-bar input { max-width: 220px; text-transform: uppercase; }

/* Invite card */
.invite-code { font: 700 1.6rem ui-monospace, Consolas, monospace; letter-spacing: 0.18em; color: var(--accent-text); }
.plan-editor textarea { min-height: 120px; font-size: 0.9rem; }
.plan-editor .day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
