/* ─────────────────────────────────────────────────────────
   CPS Fitness Club – rang aur font yahan upar hain. Look badalna ho toh
   pehle :root ke variables dekho.
   Rang akhade se liye hain: neem ka hara, chuna (whitewash),
   haldi aur mitti.
   ───────────────────────────────────────────────────────── */
:root {
  --chuna: #eaeee6;      /* background */
  --paper: #f7f9f4;      /* input / sheet */
  --neem: #1d3a2b;       /* mukhya rang, text */
  --neem-2: #2f5340;
  --ink-2: #55655a;      /* halka text */
  --line: #c9d2c4;
  --neem-bg: #d3e2d6;

  --font-display: 'Teko', 'Mukta', system-ui, sans-serif;
  --font-body: 'Mukta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;

  /* status ke rang: --tone = text, --bar = patti/dot, --wash = halka background */
  --tone-active: #2f5340;  --bar-active: #3f7a57;  --wash-active: #d3e2d6;
  --tone-soon: #7e5700;    --bar-soon: #e3a21a;    --wash-soon: #f6e3b2;
  --tone-expired: #a93a24; --bar-expired: #b8452e; --wash-expired: #f1d5cc;
}

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

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

body {
  margin: 0;
  background: var(--chuna);
  color: var(--neem);
  font: 400 16px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

button, input { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; }

:focus-visible { outline: 3px solid var(--neem-2); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.ico { display: inline-flex; flex: none; }
.muted { color: var(--ink-2); }

/* ── Screen ──────────────────────────────────────────── */
.screen {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
}
.splash, .login { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.splash { justify-content: center; }

/* ── Wordmark ────────────────────────────────────────── */
.wordmark { font: 600 40px/1.05 var(--font-display); letter-spacing: 0.01em; overflow-wrap: anywhere; }
.wordmark.big { font-size: 52px; }
.gym { color: var(--ink-2); font-size: 15px; }

/* ── Top bar (list) ──────────────────────────────────── */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top-actions { display: flex; gap: 8px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; text-decoration: none;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: transparent; cursor: pointer;
}
.icon-btn.is-playing { background: var(--neem); border-color: var(--neem); color: #fff; animation: announce-pulse 1.1s ease-in-out infinite; }

/* ── Board: meter + filters ──────────────────────────── */
.board { margin-top: 16px; }
.meter { display: flex; gap: 3px; height: 16px; border-radius: 5px; overflow: hidden; background: var(--line); }
.seg { border-radius: 2px; min-width: 6px; }
.seg-expired { background: var(--bar-expired); }
.seg-soon { background: var(--bar-soon); }
.seg-active { background: var(--bar-active); }

.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.chip {
  min-height: 44px; padding: 6px 2px; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: transparent; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip b { font-weight: 700; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bar); flex: none; }
.chip-expired { --bar: var(--bar-expired); }
.chip-soon { --bar: var(--bar-soon); }
.chip-active { --bar: var(--bar-active); }
.chip[aria-pressed='true'] { background: var(--neem); border-color: var(--neem); color: #fff; }
.chip[aria-pressed='true'] .dot { box-shadow: 0 0 0 1.5px #fff; }

/* ── Search ──────────────────────────────────────────── */
.search { position: relative; margin: 14px 0 4px; }
.search .ico { position: absolute; left: 12px; top: 13px; color: var(--ink-2); pointer-events: none; }
.search input.search-input { padding-left: 42px; }

.note { padding: 28px 4px; color: var(--ink-2); }
.note-title { color: var(--neem); font-weight: 700; margin-bottom: 4px; }

/* ── Member rows ─────────────────────────────────────── */
.rows { list-style: none; }
.row-wrap {
  position: relative; display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}
.row-wrap::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  border-radius: 2px; background: var(--bar);
}
.is-active { --tone: var(--tone-active); --bar: var(--bar-active); --wash: var(--wash-active); }
.is-soon { --tone: var(--tone-soon); --bar: var(--bar-soon); --wash: var(--wash-soon); }
.is-expired { --tone: var(--tone-expired); --bar: var(--bar-expired); --wash: var(--wash-expired); }

.row {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px;
  padding: 12px 6px 12px 16px; text-decoration: none;
}
.who { display: grid; gap: 1px; min-width: 0; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; line-height: 1.3; }
.sub { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.3; }
.village { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.state { margin-left: auto; white-space: nowrap; color: var(--tone); font-weight: 700; }

.remind {
  flex: none; width: 44px; height: 44px; margin-left: 4px;
  display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--wash); color: var(--tone);
}

/* ── Avatar (emoji) ──────────────────────────────────── */
.avatar {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--neem-bg);
  font: 28px/1 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.avatar.lg { width: 88px; height: 88px; border-radius: 22px; font-size: 52px; }
.tint-0 { background: #dbe6d6; }
.tint-1 { background: #dde6ee; }
.tint-2 { background: #e6dfee; }
.tint-3 { background: #eee6d3; }
.tint-4 { background: #d3e8e4; }
.avatar.pop { animation: pop 0.25s ease-out; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  min-height: 48px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--neem); color: #fff; }
.btn.secondary { border-color: var(--neem); background: transparent; color: var(--neem); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { background: var(--tone-expired); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.add-btn { width: 100%; margin-top: 18px; }

.text-btn { font-weight: 700; text-decoration: none; padding: 10px 4px; }
.text-danger {
  display: block; margin: 40px auto 0; padding: 12px;
  border: 0; background: none; color: var(--tone-expired); font-weight: 500; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── Sub-screens: bar ────────────────────────────────── */
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 12px; }
.back { display: inline-flex; align-items: center; gap: 2px; padding: 10px 8px 10px 0; text-decoration: none; font-weight: 500; }
.bar-title { font: 600 30px/1 var(--font-display); }

/* ── Detail ──────────────────────────────────────────── */
.profile { display: flex; gap: 16px; align-items: flex-start; }
.profile-text { display: grid; gap: 2px; min-width: 0; }
.name { font: 600 38px/1 var(--font-display); margin-bottom: 6px; overflow-wrap: anywhere; }

.status-panel { margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--wash); }
.status-line { font: 600 36px/1 var(--font-display); color: var(--tone); }
.status-sub { margin: 4px 0 14px; color: var(--neem); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .primary { grid-column: 1 / -1; }
.actions .secondary { background: rgba(255, 255, 255, 0.5); padding: 0 10px; white-space: nowrap; }

.history { margin-top: 28px; }
.history h2 { font: 600 26px/1 var(--font-display); margin-bottom: 8px; }
.history ol { list-style: none; }
.history li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.history li > div { display: grid; }
.tag { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--neem); color: #fff; font-size: 13px; font-weight: 500; }

/* ── Forms ───────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
label, .label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.hint { font-weight: 400; }

input[type='text'], input[type='email'], input[type='password'],
input[type='tel'], input[type='date'], input[type='search'] {
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--neem);
}
input[type='search']::-webkit-search-cancel-button { display: none; }
input:focus-visible { outline: none; border-color: var(--neem); box-shadow: 0 0 0 3px rgba(47, 83, 64, 0.25); }
input::placeholder { color: #7c8a80; }

.field-error, .form-error { min-height: 0; color: var(--tone-expired); font-size: 14px; font-weight: 500; }
.field-error:empty, .form-error:empty { display: none; }

.login { padding-top: calc(env(safe-area-inset-top, 0px) + 56px); }
.login-title { font: 600 28px/1 var(--font-display); margin-top: 28px; }
.login .stack { width: 100%; }

.emoji-row { display: flex; align-items: center; gap: 16px; }
.emoji-row .btn { flex: 1; min-width: 0; }
.form-screen .btn.primary[type='submit'] {
  position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  box-shadow: 0 6px 18px rgba(29, 58, 43, 0.28);
}
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.days-input { margin-top: 2px; }
.preview { font-weight: 500; min-height: 1.5em; }

/* ── Sheet ───────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(29, 58, 43, 0.5);
}
.sheet {
  width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto;
  padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  border-radius: 16px 16px 0 0; background: var(--paper);
  animation: sheet-up 0.2s ease-out;
}
.sheet:focus { outline: none; }
.sheet-title { font: 600 30px/1.05 var(--font-display); }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed; left: 0; right: 0; z-index: 30; pointer-events: none;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex; justify-content: center; padding: 0 16px;
}
.toast {
  padding: 10px 18px; border-radius: 999px; font-weight: 500; text-align: center;
  background: var(--neem); color: #fff; box-shadow: 0 6px 18px rgba(29, 58, 43, 0.28);
}
.toast-error { background: var(--tone-expired); }

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes pop {
  from { transform: scale(0.7); }
  to { transform: scale(1); }
}
@keyframes announce-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 58, 43, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(29, 58, 43, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .avatar.pop, .icon-btn.is-playing { animation: none; }
}

/* Renewal banner: shown a few days before the plan ends */
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--wash-soon); color: var(--tone-soon); font-weight: 600; }
.plan-banner[hidden] { display: none; }
.plan-banner a { color: inherit; text-decoration: underline; white-space: nowrap; }

/* Admin screen */
.admin-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--bar-active); border-radius: var(--r-md); background: var(--paper); }
.admin-row.is-expired { border-left-color: var(--bar-expired); }
.admin-info { display: grid; gap: 2px; min-width: 0; }
.admin-info strong, .admin-info span { overflow: hidden; text-overflow: ellipsis; }
.admin-days { font-weight: 600; color: var(--tone-active); }
.admin-row.is-expired .admin-days { color: var(--tone-expired); }

/* ── v8: tabs, money, renewals, check-in, activity, notices ─────────── */
.screen.has-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  background: var(--paper); border-top: 1.5px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1; max-width: 112px; min-height: 60px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.tab.is-on { color: var(--neem); font-weight: 700; box-shadow: inset 0 3px 0 var(--neem); }

.icon-btn.small { width: 36px; height: 36px; flex: none; }
.icon-btn.flip .ico { transform: scaleX(-1); }
.icon-btn:disabled { opacity: 0.35; }

.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.month-label { font: 600 28px/1 var(--font-display); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; gap: 2px; padding: 14px; border-radius: 12px; background: var(--neem-bg); --tone: var(--neem); }
.tile.is-active { background: var(--wash-active); --tone: var(--tone-active); }
.tile.is-expired { background: var(--wash-expired); --tone: var(--tone-expired); }
.tile:last-child { grid-column: 1 / -1; }
.tile-name { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tile-value { font: 600 38px/1 var(--font-display); color: var(--tone); }
.tile-sub { font-size: 14px; color: var(--ink-2); }
.tiles + .meter { margin-top: 12px; }
.section-title { font: 600 26px/1 var(--font-display); margin: 22px 0 6px; }

.row-wrap.is-left { --tone: var(--ink-2); --bar: var(--line); --wash: var(--neem-bg); opacity: 0.7; }
.sub.late { color: var(--tone-expired); font-weight: 700; }
.promise { margin-top: 10px; font-weight: 700; color: var(--tone-soon); }
.tag-unpaid { background: var(--tone-expired); }
.text-link { display: block; margin: 28px auto 0; padding: 12px; border: 0; background: none; color: var(--neem); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link + .text-danger { margin-top: 4px; }

label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; color: var(--neem); font-weight: 500; }
input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--neem); flex: none; }
.btn.small { min-height: 40px; padding: 0 12px; margin-right: 4px; }

.qr-box { width: min(100%, 300px); margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }

.scan-video { width: 100%; max-height: 50dvh; margin-top: 12px; border-radius: 12px; background: #000; object-fit: cover; }
.scan-video[hidden], .scan-result[hidden] { display: none; }
.scan-result { margin: 12px 0; padding: 14px; border-radius: 12px; font: 600 24px/1.1 var(--font-display); background: var(--wash); color: var(--tone); }
.scan-result.is-active { --wash: var(--wash-active); --tone: var(--tone-active); }
.scan-result.is-soon { --wash: var(--wash-soon); --tone: var(--tone-soon); }
.scan-result.is-expired { --wash: var(--wash-expired); --tone: var(--tone-expired); }
.scan-result + .muted { margin-bottom: 4px; }
.screen > .scan-video + .scan-result, .screen > .btn.primary + .scan-result { margin-top: 12px; }

.activity-list { list-style: none; }
.act { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.act > div { display: grid; min-width: 0; }
.act-amt { font-weight: 700; color: var(--tone-active); white-space: nowrap; }
.act-remove strong, .act-left strong { color: var(--tone-expired); }

.notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 12px 10px 14px; border-radius: var(--r-md); background: var(--neem-bg); border-left: 4px solid var(--neem); }
.notice[hidden] { display: none; }
.notice p { padding-top: 6px; overflow-wrap: anywhere; }

.textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--neem); font: inherit; resize: vertical; }
.textarea:focus-visible { outline: none; border-color: var(--neem); box-shadow: 0 0 0 3px rgba(47, 83, 64, 0.25); }
.admin-row .btn { flex: none; }
.admin-info span { white-space: normal; }

/* ══ v8: Liquid glass look (logged-in screens only: body.glass) ══════════════
   Soft coloured light behind, frosted translucent surfaces on top. */
body.glass { background: #dfeae4; }
body.glass::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 38% at 12% 8%, rgba(120, 200, 150, 0.85), transparent 70%),
    radial-gradient(50% 38% at 92% 22%, rgba(130, 185, 235, 0.8), transparent 70%),
    radial-gradient(60% 42% at 78% 96%, rgba(245, 205, 120, 0.8), transparent 70%),
    radial-gradient(50% 36% at 4% 84%, rgba(185, 165, 235, 0.7), transparent 70%),
    linear-gradient(180deg, #e8f1ec, #dce8ee);
}
body.glass {
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 8px 28px rgba(29, 58, 43, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.25);
  --paper: rgba(255, 255, 255, 0.55);
  --line: rgba(29, 58, 43, 0.14);
}
body.glass .tile, body.glass .status-panel, body.glass .notice, body.glass .plan-banner, body.glass .admin-row,
body.glass .hm-tile, body.glass .scan-result, body.glass .row-wrap, body.glass .sheet, body.glass .tabbar,
body.glass .chip, body.glass .icon-btn, body.glass .btn.secondary, body.glass .act, body.glass .qr-box {
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}
body.glass .tile, body.glass .status-panel, body.glass .notice, body.glass .plan-banner, body.glass .admin-row,
body.glass .hm-tile, body.glass .scan-result, body.glass .row-wrap, body.glass .act {
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 22px;
}
body.glass .tile.is-active, body.glass .status-panel.is-active, body.glass .scan-result.is-active { background: rgba(160, 220, 180, 0.45); }
body.glass .tile.is-expired, body.glass .status-panel.is-expired, body.glass .scan-result.is-expired { background: rgba(240, 160, 140, 0.4); }
body.glass .scan-result.is-soon { background: rgba(245, 215, 130, 0.5); }
body.glass .plan-banner { background: rgba(245, 215, 130, 0.5); }
body.glass .rows { display: grid; gap: 10px; margin-top: 10px; }
body.glass .row-wrap { border-bottom: 1px solid var(--glass-edge); overflow: hidden; padding-right: 6px; }
body.glass .row-wrap::before { left: 8px; top: 14px; bottom: 14px; }
body.glass .row { padding-left: 24px; }
body.glass .remind { background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 16px; }
body.glass .act { padding: 12px 16px; margin-top: 10px; }
body.glass .activity-list { margin-top: 6px; }
body.glass .admin-row { border-left: 1px solid var(--glass-edge); }
body.glass .avatar { border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); }

body.glass .icon-btn, body.glass .chip, body.glass .btn.secondary {
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 16px;
}
body.glass .chip[aria-pressed='true'], body.glass .btn.primary, body.glass .tab.is-on { color: #fff; }
body.glass .chip[aria-pressed='true'] { background: linear-gradient(rgba(47, 83, 64, 0.9), rgba(29, 58, 43, 0.95)); border-color: rgba(255, 255, 255, 0.4); }
body.glass .btn { border-radius: 18px; }
body.glass .btn.primary {
  background: linear-gradient(rgba(60, 105, 80, 0.95), rgba(29, 58, 43, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 24px rgba(29, 58, 43, 0.28);
}
body.glass .btn.danger { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px rgba(169, 58, 36, 0.3); }
body.glass .tag { background: rgba(29, 58, 43, 0.85); }
body.glass .meter { border-radius: 999px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--glass-edge); padding: 2px; }
body.glass .seg { border-radius: 999px; }

body.glass input[type='text'], body.glass input[type='email'], body.glass input[type='password'], body.glass input[type='tel'],
body.glass input[type='date'], body.glass input[type='search'], body.glass .textarea {
  background: rgba(255, 255, 255, 0.55); border: 1px solid var(--glass-edge); border-radius: 16px;
  box-shadow: inset 0 1px 2px rgba(29, 58, 43, 0.08);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* Sheet and bottom tabs float as glass panels */
body.glass .sheet-backdrop { background: rgba(29, 58, 43, 0.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.glass .sheet { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--glass-edge); border-bottom: 0; border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(29, 58, 43, 0.18), inset 0 1px 0 #fff; }
body.glass .tabbar {
  left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 26px; box-shadow: var(--glass-shadow); padding: 0 4px;
}
body.glass .tab { border-radius: 20px; max-width: 80px; min-height: 56px; margin: 4px 0; }
body.glass .tab.is-on { background: linear-gradient(rgba(60, 105, 80, 0.95), rgba(29, 58, 43, 0.97)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
body.glass .screen.has-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px); }
body.glass .toast { background: rgba(29, 58, 43, 0.85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.3); }
body.glass .toast-error { background: rgba(169, 58, 36, 0.9); }
body.glass .form-screen .btn.primary[type='submit'] { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }

/* Home screen */
.home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.home-date { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.home-name { font: 600 clamp(44px, 13vw, 60px) / 0.98 var(--font-display); letter-spacing: 0.005em; overflow-wrap: anywhere; margin-top: 2px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.hm-tile {
  display: grid; align-content: space-between; gap: 6px; min-height: 132px; padding: 16px; text-align: left;
  text-decoration: none; color: var(--neem); font: inherit; cursor: pointer; border: 0;
  background: var(--glass, rgba(255, 255, 255, 0.5)); border-radius: 22px; transition: transform 0.12s ease;
}
.hm-tile:active { transform: scale(0.97); }
.hm-tile strong { font-size: 18px; line-height: 1.15; }
.hm-sub { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.hm-ico {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; color: var(--neem);
  background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(29, 58, 43, 0.1);
}
.home .plan-banner, .home .notice { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .hm-tile { transition: none; } }
body.glass .list .wordmark { font-size: 34px; align-self: center; }

/* Gym logo */
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-row .stack { flex: 1; gap: 8px; }
.logo-box { width: 88px; height: 88px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 22px; background: linear-gradient(#2f5340, #1d3a2b); color: #fff; font: 700 34px/1 var(--font-body); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.logo-box img, .home-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.home-logo { width: 64px; height: 64px; flex: none; overflow: hidden; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 6px 18px rgba(29, 58, 43, 0.18); }
.home-logo[hidden] { display: none; }
.hint { display: block; }
.btn[hidden] { display: none; }

.admin-actions { display: grid; gap: 8px; flex: none; }
.admin-actions .btn { min-height: 44px; font-size: 14px; padding: 0 12px; }
.admin-row { flex-wrap: wrap; }
.qr-card { display: grid; gap: 10px; justify-items: center; text-align: center; margin: 4px 0 14px; padding: 16px; border-radius: 22px; background: var(--glass, rgba(255, 255, 255, 0.5)); border: 1px solid rgba(255, 255, 255, 0.8); }

/* Member check-in page (after scanning the gym QR) */
.mc { display: grid; align-content: start; gap: 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 40px); }
.mc-gym { font: 600 36px/1 var(--font-display); }
.mc-card { display: grid; gap: 12px; padding: 20px; border-radius: 26px; background: var(--glass, rgba(255, 255, 255, 0.55)); border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: 0 8px 28px rgba(29, 58, 43, 0.12), inset 0 1px 0 #fff; -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); }
.mc-card h1 { font: 600 34px/1.05 var(--font-display); }
.mc-card.is-active { background: rgba(160, 220, 180, 0.5); color: var(--tone-active); }
.mc-card.is-expired { background: rgba(240, 160, 140, 0.45); color: var(--tone-expired); }
.mc-card.is-soon { background: rgba(245, 215, 130, 0.5); color: var(--tone-soon); }
.mc-card p { color: var(--neem); }
.mc-soon { font-weight: 700; color: var(--tone-soon); }
.account-box { display: grid; gap: 10px; margin-top: 28px; }

/* WhatsApp screen */
.wa-warn { padding: 16px; border-radius: 22px; background: rgba(245, 215, 130, 0.5); border: 1px solid rgba(255, 255, 255, 0.8); }
.wa-warn h2, .wa-code h2, .wa-card h2 { font: 600 24px/1.1 var(--font-display); margin-bottom: 8px; }
.wa-warn ul { display: grid; gap: 10px; padding-left: 18px; }
.wa-code { display: grid; gap: 12px; padding: 18px; border-radius: 22px; background: var(--glass, rgba(255, 255, 255, 0.5)); border: 1px solid rgba(255, 255, 255, 0.8); text-align: center; }
.wa-code .code { font: 700 44px/1 var(--font-body); letter-spacing: 0.12em; color: var(--neem); user-select: all; }
.wa-code ol { text-align: left; display: grid; gap: 8px; padding-left: 22px; }
.wa-card { display: grid; gap: 4px; padding: 16px; border-radius: 22px; background: rgba(160, 220, 180, 0.45); border: 1px solid rgba(255, 255, 255, 0.8); }
.wa-recent { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.wa-recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--glass, rgba(255, 255, 255, 0.5)); border: 1px solid rgba(255, 255, 255, 0.8); }
.wa-recent li > div { display: grid; min-width: 0; }
.wa-pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(29, 58, 43, 0.12); }
.wa-sent .wa-pill { background: rgba(160, 220, 180, 0.7); }
.wa-failed .wa-pill { background: rgba(240, 160, 140, 0.7); }
.wa-skipped .wa-pill { background: rgba(245, 215, 130, 0.7); }

/* Announcements */
.ann-list { list-style: none; display: grid; gap: 8px; }
.ann-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--glass, rgba(255, 255, 255, 0.5)); border: 1px solid rgba(255, 255, 255, 0.8); }
.ann-play { width: 46px; min-width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; }
.ann-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-timer { font-weight: 700; font-size: 20px; }
.ann-row .text-danger { width: auto; margin: 0; flex: none; padding: 8px 4px; }
.ann-row .ann-play { flex: none; aspect-ratio: 1; }
.data-box { margin-top: 8px; }
