/* ============================================================================
   GYMOPS — SUPER ADMIN COMMAND CENTER   (Phase 7 / RD-3.1)
   Premium dark-glass control panel. Plain CSS, no build step, no Jinja.
   Self-contained: super-admin is cross-gym, so it keeps its own teal/blue
   identity rather than per-gym brand theming. Visual language matches the
   Iron Temple Aura design system (glass, blur, accent glow, Outfit/Inter).
   All legacy class names are preserved so every admin template reskins
   without touching its brace-fragile Jinja body.
   ========================================================================== */

:root {
  --bg-0: #06080c;
  --bg-1: #0a0e14;
  --bg: #0a0e14;
  --surface: rgba(20, 26, 34, 0.72);
  --surface-solid: #131922;
  --surface-2: #1b222c;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.10);
  --line-hi: rgba(255, 255, 255, 0.18);
  --text: #f3f6f8;
  --muted: #93a0ad;
  --soft: #c8d0d8;
  --faint: #64727f;
  --teal: #25c2a0;
  --teal-light: #5eead4;
  --blue: #4b8cff;
  --amber: #f4b545;
  --red: #ef6b6b;
  --green: #58d68d;
  --accent-grad: linear-gradient(135deg, var(--teal), var(--blue));
  --accent-glow: rgba(37, 194, 160, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --pill: 999px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.50);
  --blur: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 0.32s;
}

/* ----- PLATFORM IDENTITY (A-1 / Req 13) ---------------------------------- *
   Super Admin is the platform owner — NOT gym-branded. The whole panel carries
   a fixed cool steel-indigo / cyan "mission control" identity (design §18),
   scoped to `.admin-body` so it can never leak onto a gym-branded surface and
   so no gym `css_vars()` block is ever injected as the admin theme. Every admin
   accent surface resolves from `--a-accent*`, and each resolution carries a
   fixed literal fallback (a platform color, never a gym brand) so accent
   surfaces still render if `--a-accent` somehow fails to resolve (Req 13.5).
   The legacy accent tokens (`--teal`, `--blue`, `--accent-grad`, ...) are
   re-pointed at the platform identity here, so every existing admin class
   re-themes at once without touching the brace-fragile page templates. */
.admin-body {
  --a-accent: #5b8cf0;
  --a-accent-dark: #3a5fc8;
  --a-accent-light: #56e0f2;
  --a-accent-soft: rgba(91, 140, 240, 0.16);
  --a-accent-line: rgba(91, 140, 240, 0.40);
  --a-accent-glow: rgba(91, 140, 240, 0.42);
  --a-accent-grad: linear-gradient(135deg, var(--a-accent, #5b8cf0), var(--a-accent-light, #56e0f2));
  --a-on-accent: #05101f;

  /* Re-point the legacy admin accent tokens at the platform identity. The
     literal fallbacks are platform colors (never a gym brand) per Req 13.5. */
  --teal: var(--a-accent, #5b8cf0);
  --teal-light: var(--a-accent-light, #56e0f2);
  --blue: var(--a-accent-dark, #3a5fc8);
  --accent-grad: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2));
  --accent-glow: var(--a-accent-glow, rgba(91, 140, 240, 0.42));
}

* { box-sizing: border-box; }

/* ----- Base / ambient background ----------------------------------------- */
body.admin-body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(91, 140, 240, 0.12), transparent 42%),
    radial-gradient(120% 90% at 100% 0%, rgba(86, 224, 242, 0.10), transparent 46%),
    var(--bg-0);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* slow drifting aurora orb (decorative, reduced-motion safe) */
body.admin-body::before {
  content: "";
  position: fixed;
  top: -22vmax;
  left: -12vmax;
  width: 52vmax;
  height: 52vmax;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(91, 140, 240, 0.16), transparent 62%);
  filter: blur(70px);
  animation: admin-aurora 30s var(--ease) infinite alternate;
}
@keyframes admin-aurora {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(10vmax, 8vmax, 0) scale(1.15); }
}

a { color: inherit; }

::selection { background: var(--teal); color: #06100d; }

* { scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: var(--pill); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----- Shell ------------------------------------------------------------- */
.admin-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--a-side-w, 264px) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--dur) var(--ease);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: rgba(10, 13, 18, 0.74);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 22px;
  text-decoration: none;
  font-family: Outfit, Inter, sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-grad);
  color: #06100d;
  font-weight: 900;
  box-shadow: 0 8px 22px var(--accent-glow);
}

.nav-section {
  padding: 18px 12px 7px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-sidebar a,
.sidebar-button {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.admin-sidebar a:hover,
.sidebar-button:hover {
  background: var(--glass);
  color: var(--text);
}

.admin-sidebar a.active {
  background: var(--a-accent-soft, rgba(91, 140, 240, 0.12));
  color: var(--teal-light);
}
.admin-sidebar a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: var(--pill);
  background: var(--accent-grad);
}

.nav-icon {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
}
.nav-icon svg { width: 19px; height: 19px; display: block; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-spacer { flex: 1; }
.sidebar-button {
  margin-top: 4px;
  border: 1px solid var(--line);
  justify-content: center;
  font-weight: 800;
}
.sidebar-button:hover { border-color: var(--line-hi); }

/* ====================================================================== *
   A-1 PLATFORM SHELL — command bar · collapse-rail · drawer · ⌘K palette
   ====================================================================== */

/* ----- Main column + sticky command bar ---------------------------------- */
.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.a-commandbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(8, 11, 16, 0.74);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--line);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .a-commandbar { background: var(--bg-1); }
}

.a-burger {
  display: none;            /* only on the <960px drawer breakpoint */
  flex: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.a-burger:hover { border-color: var(--line-hi); background: var(--glass-2); }
.a-burger svg { width: 22px; height: 22px; }

.a-commandbar__brand {
  display: none;            /* only on the <960px drawer breakpoint */
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: Outfit, Inter, sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}
.a-commandbar__brand .brand-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }

.a-cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-cmdk-trigger:hover { border-color: var(--teal); color: var(--text); background: var(--glass-2); }
.a-cmdk-trigger__icon { display: grid; place-items: center; flex: none; }
.a-cmdk-trigger__icon svg { width: 17px; height: 17px; }
.a-cmdk-trigger__label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-cmdk-trigger__kbd {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line-hi);
  border-radius: 7px;
  background: var(--glass-2);
  color: var(--soft);
  font-family: Outfit, Inter, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.a-commandbar__spacer { flex: 1; }

.a-env-badge {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--a-accent-line, rgba(91, 140, 240, 0.4));
  border-radius: var(--pill);
  background: var(--a-accent-soft, rgba(91, 140, 240, 0.16));
  color: var(--teal-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ----- Desktop collapse toggle (injected by admin.js, >=1280px) ---------- */
.a-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.a-collapse-toggle:hover { background: var(--glass); color: var(--text); border-color: var(--line-hi); }
.a-collapse-toggle__icon { flex: none; width: 22px; height: 22px; display: grid; place-items: center; transition: transform var(--dur) var(--ease); }
.a-collapse-toggle__icon svg { width: 18px; height: 18px; }

/* ----- Collapsed icon-rail state (960–1279px, or persisted preference) ---- */
.admin-shell.is-collapsed { --a-side-w: 78px; }
.admin-shell.is-collapsed .admin-sidebar { padding-left: 10px; padding-right: 10px; }
.admin-shell.is-collapsed .nav-label,
.admin-shell.is-collapsed .nav-section,
.admin-shell.is-collapsed .sidebar-brand .nav-label,
.admin-shell.is-collapsed .a-collapse-toggle__label { display: none; }
.admin-shell.is-collapsed .admin-sidebar a,
.admin-shell.is-collapsed .sidebar-button,
.admin-shell.is-collapsed .a-collapse-toggle { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.admin-shell.is-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.admin-shell.is-collapsed .a-collapse-toggle__icon { transform: rotate(180deg); }

/* ----- Off-canvas drawer scrim (<960px) ---------------------------------- */
.a-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 4, 8, 0.58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.a-scrim.is-open { opacity: 1; }

/* ====================================================================== *
   ⌘K COMMAND PALETTE  (overlay built by admin.js)
   ====================================================================== */
.a-cmdk {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 12vh 16px 16px;
  background: rgba(2, 4, 8, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.a-cmdk[hidden] { display: none; }
.a-cmdk__panel {
  width: min(640px, 100%);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: admin-rise 0.24s var(--ease) both;
}
.a-cmdk__field {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.a-cmdk__field svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.a-cmdk__input {
  flex: 1;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}
.a-cmdk__input:focus { box-shadow: none; background: transparent; }
.a-cmdk__results { max-height: 52vh; overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.a-cmdk__result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: var(--soft);
  text-decoration: none;
  cursor: pointer;
}
.a-cmdk__result:hover,
.a-cmdk__result.is-active { background: var(--a-accent-soft, rgba(91, 140, 240, 0.14)); color: var(--text); }
.a-cmdk__result-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--glass-2);
  color: var(--teal-light);
}
.a-cmdk__result-icon svg { width: 16px; height: 16px; }
.a-cmdk__result-body { min-width: 0; flex: 1; }
.a-cmdk__result-title { display: block; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-cmdk__result-meta { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-cmdk__kind {
  flex: none;
  padding: 3px 9px;
  border-radius: var(--pill);
  background: var(--glass-2);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.a-cmdk__empty { padding: 28px; text-align: center; color: var(--muted); font-weight: 600; }
.a-cmdk__error {
  margin: 8px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 107, 107, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(239, 107, 107, 0.12);
  color: #ffb2b2;
  font-weight: 650;
}


/* ----- Content ----------------------------------------------------------- */
.admin-content {
  width: 100%;
  max-width: 1480px;
  padding: 36px 42px 64px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-light);
  font-family: Outfit, Inter, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Outfit, Inter, sans-serif;
  letter-spacing: -0.01em;
  color: #fff;
}
h1 { margin: 0; font-size: 34px; line-height: 1.08; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 16px; }

.subtle,
.panel-head p,
.gym-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ----- Cards / panels (glass) ------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card,
.admin-panel,
.gym-card,
.page-head,
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .metric-card, .admin-panel, .gym-card, .page-head, .panel { background: var(--surface-solid); }
}

.metric-card {
  padding: 20px;
  overflow: hidden;
  animation: admin-rise 0.5s var(--ease) both;
}
.metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-grad);
}
.metric-card:nth-child(2) { animation-delay: 0.05s; }
.metric-card:nth-child(3) { animation-delay: 0.10s; }
.metric-card:nth-child(4) { animation-delay: 0.15s; }
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin-top: 10px;
  font-family: Outfit, Inter, sans-serif;
  font-size: 36px;
  line-height: 1;
}

.admin-panel {
  padding: 22px;
  margin-bottom: 20px;
}

.data-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border-color: rgba(37, 194, 160, 0.28);
  background: linear-gradient(135deg, rgba(37, 194, 160, 0.12), rgba(75, 140, 255, 0.06));
}
.data-note strong { white-space: nowrap; color: var(--teal-light); }
.data-note span { color: var(--soft); line-height: 1.55; }

.add-gym-panel { border-color: rgba(75, 140, 255, 0.26); }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

/* ----- Forms ------------------------------------------------------------- */
.command-form,
.settings-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
input, select { height: 44px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--faint); }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2393a0ad' stroke-width='2'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16));
  background: var(--glass-2);
}
.wide { grid-column: span 2; }

/* ----- Buttons ----------------------------------------------------------- */
.admin-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-family: Outfit, Inter, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-spring), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.admin-btn:active { transform: translateY(1px) scale(0.98); }
.admin-btn-primary {
  background: var(--accent-grad);
  color: #06100d;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.admin-btn-primary:hover { box-shadow: 0 14px 36px var(--accent-glow); }
.admin-btn-secondary {
  background: var(--glass-2);
  border-color: var(--line-hi);
  color: var(--text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.admin-btn-secondary:hover { border-color: var(--teal); }

/* ----- Gym grid / cards -------------------------------------------------- */
.gym-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gym-card {
  padding: 20px;
  animation: admin-rise 0.5s var(--ease) both;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.gym-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-hi);
  box-shadow: var(--shadow-lg);
}

.gym-card-top,
.gym-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.gym-card-footer { margin-top: 4px; align-items: center; }
.gym-card h2 { margin-top: 12px; font-size: 22px; }

.source-chip,
.status-pill,
.channel-pill,
.member-code {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--glass-2);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.status-pill.ok,
.status-pill.sent,
.status-pill.dry_run,
.good {
  background: rgba(88, 214, 141, 0.14);
  border-color: rgba(88, 214, 141, 0.30);
  color: var(--green);
}
.status-pill.warn,
.status-pill.failed,
.bad {
  background: rgba(239, 107, 107, 0.14);
  border-color: rgba(239, 107, 107, 0.30);
  color: var(--red);
}
.source-chip {
  background: rgba(75, 140, 255, 0.14);
  border-color: rgba(75, 140, 255, 0.28);
  color: #a9c6ff;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.mini-metrics div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
}
.mini-metrics strong { display: block; font-family: Outfit, Inter, sans-serif; font-size: 23px; }
.mini-metrics span,
.last-log,
.admin-table small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.channel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.channel-pill.enabled {
  background: rgba(37, 194, 160, 0.13);
  border-color: rgba(37, 194, 160, 0.30);
  color: var(--teal-light);
}

/* ----- Tabs -------------------------------------------------------------- */
.tabbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}
.tabbar a {
  padding: 9px 16px;
  border-radius: var(--pill);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tabbar a:hover { color: var(--text); }
.tabbar a.active { background: var(--accent-grad); color: #06100d; }

/* ----- Split / channel lines -------------------------------------------- */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.channel-list,
.action-stack { display: grid; gap: 10px; }
.channel-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
}
.channel-line small,
.muted { color: var(--muted); }

/* ----- Tables ------------------------------------------------------------ */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.admin-table th,
.admin-table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(12, 16, 22, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-table tbody tr { transition: background var(--dur) var(--ease); }
.admin-table tbody tr:hover { background: var(--glass); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td { color: var(--soft); font-size: 14px; }
.table-search { max-width: 280px; }
.link-open { color: var(--teal-light); font-weight: 800; text-decoration: none; }
.link-open:hover { text-decoration: underline; }
.bulk-textarea { margin-top: 14px; font-family: "SFMono-Regular", Consolas, monospace; }

/* ----- Toggles ----------------------------------------------------------- */
.toggle-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.toggle-line {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  text-transform: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--soft);
}
.toggle-line input { width: 18px; height: 18px; accent-color: var(--teal); }

/* ----- Alerts / empty ---------------------------------------------------- */
.inline-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 181, 69, 0.38);
  border-radius: var(--radius-sm);
  background: rgba(244, 181, 69, 0.10);
  color: #ffd38a;
  font-weight: 650;
}
.admin-empty {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-hi);
  border-radius: var(--radius);
  background: var(--glass);
}

.quick-gym-list { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-gym-list a {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.quick-gym-list a:hover { border-color: var(--teal); background: var(--glass-2); }

/* ----- Login ------------------------------------------------------------- */
.admin-login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.admin-login-card {
  position: relative;
  width: min(430px, 100%);
  padding: 38px 34px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: admin-rise 0.5s var(--ease) both;
}
.admin-login-card::before {
  content: "";
  position: absolute;
  top: -90px; right: -70px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.login-logo {
  position: relative;
  font-family: Outfit, Inter, sans-serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.login-sub { position: relative; margin: 8px 0 26px; color: var(--muted); }
.admin-login-card label { margin-bottom: 8px; }
.login-btn {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: var(--pill);
  background: var(--accent-grad);
  color: #06100d;
  font-family: Outfit, Inter, sans-serif;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 28px var(--accent-glow);
  transition: transform 0.18s var(--ease-spring), box-shadow var(--dur) var(--ease);
}
.login-btn:hover { box-shadow: 0 16px 40px var(--accent-glow); }
.login-btn:active { transform: translateY(1px) scale(0.99); }
.login-error {
  position: relative;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 107, 107, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(239, 107, 107, 0.13);
  color: #ffb2b2;
  font-weight: 600;
}

/* ----- Legacy page-head / panel helpers --------------------------------- */
.page-head, .panel { padding: 20px; margin-bottom: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.panel table { width: 100%; border-collapse: collapse; }
.panel th, .panel td { padding: 13px; border-bottom: 1px solid var(--line); text-align: left; }
.panel th { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.panel td { color: var(--soft); font-size: 14px; }
.panel button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--pill);
  background: var(--accent-grad);
  color: #06100d;
  font-weight: 800;
  cursor: pointer;
}

/* ----- Entrance animation ------------------------------------------------ */
@keyframes admin-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ----- Responsive -------------------------------------------------------- */

/* Icon-rail breakpoint: 960–1279px (Req 12.2) — forced collapsed rail. */
@media (min-width: 960px) and (max-width: 1279.98px) {
  .admin-shell { --a-side-w: 78px; }
  .admin-shell .nav-label,
  .admin-shell .nav-section,
  .admin-shell .sidebar-brand .nav-label,
  .admin-shell .a-collapse-toggle__label { display: none; }
  .admin-sidebar a,
  .admin-sidebar .sidebar-button,
  .admin-sidebar .a-collapse-toggle { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  .admin-sidebar .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .admin-sidebar a.active::before { left: -10px; }
  .a-collapse-toggle { display: none; }   /* no manual collapse in the forced rail */
  .a-scrim { display: none !important; }
}

/* Drawer breakpoint: <960px (Req 12.3 / 12.4) — off-canvas drawer + burger. */
@media (max-width: 959.98px) {
  .admin-shell {
    display: block;
    min-height: 100vh;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: 282px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    border-right: 1px solid var(--line);
  }
  .admin-sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  /* the drawer always shows full labels even if a collapse pref was stored */
  .admin-shell.is-collapsed .nav-label,
  .admin-shell.is-collapsed .nav-section { display: block; }
  .admin-shell.is-collapsed .admin-sidebar a,
  .admin-shell.is-collapsed .admin-sidebar .sidebar-button { justify-content: flex-start; gap: 11px; padding: 10px 12px; }
  .a-burger { display: inline-flex; }
  .a-commandbar__brand { display: inline-flex; }
  .a-commandbar { padding: 10px 14px; }
  .a-cmdk-trigger { min-width: 0; flex: 1; max-width: none; }
  .a-cmdk-trigger__label { display: none; }
  .a-collapse-toggle { display: none; }
  .admin-content {
    width: 100%;
    max-width: none;
    padding: 24px 16px 48px;
  }
}

/* Dense content grids collapse on narrow viewports. */
@media (max-width: 1020px) {
  .metric-grid,
  .gym-grid,
  .split-grid,
  .toggle-grid { grid-template-columns: 1fr; }
  .command-form,
  .settings-form,
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .admin-topbar { flex-direction: column; }
  h1 { font-size: 28px; }
}

/* Card-stack tables + full-width command bar on phones (design §A6). */
@media (max-width: 639.98px) {
  .a-env-badge { display: none; }
  .a-cmdk { padding: 8vh 10px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-body::before { animation: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .metric-card, .gym-card, .admin-login-card { opacity: 1 !important; transform: none !important; }
}

/* ============================================================================
   A-2 — ALL-GYMS FLEET COMMAND  (dashboard.html)
   Charts row, dense fleet cards, search + tier-filter controls, and the
   no-match / zero-gyms empty states. Scoped to .admin-body and themed only
   from the platform accent (--a-accent*); no gym brand ever leaks in here.
   ========================================================================== */

/* ----- Fleet charts row -------------------------------------------------- */
.admin-body .a-charts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 24px;
}
.admin-body .a-chart-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  animation: admin-rise 0.5s var(--ease) both;
  overflow: hidden;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .admin-body .a-chart-card { background: var(--surface-solid); }
}
.admin-body .a-chart-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2));
  opacity: 0.8;
}
.admin-body .a-chart-card__head { margin-bottom: 14px; }
.admin-body .a-chart-card__head h2 {
  margin: 0;
  font-family: Outfit, Inter, sans-serif;
  font-size: 17px;
  font-weight: 800;
}
.admin-body .a-chart-card__head .subtle { margin: 4px 0 0; font-size: 12.5px; }
.admin-body .a-chart-card__canvas {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-body .a-chart-card__canvas svg { max-height: 170px; }
.admin-body .a-chart-card .at-error,
.admin-body .a-chart-card .at-locked {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 8px;
}

/* ----- Fleet toolbar: search + tier chips (Req 15.6 / 15.7) ------------- */
.admin-body .a-fleet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}
.admin-body .a-fleet-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.admin-body .a-fleet-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.admin-body .a-fleet-search__icon svg { width: 100%; height: 100%; }
.admin-body .a-fleet-search__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.admin-body .a-fleet-search__input::placeholder { color: var(--faint); }
.admin-body .a-fleet-search__input:focus-visible {
  outline: none;
  border-color: var(--a-accent, #5b8cf0);
  box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16));
}
.admin-body .a-fleet-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-body .a-tier-chip {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.admin-body .a-tier-chip:hover { border-color: var(--line-hi); color: var(--text); }
.admin-body .a-tier-chip:focus-visible {
  outline: none;
  border-color: var(--a-accent, #5b8cf0);
  box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16));
}
.admin-body .a-tier-chip.is-active {
  background: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2));
  border-color: transparent;
  color: var(--a-on-accent, #05101f);
}

/* ----- Tier badge on fleet cards ---------------------------------------- */
.admin-body .a-fleet-card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-body .a-tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 11px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--a-accent-line, rgba(91, 140, 240, 0.40));
  background: var(--a-accent-soft, rgba(91, 140, 240, 0.16));
  color: var(--a-accent-light, #56e0f2);
}
.admin-body .a-tier-badge--starter { opacity: 0.92; }
.admin-body .a-tier-badge--growth { filter: hue-rotate(8deg); }
.admin-body .a-tier-badge--pro {
  border-color: rgba(244, 181, 69, 0.42);
  background: rgba(244, 181, 69, 0.12);
  color: var(--amber);
}
.admin-body .a-tier-badge--elite {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(94, 234, 212, 0.12);
  color: var(--teal-light);
}

/* ----- Fleet cards (whole card is the link) ----------------------------- */
.admin-body .a-fleet-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.admin-body .a-fleet-card:focus-visible {
  outline: none;
  border-color: var(--a-accent, #5b8cf0);
  box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16));
}
.admin-body .a-fleet-card .a-fleet-card__cta {
  pointer-events: none; /* whole card is the anchor; keep the CTA visual only */
}
.admin-body .a-no-log {
  color: var(--faint);
  font-style: italic;
}
.admin-body .a-fleet-card[hidden] { display: none; }

/* ----- Empty states ------------------------------------------------------ */
.admin-body .a-fleet-empty {
  text-align: center;
  padding: 48px 28px;
  margin-bottom: 24px;
}
.admin-body .a-fleet-empty__art {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: var(--a-accent-light, #56e0f2);
}
.admin-body .a-fleet-empty__art svg { width: 100%; height: 100%; }
.admin-body .a-fleet-empty h2 {
  margin: 0 0 8px;
  font-family: Outfit, Inter, sans-serif;
}
.admin-body .a-fleet-empty p {
  max-width: 46ch;
  margin: 0 auto 18px;
  color: var(--muted);
}
.admin-body .a-fleet-nomatch[hidden] { display: none; }

/* ----- Responsive (consistent with A6: cards stack on narrow viewports) -- */
@media (max-width: 1100px) {
  .admin-body .a-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) {
  .admin-body .a-fleet-grid { grid-template-columns: 1fr; }
  .admin-body .a-fleet-toolbar { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-body .a-chart-card { opacity: 1 !important; transform: none !important; }
}

/* ====================================================================== *
   A-3 — GYM DETAIL CONTROL  (Req 16, 13.4)
   Premium gym header + tab panels. All accent comes from --a-accent; the
   gym brand is shown ONLY as a bounded data swatch and never themes the page.
   ====================================================================== */

/* ----- Gym header -------------------------------------------------------- */
.admin-body .a-gym-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-body .a-gym-head__main { min-width: 0; }
.admin-body .a-gym-head__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.admin-body .a-gym-head__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-body .a-inline-form { margin: 0; }

/* ----- Brand color swatch — DATA ONLY (Req 13.4) ------------------------- *
   This element shows the gym's brand color as inspectable data. It must NEVER
   feed any --a-accent surface; the inline background is bounded to the chip. */
.admin-body .a-brand-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 11px 3px 6px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--glass-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}
.admin-body .a-brand-swatch__chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-hi);
  flex: none;
}
.admin-body .a-brand-swatch__label { font-family: "SFMono-Regular", Consolas, monospace; }

/* ----- Status toggle switch ---------------------------------------------- */
.admin-body .gym-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  text-transform: none;
}
.admin-body .gym-toggle-switch input { opacity: 0; width: 0; height: 0; }
.admin-body .gym-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--line-hi);
  transition: background var(--dur) var(--ease);
  border-radius: var(--pill);
}
.admin-body .gym-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: transform var(--dur) var(--ease);
  border-radius: 50%;
}
.admin-body .gym-toggle-switch input:checked + .gym-toggle-slider {
  background: rgba(88, 214, 141, 0.85);
  border-color: rgba(88, 214, 141, 0.5);
}
.admin-body .gym-toggle-switch input:checked + .gym-toggle-slider:before { transform: translateX(22px); }
.admin-body .gym-toggle-switch input:disabled + .gym-toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ----- Shared panel dividers + helpers ----------------------------------- */
.admin-body .a-panel-divider {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.admin-body .settings-form .a-panel-divider { grid-column: 1 / -1; }
.admin-body .a-form-submit { margin-top: 22px; }

/* ----- Member links panel ------------------------------------------------ */
.admin-body .a-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.admin-body .a-link-row__url {
  color: var(--a-accent-light, #56e0f2);
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}
.admin-body .a-link-row__url:hover { text-decoration: underline; }

/* ----- Owner access ------------------------------------------------------ */
.admin-body .a-owner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.admin-body .a-owner-row__info { display: flex; flex-direction: column; gap: 2px; }
.admin-body .a-owner-row__info small { color: var(--muted); }
.admin-body .a-owner-empty { margin-bottom: 14px; }
.admin-body .a-owner-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
}
.admin-body .a-owner-create h3 { grid-column: 1 / -1; margin: 0; }
.admin-body .a-owner-create button { grid-column: 1 / -1; justify-self: start; }

/* ----- Danger zone ------------------------------------------------------- */
.admin-body .danger-zone {
  border-color: rgba(239, 107, 107, 0.4);
  background: rgba(239, 107, 107, 0.05);
}
.admin-body .a-danger-title { color: var(--red); }
.admin-body .a-btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
}
.admin-body .a-btn-danger:hover { box-shadow: 0 12px 30px rgba(239, 107, 107, 0.35); }

/* ----- Landing upload grid ----------------------------------------------- */
.admin-body .a-upload-grid {
  grid-column: 1 / -1;
  display: flex;
  gap: 24px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-body .a-upload-col { flex: 1; min-width: 240px; }
.admin-body .a-upload-hint { margin-bottom: 12px; font-size: 13px; }
.admin-body .a-upload-preview { margin-bottom: 12px; }
.admin-body .a-upload-preview__logo {
  width: 80px; height: 80px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--line-hi);
}
.admin-body .a-upload-preview__bg {
  width: 80px; height: 120px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line-hi);
}

/* ----- Attendance panels ------------------------------------------------- */
.admin-body .a-attendance-grid { margin-top: 16px; }
.admin-body .a-att-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--glass);
}
.admin-body .a-att-card--absent {
  background: rgba(239, 107, 107, 0.05);
  border-color: rgba(239, 107, 107, 0.22);
}
.admin-body .a-att-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 15px;
}
.admin-body .a-att-card__title--ok { color: var(--green); }
.admin-body .a-att-card__title--bad { color: var(--red); }
.admin-body .a-att-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-body .a-att-list__item { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.admin-body .a-att-list__item .muted { font-size: 12px; }

/* ----- Message templates ------------------------------------------------- */
.admin-body .a-var {
  background: var(--glass-2);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}
.admin-body .a-template-form { max-width: 820px; }
.admin-body .a-template-block {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.admin-body .a-template-block:last-of-type { border-bottom: 0; }
.admin-body .a-template-block__title {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.admin-body .a-template-block__hint { font-size: 13px; margin: 0 0 12px; }
.admin-body .a-field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
}
.admin-body .a-field-label--push { color: var(--a-accent-light, #56e0f2); }
.admin-body .a-template-field { margin-bottom: 12px; }
.admin-body .a-template-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  .admin-body .a-gym-head { flex-direction: column; }
  .admin-body .a-owner-create { grid-template-columns: 1fr; }
}

/* ====================================================================== *
   A-5 — FEATURE ACCESS + TIER PLANS  (Req 18, 19)
   Category-grouped entitlement matrix (per-gym + per-tier) and the tier-plans
   index with coverage viz. All accent comes from --a-accent (platform
   identity); status colors are brand-independent DS semantic tones.
   ====================================================================== */

/* ----- Index search (pick a gym / scan tiers) ---------------------------- */
.admin-body .a-feat-search {
  position: relative;
  max-width: 420px;
  margin: 0 0 18px;
}
.admin-body .a-feat-search__input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: var(--pill);
  border: 1px solid var(--line-hi, var(--line));
  background: var(--glass-2, var(--glass));
  color: var(--text);
  font-size: 14px;
}
.admin-body .a-feat-search__input:focus-visible {
  outline: none;
  border-color: var(--a-accent, #5b8cf0);
  box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16));
}
.admin-body .a-feat-search__icon {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.admin-body .a-feat-search__icon svg { width: 100%; height: 100%; }

/* ----- Tier selector card (per-gym matrix) ------------------------------- */
.admin-body .a-tier-select-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0;
}

/* ----- Category-grouped matrix ------------------------------------------- */
.admin-body .a-matrix { margin-bottom: 22px; }
.admin-body .a-matrix__head {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px;
}
.admin-body .a-matrix__title {
  font-family: Outfit, Inter, sans-serif;
  font-size: 17px; font-weight: 800; color: #fff; margin: 0;
}
.admin-body .a-matrix__count { font-size: 12.5px; color: var(--muted); font-weight: 700; }

.admin-body .a-matrix-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}
.admin-body .a-matrix-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.admin-body .a-matrix-table th {
  text-align: left; padding: 12px 16px; background: rgba(12, 16, 22, 0.96);
  color: var(--muted); font-weight: 900; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
.admin-body .a-matrix-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--soft); }
.admin-body .a-matrix-table tr:last-child td { border-bottom: none; }
.admin-body .a-matrix-table tbody tr { transition: background var(--dur) var(--ease); }
.admin-body .a-matrix-table tbody tr:hover { background: var(--glass); }

.admin-body .a-feat-name { font-weight: 800; color: #fff; display: block; }
.admin-body .a-feat-desc { display: block; margin-top: 2px; font-size: 12.5px; color: var(--soft); }
.admin-body .a-feat-key { display: block; margin-top: 3px; font-size: 11px; color: var(--faint, var(--muted)); font-family: "SFMono-Regular", Consolas, monospace; }

/* effective-state badge (text-bearing, not color-only — a11y) */
.admin-body .a-feat-state {
  display: inline-block; padding: 4px 11px; border-radius: var(--pill);
  font-size: 12px; font-weight: 800; border: 1px solid transparent;
}
.admin-body .a-feat-state--on { background: rgba(88, 214, 141, 0.14); color: var(--green); border-color: rgba(88, 214, 141, 0.30); }
.admin-body .a-feat-state--off { background: var(--glass-2, var(--glass)); color: var(--muted); border-color: var(--line); }

/* source tag — value is exactly registry / tier_map / gym_override / unknown */
.admin-body .a-src-tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11px;
  font-weight: 800; letter-spacing: 0.03em; border: 1px solid var(--line);
  background: var(--glass-2, var(--glass)); color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}
.admin-body .a-src-tag--gym_override { color: var(--a-accent-light, #56e0f2); border-color: var(--a-accent-line, rgba(91, 140, 240, 0.40)); background: var(--a-accent-soft, rgba(91, 140, 240, 0.16)); }
.admin-body .a-src-tag--tier_map { color: var(--amber); border-color: rgba(244, 181, 69, 0.32); background: rgba(244, 181, 69, 0.12); }

.admin-body .a-feat-limit { font-variant-numeric: tabular-nums; font-weight: 700; }
.admin-body .a-feat-limit--inf { color: var(--muted); }

.admin-body .a-feat-actions { display: flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
.admin-body .a-feat-actions input[type="number"] {
  width: 74px; padding: 7px 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-hi, var(--line)); background: var(--glass-2, var(--glass)); color: var(--text);
}
.admin-body .a-feat-actions .admin-btn { padding: 7px 12px; font-size: 12.5px; }

/* ----- Tier-plans index cards ------------------------------------------- */
.admin-body .a-tier-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.admin-body .a-tier-card {
  position: relative; padding: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.admin-body .a-tier-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2)); opacity: 0.85;
}
.admin-body .a-tier-card__name {
  font-family: Outfit, Inter, sans-serif; font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 4px;
}
.admin-body .a-tier-card__cov { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.admin-body .a-tier-card__cov strong { color: var(--text); font-variant-numeric: tabular-nums; }
.admin-body .a-coverage {
  height: 8px; border-radius: var(--pill); background: var(--glass-2, var(--glass));
  border: 1px solid var(--line); overflow: hidden; margin: 0 0 14px;
}
.admin-body .a-coverage__fill {
  height: 100%; border-radius: var(--pill);
  background: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2));
}
.admin-body .a-tier-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ----- Responsive: matrix tables collapse to readable cards < 640px ------ */
@media (max-width: 640px) {
  .admin-body .a-matrix-table { min-width: 0; }
  .admin-body .a-matrix-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-body .a-matrix-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .admin-body .a-matrix-table td { display: flex; justify-content: space-between; gap: 16px; border: none; padding: 7px 16px; }
  .admin-body .a-matrix-table td::before { content: attr(data-label); font-weight: 800; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
  .admin-body .a-feat-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-body .a-tier-card, .admin-body .a-matrix-table tbody tr { transition: none; }
}

/* ====================================================================== *
   A-6 — BULK ACTIONS + OPERATIONAL SCREENS  (Req 20, 21)
   Bulk multi-select + sticky action bar (bracket-env page), notification-log
   filters, unreachable QR cards, and sheet-link copy controls. Platform
   accent only (--a-accent); status tones are brand-independent.
   ====================================================================== */

/* ----- Status banner ----------------------------------------------------- */
.admin-body .a-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin: 0 0 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--glass-2, var(--glass)); color: var(--soft); font-weight: 600;
}
.admin-body .a-banner--ok { border-color: rgba(88, 214, 141, 0.32); background: rgba(88, 214, 141, 0.10); color: var(--green); }
.admin-body .a-banner--warn { border-color: rgba(244, 181, 69, 0.32); background: rgba(244, 181, 69, 0.10); color: var(--amber); }

/* ----- Bulk: sticky action bar + multi-select ---------------------------- */
.admin-body .a-bulk-bar {
  position: sticky; top: 8px; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin: 0 0 16px;
  background: var(--surface); border: 1px solid var(--line-hi, var(--line));
  border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.admin-body .a-bulk-bar__selall { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--soft); }
.admin-body .a-bulk-bar__count {
  font-size: 12px; font-weight: 800; color: var(--a-accent-light, #56e0f2);
  padding: 4px 10px; border-radius: var(--pill);
  background: var(--a-accent-soft, rgba(91, 140, 240, 0.16));
  border: 1px solid var(--a-accent-line, rgba(91, 140, 240, 0.40));
}
.admin-body .a-bulk-bar__msg {
  flex: 1; min-width: 200px; padding: 9px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-hi, var(--line));
  background: var(--glass-2, var(--glass)); color: var(--text);
}
.admin-body .a-bulk-bar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-body .a-check { width: 18px; height: 18px; accent-color: var(--a-accent, #5b8cf0); cursor: pointer; }
.admin-body .a-check-col { width: 44px; text-align: center; }

/* ----- Gym picker grid (bulk index) -------------------------------------- */
.admin-body .a-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.admin-body .a-pick-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.admin-body .a-pick-card:hover { border-color: var(--a-accent, #5b8cf0); transform: translateY(-2px); }
.admin-body .a-pick-card h3 { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }

/* ----- Notification logs filter toolbar ---------------------------------- */
.admin-body .a-logs-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px;
}
.admin-body .a-logs-toolbar select {
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-hi, var(--line)); background: var(--glass-2, var(--glass)); color: var(--text);
}
.admin-body .a-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-body .a-filter-chip {
  padding: 7px 14px; border-radius: var(--pill); cursor: pointer;
  border: 1px solid var(--line-hi, var(--line)); background: var(--glass-2, var(--glass));
  color: var(--soft); font-size: 12.5px; font-weight: 700;
}
.admin-body .a-filter-chip.is-active {
  background: var(--a-accent-grad, linear-gradient(135deg, #5b8cf0, #56e0f2));
  border-color: transparent; color: var(--a-on-accent, #05101f);
}
.admin-body .a-filter-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--a-accent-soft, rgba(91, 140, 240, 0.16)); }

/* ----- Unreachable QR cards (dark, platform identity) -------------------- */
.admin-body .a-qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 16px; }
.admin-body .a-qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-body .a-qr-box { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.admin-body .a-qr-card__name { color: #fff; font-weight: 800; margin-top: 4px; }
.admin-body .a-qr-card__code { font-size: 12px; color: var(--faint, var(--muted)); }
.admin-body .a-qr-card__contact { font-size: 12px; color: var(--muted); word-break: break-word; }
.admin-body .a-qr-card__link { color: var(--a-accent-light, #56e0f2); font-weight: 700; text-decoration: none; font-size: 13px; }
.admin-body .a-qr-card__link:hover { text-decoration: underline; }

/* ----- Sheet-link copy control ------------------------------------------- */
.admin-body .a-copy-btn { padding: 7px 12px; font-size: 12.5px; }
.admin-body .a-copy-btn.is-copied { color: var(--green); border-color: rgba(88, 214, 141, 0.4); }

/* ----- Responsive: bulk table collapses to cards < 640px ----------------- */
@media (max-width: 640px) {
  .admin-body .a-bulk-bar { position: static; }
}

/* ====================================================================== *
   A-7 — CROSS-SCREEN A11Y + RESPONSIVE PASS  (Req 26.1, 26.3)
   Consistent focus-visible, scoped legacy-table behaviour, and the shared
   chart visually-hidden data-table utility. Additive + scoped to .admin-body.
   ====================================================================== */

/* Visible keyboard focus for every interactive admin control. */
.admin-body a:focus-visible,
.admin-body button:focus-visible,
.admin-body input:focus-visible,
.admin-body select:focus-visible,
.admin-body textarea:focus-visible,
.admin-body [tabindex]:focus-visible {
  outline: 2px solid var(--a-accent, #5b8cf0);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Shared chart a11y data-table: present for screen readers, off-canvas
   visually (Chart_Engine injects table.at-chart__a11y). */
.admin-body .at-chart__a11y,
.admin-body .ds-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Inline chart state messaging (load/render error) stays readable. */
.admin-body .at-error { color: var(--muted); font-size: 13px; text-align: center; }

/* Legacy admin tables: keep horizontal scroll on narrow viewports rather than
   overflowing the shell (admin-table-wrap already scrolls; reinforce here). */
@media (max-width: 640px) {
  .admin-body .admin-table { min-width: 560px; }
}
