/* ============================================================
   GRATITUDE 4.0 — Admin Dashboard Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary:        #1B1040;
  --primary-dark:   #0F0926;
  --primary-light:  #2D1F6E;
  --gold:           #C8922A;
  --gold-light:     #E8B84B;
  --gold-dark:      #A8771E;
  --sidebar-w:      260px;
  --header-h:       60px;
  --ivory:          #F7F5F0;
  --surface:        #FFFFFF;
  --surface-2:      #F0EDE8;
  --text:           #1A1625;
  --text-secondary: #3D3558;
  --text-muted:     #7A7490;
  --border:         #E0DBD5;
  --border-light:   #EAE6E0;
  --error:          #C0392B;
  --error-bg:       #FDECEA;
  --success:        #1A6B3C;
  --success-bg:     #E8F5EE;
  --warning:        #B7791F;
  --warning-bg:     #FEF3CD;
  --info:           #1a5276;
  --info-bg:        #D6EAF8;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,.09);
  --transition: 0.2s ease;
  --font-body:  'Outfit', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; display: block; }

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  transition: transform var(--transition);
}

.sidebar__brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar__brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar__brand-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar__brand-sub {
  display: block;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-top: 1px;
}

.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar__section-label {
  padding: 0.35rem 1.5rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-top: 0.75rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar__link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: rgba(201,168,76,.4);
}

.sidebar__link.active {
  background: rgba(201,168,76,.12);
  color: var(--gold-light);
  border-left-color: var(--gold);
  font-weight: 600;
}

.sidebar__link.active svg { opacity: 1; }

.sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.78rem;
  color: rgba(255,255,255,.35);
}

.sidebar__admin-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  margin-bottom: 0.25rem;
}

.sidebar__admin-role {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,.45);
  transition: color var(--transition);
}
.sidebar__logout:hover { color: #fff; }

/* ── Main Content ─────────────────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-inline: 1.75rem;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-topbar__hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
}

.admin-topbar__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  flex: 1;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-content {
  padding: 1.75rem;
  flex: 1;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-header__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.page-header__sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card--navy::before   { background: var(--primary); }
.stat-card--gold::before   { background: var(--gold); }
.stat-card--green::before  { background: #1A6B3C; }
.stat-card--red::before    { background: #C0392B; }
.stat-card--blue::before   { background: #1a5276; }
.stat-card--orange::before { background: #B7791F; }

.stat-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-card__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-card__icon {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  opacity: 0.07;
  color: var(--primary);
}

/* ── Charts Grid ──────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
}

.chart-card--full { grid-column: 1 / -1; }

.chart-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-canvas-wrap {
  position: relative;
  height: 220px;
}

/* ── Admin Tables ─────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.table-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover { background: rgba(11,31,58,.025); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 99px;
}

.badge--green  { background: var(--success-bg); color: var(--success); }
.badge--red    { background: var(--error-bg);   color: var(--error);   }
.badge--gold   { background: rgba(201,168,76,.15); color: var(--gold-dark); }
.badge--blue   { background: var(--info-bg);    color: var(--info);    }
.badge--grey   { background: var(--surface-2);  color: var(--text-muted); }
.badge--orange { background: var(--warning-bg); color: var(--warning); }

/* ── Filters Row ──────────────────────────────────────────── */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-control {
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 150px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%234A4A6A' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  transition: border-color var(--transition);
}

.filter-control:focus {
  outline: none;
  border-color: var(--primary);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Admin Buttons ────────────────────────────────────────── */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn-admin:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.btn-admin--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-admin--primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #fff;
}

.btn-admin--gold {
  background: var(--gold);
  color: var(--primary-dark);
  border-color: var(--gold);
}
.btn-admin--gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--primary-dark);
}

.btn-admin--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}
.btn-admin--outline:hover {
  background: var(--surface-2);
  border-color: var(--primary);
}

.btn-admin--danger {
  background: transparent;
  color: var(--error);
  border-color: rgba(192,57,43,.3);
}
.btn-admin--danger:hover {
  background: var(--error-bg);
  border-color: var(--error);
}

.btn-admin--success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-admin--success:hover {
  background: #145b31;
  color: #fff;
}

.btn-admin--sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.btn-admin--lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8125rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.pagination__links {
  display: flex;
  gap: 0.3rem;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
  text-decoration: none;
}

.pagination__link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination__link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination__link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Detail View ──────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.detail-section--full { grid-column: 1 / -1; }

.detail-section__header {
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.03em;
}

.detail-row {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }

.detail-row__label {
  width: 140px;
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,.015);
}

.detail-row__value {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}

/* ── Check-in Interface ───────────────────────────────────── */
.checkin-search-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.checkin-result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
  max-width: 600px;
  margin-inline: auto;
  transition: border-color var(--transition);
}

.checkin-result-card.is-checked-in {
  border-color: var(--success);
}

.checkin-result-header {
  padding: 1.5rem;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.checkin-result-code {
  font-family: monospace;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.checkin-result-body {
  padding: 1.5rem;
}

.checkin-result-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

/* ── Admin Login ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-inline: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.login-logo-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.login-logo-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form .form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.login-form .form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.login-form .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,31,58,.1);
}

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.alert--error   { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(192,57,43,.2); }
.alert--success { background: var(--success-bg);  color: var(--success); border: 1px solid rgba(26,107,60,.2); }
.alert--warning { background: var(--warning-bg);  color: var(--warning); border: 1px solid rgba(183,121,31,.2); }
.alert--info    { background: var(--info-bg);     color: var(--info);    border: 1px solid rgba(26,82,118,.2); }

/* ── Pickup Location Cards ────────────────────────────────── */
.location-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--transition);
}

.location-card:hover { box-shadow: var(--shadow-md); }

.location-card--inactive {
  opacity: 0.6;
}

.location-card__count {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  min-width: 48px;
  text-align: center;
}

.location-card__info { flex: 1; }

.location-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}

.location-card__desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.location-card__bar {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 99px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.location-card__bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}
.modal__close:hover { color: var(--text); }

.modal__body { padding: 1.5rem; }
.modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  margin-inline: auto;
  margin-bottom: 1rem;
  opacity: 0.35;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

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

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar__hamburger {
    display: block;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-content { padding: 1.25rem; }

  .filters-row { flex-direction: column; }

  .search-input-wrap { min-width: 0; width: 100%; }
  .filter-control { min-width: 0; width: 100%; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PAGE HEADER — MOBILE
   ============================================================ */
@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }

  .page-header > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }

  .page-header > div:last-child .btn-admin {
    flex: 1;
    justify-content: center;
    font-size: .8rem;
  }
}

/* ============================================================
   FILTERS ROW — MOBILE LAYOUT
   ============================================================ */
@media (max-width: 768px) {

  .filters-row {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    gap: .65rem;
  }

  /* Search bar spans full width */
  .filters-row .search-input-wrap {
    width: 100%;
    min-width: 0;
    order: -1; /* always first */
  }

  .filters-row .search-input {
    height: 40px;
    font-size: .875rem;
  }

  /* Two filters side-by-side in a grid */
  .filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  /* Search takes full row */
  .filters-row .search-input-wrap {
    grid-column: 1 / -1;
  }

  /* Filter groups fill their grid cell */
  .filter-group {
    width: 100%;
  }

  .filter-group label {
    font-size: .68rem;
  }

  .filter-control {
    width: 100%;
    min-width: 0;
    height: 38px;
    font-size: .8125rem;
    padding: .4rem .75rem;
    padding-right: 1.75rem;
    background-size: 8px;
  }

  /* Filter + Clear buttons span full row */
  .filters-row > div:last-child {
    grid-column: 1 / -1;
    display: flex;
    gap: .5rem;
  }

  .filters-row > div:last-child .btn-admin {
    flex: 1;
    justify-content: center;
    height: 38px;
  }
}

/* ============================================================
   REGISTRATIONS TABLE — MOBILE CARD LAYOUT
   At ≤640px the table rows flip into stacked cards.
   Each <td> shows its column heading via data-label.
   ============================================================ */
@media (max-width: 640px) {

  /* Hide the header row — labels come from data-label instead */
  .admin-table thead {
    display: none;
  }

  /* Each row becomes a card */
  .admin-table tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .admin-table tbody tr:hover {
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  /* Each cell becomes a labelled row inside the card */
  .admin-table tbody td {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: .875rem;
  }

  .admin-table tbody td:last-child {
    border-bottom: none;
  }

  /* The data-label acts as the left-hand column heading */
  .admin-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 100px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 2px;
  }

  /* Registration ID cell — make code pop */
  .admin-table tbody td:first-child {
    background: var(--primary);
    padding: .75rem 1rem;
  }

  .admin-table tbody td:first-child::before {
    color: rgba(255,255,255,.5);
  }

  .admin-table tbody td:first-child span {
    color: var(--gold-light) !important;
    font-size: .9rem !important;
  }

  /* Actions cell — full-width button */
  .admin-table tbody td:last-child {
    padding: .75rem 1rem;
    background: var(--surface-2);
  }

  .admin-table tbody td:last-child .btn-admin {
    width: 100%;
    justify-content: center;
    padding: .6rem 1rem;
    font-size: .875rem;
  }

  /* Checkin page table — same treatment */
  .table-wrap {
    overflow-x: visible;
  }
}