/* ==========================================================================
   Driven Garage — Member Portal styles

   Built on the exact design tokens from the marketing site's <style> block, so
   the portal reads as part of the same site rather than a bolted-on admin tool.
   The only additions are radii and shadows, which the one-page marketing site
   never needed.

   Structure:
     1. Tokens + reset
     2. Top bar
     3. Layout shell
     4. Cards, stats, badges
     5. Buttons + forms
     6. Membership card
     7. Tables
     8. Tabs, toasts, loading states
     9. Verification page
    10. Wash credits + check-in board
    11. Responsive
   ========================================================================== */

/* -- 1. Tokens + reset --------------------------------------------------- */
:root {
  --black: #0a0a0a;
  --dark: #111111;
  --dark2: #181818;
  --dark3: #222222;
  --white: #f2efe8;
  --white2: #c8c4bb;
  --accent: #e8380d;
  --accent2: #ff5733;
  --yellow: #f5c518;
  --border: rgba(242, 239, 232, 0.08);
  --border2: rgba(242, 239, 232, 0.15);

  /* Portal-only additions */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --green: #2fbf5f;
  --green-dim: rgba(47, 191, 95, 0.12);
  --red: #e8380d;
  --red-dim: rgba(232, 56, 13, 0.12);
  --yellow-dim: rgba(245, 197, 24, 0.12);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The `hidden` attribute is only a UA-stylesheet `display: none`, so ANY author
   rule that sets `display` on the same element beats it and the element stays on
   screen. That is how an empty avatar circle used to sit on the verification page
   next to the real photo. One `!important` here means every `hidden` toggle in
   the portal, admin, and verify pages can be trusted; nothing in this app shows
   an element by overriding `display` while `hidden` is still set. */
[hidden] {
  display: none !important;
}

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

body {
  background: var(--black);
  color: var(--white);
  font-family: "Barlow", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  /* A subtle warm glow at the top so the dark background is not flat. */
  background-image: radial-gradient(
    900px 420px at 50% -12%,
    rgba(232, 56, 13, 0.12),
    transparent 70%
  );
  background-repeat: no-repeat;
}

a {
  color: var(--accent2);
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

/* Screen-reader-only text, for labels that would be redundant visually. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -- 2. Top bar ---------------------------------------------------------- */
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.portal-logo {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}
.portal-logo .logo-garage {
  color: var(--white);
}

.portal-topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.portal-topnav a {
  color: var(--white2);
  transition: color 0.2s;
}
.portal-topnav a:hover {
  color: var(--white);
}

.role-pill {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  color: var(--white2);
}
.role-pill.is-admin {
  color: var(--yellow);
  border-color: rgba(245, 197, 24, 0.4);
  background: var(--yellow-dim);
}

.topbar-email {
  font-size: 0.85rem;
  color: var(--white2);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -- 3. Layout shell ----------------------------------------------------- */
.portal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 96px;
}

.portal-eyebrow {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.portal-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.portal-title .accent {
  color: var(--accent);
}

.portal-sub {
  color: var(--white2);
  margin-top: 12px;
  max-width: 60ch;
  line-height: 1.6;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 46px 0 18px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-head p {
  color: var(--white2);
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* -- 4. Cards, stats, badges -------------------------------------------- */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: linear-gradient(180deg, var(--dark2), var(--dark));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.card + .card {
  margin-top: 22px;
}
.card h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card .card-hint {
  color: var(--white2);
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-tile {
  background: linear-gradient(180deg, var(--dark2), var(--dark));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.25s, transform 0.25s;
}
.stat-tile:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.7;
}
.stat-tile .stat-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white2);
}
.stat-tile .stat-value {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 2.6rem;
  line-height: 1;
  margin-top: 8px;
}
.stat-tile.tone-active::before {
  background: var(--green);
}
.stat-tile.tone-warn::before {
  background: var(--yellow);
}
.stat-tile.tone-danger::before {
  background: var(--red);
}

/* Summary rows on the member dashboard */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}
.summary-item .summary-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white2);
  margin-bottom: 6px;
}
.summary-item .summary-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.summary-item .summary-value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.status-active {
  color: var(--green);
  background: var(--green-dim);
  border-color: rgba(47, 191, 95, 0.35);
}
.badge.status-pending {
  color: var(--yellow);
  background: var(--yellow-dim);
  border-color: rgba(245, 197, 24, 0.35);
}
.badge.status-suspended {
  color: var(--accent2);
  background: var(--red-dim);
  border-color: rgba(232, 56, 13, 0.4);
}
.badge.status-inactive {
  color: var(--white2);
  background: rgba(242, 239, 232, 0.06);
}

.notice {
  border: 1px solid var(--border2);
  border-left: 3px solid var(--yellow);
  background: rgba(245, 197, 24, 0.07);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--white2);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 22px;
}
.notice strong {
  color: var(--white);
}
.notice.is-error {
  border-left-color: var(--accent);
  background: var(--red-dim);
}

/* -- 5. Buttons + forms ------------------------------------------------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button,
.btn {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:active,
.btn:active {
  transform: translateY(1px);
}
button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent2);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border2);
  color: var(--white);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--white2);
  background: rgba(242, 239, 232, 0.05);
}
/* Keep an anchor styled as a button from picking up the global link hover
   colour. */
a.btn-secondary:hover {
  color: var(--white);
}

.btn-danger {
  background: transparent;
  border-color: rgba(232, 56, 13, 0.5);
  color: var(--accent2);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-dim);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--white2);
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--white);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.field {
  display: block;
  margin-bottom: 18px;
}
.field > span,
.field-label {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white2);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: "Barlow", sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--white2);
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: var(--white2);
  background: rgba(242, 239, 232, 0.03);
  border-color: var(--border);
  cursor: not-allowed;
}
.field .field-note {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--white2);
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 18px;
}

/* Checkbox rows read better inline than stacked */
.field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.field-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.field-check span {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white2);
}

.form-error {
  color: var(--accent2);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-bottom: 14px;
}

.readonly-hint {
  font-size: 0.8rem;
  color: var(--white2);
  border-left: 2px solid var(--border2);
  padding-left: 10px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* -- 6. Membership card ------------------------------------------------- */
.membership-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  background: linear-gradient(135deg, #1c1c1c 0%, #0e0e0e 55%, #141414 100%);
  padding: 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}
/* Warm accent bloom + faint grid, echoing the hero treatment on the main site */
.membership-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 160%;
  background: radial-gradient(circle, rgba(232, 56, 13, 0.28), transparent 65%);
  pointer-events: none;
}
.membership-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(242, 239, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 239, 232, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.membership-card > * {
  position: relative;
  z-index: 1;
}

.mc-brand {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  line-height: 1;
}
.mc-brand span {
  color: var(--white);
}
.mc-kicker {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white2);
  margin-top: 6px;
}
.mc-name {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  line-height: 1;
  margin-top: 22px;
  word-break: break-word;
}
.mc-tier {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-top: 6px;
}
.mc-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.mc-meta-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white2);
}
.mc-meta-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.mc-qr {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  line-height: 0;
  align-self: start;
}
.mc-qr canvas,
.mc-qr img {
  display: block;
  width: 132px;
  height: 132px;
}
/* Shown in place of the code if /api/qr is unreachable. Dark text, because the
   QR plate it sits on is white. */
.mc-qr-fallback {
  display: flex;
  align-items: center;
  text-align: center;
  width: 132px;
  height: 132px;
  padding: 0 8px;
  box-sizing: border-box;
  color: #0a0a0a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}
.mc-qr-caption {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white2);
  text-align: center;
  margin-top: 8px;
  line-height: 1.3;
}

/* -- Photo upload ------------------------------------------------------- */
.photo-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.photo-frame {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--dark3);
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 2rem;
  color: var(--white2);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
input[type="file"] {
  font-family: "Barlow", sans-serif;
  font-size: 0.88rem;
  color: var(--white2);
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-right: 12px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--white2);
}

/* -- 7. Tables ---------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--dark2), var(--dark));
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.data-table th {
  text-align: left;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white2);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
}
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table th.sortable:hover {
  color: var(--white);
}
.data-table th .sort-arrow {
  color: var(--accent);
  margin-left: 5px;
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: rgba(242, 239, 232, 0.03);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table .cell-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.data-table .cell-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--white2);
}
/* Second line inside a cell — a time under a date, a duration, a reason. */
.data-table .cell-sub {
  color: var(--white2);
  font-size: 0.82rem;
  line-height: 1.4;
}
.data-table .cell-actions {
  white-space: nowrap;
  text-align: right;
}
.data-table .cell-actions button {
  margin-left: 6px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
}
.toolbar .field {
  margin-bottom: 0;
}
.toolbar .field.grow {
  flex: 1 1 240px;
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--white2);
}
.empty-state strong {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 8px;
}

/* -- 8. Tabs, toasts, loading ------------------------------------------ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--white2);
  padding: 12px 18px;
  white-space: nowrap;
}
.tabs button:hover {
  color: var(--white);
}
.tabs button[aria-selected="true"] {
  color: var(--white);
  border-bottom-color: var(--accent);
}

.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast {
  background: var(--dark3);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 13px 18px;
  font-size: 0.92rem;
  animation: toastIn 0.25s ease both;
  width: 100%;
}
.toast.is-error {
  border-left-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white2);
  padding: 32px 0;
  justify-content: center;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(242, 239, 232, 0.05) 25%,
    rgba(242, 239, 232, 0.11) 37%,
    rgba(242, 239, 232, 0.05) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  height: 14px;
  margin-bottom: 10px;
}

/* Modal-ish drawer used for the admin member detail view */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: none;
}
.drawer-backdrop[data-open="true"] {
  display: block;
}
@keyframes drawerIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.drawer {
  position: relative;
  max-width: 900px;
  margin: 4vh auto;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--dark);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
  animation: drawerIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
}
.drawer-head h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: 1.9rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
}
.drawer-head .drawer-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--white2);
  margin-top: 6px;
}
.drawer-close {
  background: none;
  border: 1px solid var(--border2);
  color: var(--white2);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  font-size: 1.1rem;
}
.drawer-close:hover {
  color: var(--white);
  border-color: var(--white2);
}

.history-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.history-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.history-list li:last-child {
  border-bottom: none;
}
.history-list .history-agent {
  color: var(--white2);
  font-size: 0.8rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* -- 9. Verification page ---------------------------------------------- */
.verify-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.verify-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  object-fit: cover;
  display: block;
  margin: 0 auto 20px;
  background: var(--dark3);
}
.verify-name {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: clamp(2rem, 8vw, 2.9rem);
  line-height: 1;
  text-align: center;
}
.verify-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--white2);
  text-align: center;
  margin-top: 8px;
}
.verify-access {
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin: 26px 0;
  border: 1px solid;
}
.verify-access .verify-verdict {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
}
.verify-access .verify-detail {
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.verify-access.green {
  background: var(--green-dim);
  border-color: rgba(47, 191, 95, 0.45);
  color: var(--green);
}
.verify-access.red {
  background: var(--red-dim);
  border-color: rgba(232, 56, 13, 0.5);
  color: var(--accent2);
}
.verify-access.yellow {
  background: var(--yellow-dim);
  border-color: rgba(245, 197, 24, 0.45);
  color: var(--yellow);
}
.verify-access .verify-detail {
  color: var(--white2);
}

.check-list {
  list-style: none;
}
.check-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.check-list li:last-child {
  border-bottom: none;
}
.check-list .check-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white2);
}
.check-yes {
  color: var(--green);
  font-weight: 600;
}
.check-no {
  color: var(--accent2);
  font-weight: 600;
}

/* -- 9b. Integration status cards (admin) ------------------------------- */

/**
 * The Member Email card on the admin dashboard. It is a diagnostic surface: a
 * state pill, a list of findings, and collapsible setup steps. The findings list
 * reuses `.check-list`, so these rules mostly undo its two-column layout — a
 * diagnostic is one long sentence, not a label/value pair.
 */
.int-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 1px;
  margin-right: 6px;
}
.int-status.is-ok {
  color: var(--green);
  background: var(--green-dim);
}
.int-status.is-off {
  color: var(--yellow);
  background: var(--yellow-dim);
}

.check-list li.level-ok,
.check-list li.level-warn,
.check-list li.level-error {
  display: block;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--white2);
  /* Coloured rule down the left, so severity reads without needing an icon. */
  border-left: 3px solid var(--border2);
  padding: 10px 0 10px 12px;
  overflow-wrap: anywhere;
}
.check-list li.level-ok {
  border-left-color: var(--green);
}
.check-list li.level-warn {
  border-left-color: var(--yellow);
}
.check-list li.level-error {
  border-left-color: var(--accent2);
}

/* Setup instructions. Kept collapsed once the integration is live. */
.card > details {
  margin-top: 14px;
  font-size: 0.88rem;
}
.card > details > summary {
  cursor: pointer;
  color: var(--accent2);
  font-weight: 600;
  padding: 4px 0;
}
.help-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--white2);
  line-height: 1.65;
}
.help-steps li {
  margin-bottom: 9px;
}
.help-steps code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82em;
  background: var(--dark3);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
.help-steps strong {
  color: var(--white);
}

/* Sub-headings inside the member drawer's Activity tab. */
.history-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white2);
  margin: 20px 0 8px;
}
.history-heading:first-child {
  margin-top: 0;
}

/* -- 10. Wash credits + check-in board ---------------------------------- */
/* Tone badges for states that aren't membership statuses: an open check-in,
   a closed one, a voided one. Same pill as `.badge.status-*`, different words. */
.badge.tone-ok {
  color: var(--green);
  background: var(--green-dim);
  border-color: rgba(47, 191, 95, 0.35);
}
.badge.tone-idle {
  color: var(--white2);
  background: rgba(242, 239, 232, 0.06);
}
.badge.tone-busy {
  color: var(--yellow);
  background: var(--yellow-dim);
  border-color: rgba(245, 197, 24, 0.35);
}
.badge.tone-void {
  color: var(--accent2);
  background: var(--red-dim);
  border-color: rgba(232, 56, 13, 0.4);
}

/* The credit balance, shown the same way everywhere it appears: the "3/4"
   figure plus one pip per credit in the package so it reads at a glance. */
.credit-meter {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.credit-value {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 2.2rem;
  line-height: 1;
}
.credit-value.is-empty {
  color: var(--accent2);
}
.credit-pips {
  display: flex;
  gap: 6px;
}
.credit-pip {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(242, 239, 232, 0.05);
}
.credit-pip.is-filled {
  background: var(--accent);
  border-color: var(--accent);
}
.credit-note {
  color: var(--white2);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Four access points, one tile each, so staff can see occupancy without
   reading the table underneath it. */
.bay-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.bay-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--dark2), var(--dark));
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.bay-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
  opacity: 0.7;
}
.bay-tile.is-busy::before {
  background: var(--yellow);
}
.bay-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white2);
}
.bay-state {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 1.5rem;
  line-height: 1.1;
  margin-top: 6px;
}
.bay-occupant {
  color: var(--white2);
  font-size: 0.82rem;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Access-type picker. Buttons rather than radios so the tap target is the whole
   tile on a phone, with aria-pressed carrying the state for screen readers. */
.access-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.access-option {
  appearance: none;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--dark3);
  color: var(--white);
  padding: 14px 16px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.access-option:hover:not(:disabled) {
  border-color: var(--white2);
  transform: translateY(-1px);
}
.access-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--red-dim);
  color: var(--white);
}
.access-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.access-option .access-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--white2);
  margin-top: 5px;
}

/* Camera stage. Kept 4:3 and capped so it never pushes the controls off a
   phone screen; hidden entirely when the device has no usable scanner. */
.scan-stage {
  position: relative;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  margin-bottom: 16px;
}
.scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-reticle {
  position: absolute;
  inset: 14%;
  border: 2px solid rgba(232, 56, 13, 0.75);
  border-radius: var(--radius);
  pointer-events: none;
}
.scan-hint {
  color: var(--white2);
  font-size: 0.85rem;
  line-height: 1.55;
}

/* The scanned member, above the access picker. */
.scan-member {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.scan-member .photo-frame {
  width: 64px;
  height: 64px;
}
.scan-member-name {
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}
.scan-member-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--white2);
  margin-top: 4px;
}

/* -- 11. Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-shell {
    padding: 32px 20px 80px;
  }
}

@media (max-width: 760px) {
  .portal-topbar {
    padding: 12px 18px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .portal-topnav {
    gap: 14px;
    font-size: 0.85rem;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .topbar-email {
    display: none;
  }
  .membership-card {
    /* QR moves under the details so the name never gets squeezed on a phone */
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 24px 20px;
  }
  .membership-card .mc-meta {
    text-align: left;
    width: 100%;
  }
  .mc-qr canvas,
  .mc-qr img {
    width: 156px;
    height: 156px;
  }
  .card {
    padding: 20px;
  }
  .drawer {
    margin: 0;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 22px 18px 60px;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  /* One access point per row: a mis-tap here books the wrong bay. */
  .access-picker,
  .bay-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .credit-value {
    font-size: 1.9rem;
  }
  .toolbar .field {
    flex: 1 1 100%;
  }
  .btn-row button,
  .btn-row .btn {
    width: 100%;
  }
  .stat-tile .stat-value {
    font-size: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
