/* v2 */
/* Admin has its own visual language: same tokens, but slightly lighter
   panel surfaces and tighter spacing than the guest app — data-dense,
   organiser tooling rather than a guest experience. */

#screen-admin {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night-2);
}

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-6);
  transform: translateX(-50%);
  background: var(--panel-solid);
  border: 1px solid var(--gold-soft);
  color: var(--cream);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-3);
  z-index: 9999;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out);
}

/* ---------- Topbar ---------- */

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}

.admin-topbar__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--cream);
}

.admin-exit-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--cream-dim);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

.admin-exit-btn:hover {
  color: var(--cream);
  border-color: var(--gold-soft);
}

/* ---------- Section nav (tab strip mobile / sidebar desktop) ---------- */

.admin-nav {
  display: flex;
  overflow-x: auto;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}

.admin-nav__item {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--cream-dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
  white-space: nowrap;
}

.admin-nav__item--active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.admin-content {
  flex: 1;
  padding: var(--s-5);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.admin-content .dashboard-section {
  background: var(--panel-hover);
  margin-bottom: var(--s-5);
}

@media (min-width: 768px) {
  #screen-admin {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
  }

  .admin-topbar {
    grid-column: 1 / -1;
  }

  .admin-nav {
    flex-direction: column;
    overflow-x: visible;
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: var(--s-3) 0;
  }

  .admin-nav__item {
    text-align: left;
    border-bottom: none;
    border-left: 2px solid transparent;
  }

  .admin-nav__item--active {
    border-left-color: var(--gold);
    background: var(--gold-faint);
  }

  .admin-content {
    max-width: 760px;
    margin: 0;
  }
}

/* ---------- Overview stats ---------- */

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.admin-stat-card {
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  text-align: center;
}

.admin-stat-card__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s-1);
}

.admin-stat-card__label {
  font-size: 12px;
  color: var(--cream-dim);
}

/* ---------- Shared form controls ---------- */

.admin-field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-faint);
  margin: var(--s-4) 0 var(--s-2);
}

.admin-input {
  width: 100%;
  background: var(--night-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
}

.admin-input:focus {
  outline: none;
  border-color: var(--gold-soft);
}

/* ---------- Award Miles ---------- */

.admin-guest-picker {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-top: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-2);
}

.admin-guest-option {
  text-align: left;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 13px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.admin-guest-option span {
  color: var(--cream-faint);
}

.admin-guest-option:hover {
  background: var(--panel-hover);
}

.admin-guest-option--selected {
  background: var(--gold-faint);
  color: var(--gold);
}

.admin-award-selected {
  margin: var(--s-3) 0 0;
  font-size: 13px;
  color: var(--cream-dim);
}

.admin-award-selected strong {
  color: var(--gold);
}

.admin-amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.admin-amount-chip {
  border: 1px solid var(--line-strong);
  background: var(--night-3);
  color: var(--cream);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-amount-chip--selected {
  background: var(--gold);
  color: var(--night);
  border-color: var(--gold);
}

.admin-submit-btn {
  width: 100%;
  margin-top: var(--s-5);
  border: none;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: var(--night);
  font-weight: 700;
  font-size: 14px;
  padding: var(--s-3);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out);
}

.admin-submit-btn:hover {
  transform: translateY(-2px);
}

/* ---------- Guests table ---------- */

.admin-tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-3) 0 var(--s-4);
}

.admin-tier-chip {
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--cream-dim);
  border-radius: var(--r-pill);
  padding: var(--s-1) var(--s-3);
  font-size: 12px;
  cursor: pointer;
}

.admin-tier-chip--active {
  background: var(--gold-faint);
  border-color: var(--gold-soft);
  color: var(--gold);
}

.guest-table {
  display: flex;
  flex-direction: column;
}

.guest-row {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: var(--s-1) 0;
}

.guest-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.guest-row:hover {
  background: var(--panel-hover);
}

.guest-row__summary {
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto auto;
  align-items: center;
  gap: var(--s-3);
  background: none;
  border: none;
  padding: var(--s-3) var(--s-2);
  cursor: pointer;
  text-align: left;
}

.guest-row__name {
  color: var(--cream);
  font-weight: 600;
  font-size: 13px;
}

.guest-row__family,
.guest-row__room {
  color: var(--cream-dim);
  font-size: 12px;
}

.guest-row__balance {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.checkin-toggle {
  display: inline-block;
  margin: 0 0 var(--s-2) var(--s-2);
  font-size: 11px;
  font-weight: 600;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--panel-hover);
  color: var(--cream-faint);
  cursor: pointer;
  border: 1px solid var(--line);
}

.checkin-toggle--on {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.guest-row--expanded {
  background: var(--panel-hover);
}

.guest-row__detail {
  padding: 0 var(--s-4) var(--s-4);
}

.guest-row__transactions {
  margin-bottom: var(--s-3);
}

.admin-shortcut-btn {
  border: 1px solid var(--gold-soft);
  background: var(--gold-faint);
  color: var(--gold);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 650px) {
  .guest-row__summary {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name balance"
      "family tier";
  }

  .guest-row__family {
    grid-area: family;
  }

  .guest-row__room {
    display: none;
  }
}

/* ---------- Redemptions ---------- */

.redemption-list {
  display: flex;
  flex-direction: column;
}

.redemption-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-1);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.redemption-row:last-child {
  border-bottom: none;
}

.redemption-row__guest {
  font-weight: 600;
  color: var(--cream);
  font-size: 13px;
  flex: 1 1 140px;
}

.redemption-row__reward {
  color: var(--cream-dim);
  font-size: 13px;
  flex: 1 1 160px;
}

.redemption-row__cost {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.redemption-row__time {
  color: var(--cream-faint);
  font-size: 11px;
}

.fulfilled-toggle {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--cream-dim);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.fulfilled-toggle--on {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* ---------- PIN Gate ---------- */

.pin-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  background: var(--night);
}

.pin-gate__header {
  text-align: center;
  margin-bottom: var(--s-6);
}

.pin-gate__eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: var(--s-2);
}

.pin-gate__title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cream);
  margin: 0;
}

.pin-dots {
  display: flex;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: var(--r-pill);
  border: 2px solid var(--line-strong);
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

.pin-dot--filled {
  background: var(--gold);
  border-color: var(--gold);
}

.pin-dots--shake {
  animation: pin-shake 0.4s ease-in-out;
}

@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  width: 100%;
  max-width: 280px;
}

.pin-numpad__key {
  min-height: 64px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--cream);
  border-radius: var(--r-lg);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.pin-numpad__key:hover {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
}

.pin-numpad__key:active {
  transform: translateY(0);
}
