:root {
  --burgundy: #722f37;
  --gold: #c9a84c;
  --paper: #fbf8f3;
  --ink: #2b2b2b;
  --line: rgba(201,168,76,.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Lato, Arial, sans-serif;
}

a { color: inherit; }
.admin-shell { min-height: 100vh; }
.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 54px);
  background: var(--burgundy);
  color: #fff;
}

.admin-brand {
  display: grid;
  gap: 4px;
}

.admin-brand span, .kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.admin-brand strong {
  font: 600 34px "Cormorant Garamond", Georgia, serif;
}

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-main { padding: clamp(22px, 4vw, 54px); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(43,43,43,.08);
  padding: clamp(22px, 3vw, 34px);
}

.login-panel {
  max-width: 460px;
  margin: 10vh auto;
}

h1, h2 {
  margin: 0 0 18px;
  color: var(--burgundy);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
}

h1 { font-size: clamp(38px, 5vw, 56px); }
h2 { font-size: 32px; }
p { line-height: 1.7; }

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(114,47,55,.18);
  border-radius: 4px;
  padding: 13px 14px;
  background: var(--paper);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gold);
  color: #23140a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-light { background: #fff; color: var(--burgundy); }
.btn-danger { background: #722f37; color: #fff; border-color: #722f37; }
.btn-muted { background: #f5efe7; color: var(--ink); border-color: rgba(114,47,55,.15); }
.admin-actions .btn:hover { transform: translateY(-1px); }
.note { color: var(--burgundy); font-weight: 700; }
.error { color: #9d1f2c; font-weight: 800; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  color: var(--burgundy);
  font: 900 42px Lato, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table { width: 100%; border-collapse: collapse; min-width: 1120px; }
th, td {
  padding: 14px;
  border-bottom: 1px solid rgba(201,168,76,.22);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--burgundy);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f5efe7;
  color: var(--burgundy);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge.confirmed, .badge.checked_in { background: #edf6eb; color: #2f6f3d; }
.badge.contacted { background: #edf6eb; color: #2f6f3d; }
.badge.pending { background: #fff6dd; color: #8a6200; }
.badge.declined { background: #f8e7e9; color: #9d1f2c; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.notice {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(201,168,76,.35);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--burgundy);
  font-weight: 700;
}

.pass-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
  justify-items: center;
  background:
    radial-gradient(circle at 12% 14%, rgba(201,168,76,.18), transparent 28%),
    linear-gradient(135deg, #fbf8f3, #f5efe7);
}

.pass-card {
  width: min(430px, calc(100vw - 24px));
  max-width: 430px;
  margin: 18px auto;
  overflow: hidden;
}

.modern-pass {
  padding: 0;
}

.pass-photo {
  min-height: 270px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #211814;
}

.pass-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 38%;
}

.pass-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20,14,12,.9) 0%, rgba(20,14,12,.62) 42%, rgba(20,14,12,.16) 100%),
    linear-gradient(0deg, rgba(20,14,12,.72), rgba(20,14,12,.08) 58%);
}

.pass-photo div {
  position: relative;
  z-index: 1;
  max-width: 78%;
  padding: 26px 24px;
  display: grid;
  gap: 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,.5);
}

.pass-photo span,
.pass-qr span {
  color: #e8c86f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.pass-photo strong {
  color: #fff;
  font: 600 clamp(40px, 8vw, 52px) "Cormorant Garamond", Georgia, serif;
  line-height: .9;
}

.pass-photo small {
  color: rgba(255,255,255,.96);
  font-size: 14px;
  letter-spacing: .08em;
  line-height: 1.35;
}

.pass-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  align-items: center;
}

.pass-details h1 {
  margin-bottom: 10px;
}

.pass-details dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0 0;
}

.pass-details dl div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.pass-details dt {
  margin-bottom: 7px;
  color: var(--burgundy);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pass-details dd {
  margin: 0;
  font-weight: 900;
}

.pass-qr {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(43,43,43,.08);
}

.qr-img {
  width: min(205px, 100%);
  border: 8px solid #fff;
  box-shadow: 0 12px 38px rgba(43,43,43,.12);
}

.pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 24px 24px;
}

.pass-photo-lookup {
  min-height: 230px;
}

.pass-lookup-content {
  grid-template-columns: 1fr;
}

.pass-lookup-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(43,43,43,.08);
}

.pass-lookup-form .btn {
  width: 100%;
  margin-top: 4px;
}

.pass-lookup-form .btn + .btn {
  margin-top: 10px;
}

.panel + .panel {
  margin-top: 24px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px;
}

.form-action-cell {
  display: flex;
  align-items: end;
  padding-bottom: 16px;
}

.form-action-cell .btn {
  width: 100%;
}

.scan-result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-header, .toolbar { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid { grid-template-columns: 1fr; }
  .pass-content, .pass-lookup-content, .pass-details dl { grid-template-columns: 1fr; }
  .pass-photo { min-height: 260px; }
  .pass-photo img { object-position: 55% 38%; }
  .pass-photo div { max-width: 86%; }
  .pass-actions .btn { width: 100%; }
}

@media print {
  body { background: #fff; }
  .admin-main { padding: 0; }
  .pass-card { width: 100%; max-width: 430px; margin: 0 auto; box-shadow: none; border: 0; }
  .pass-actions, .pass-card > p:last-child { display: none; }
}
