:root {
  --bg: #070707;
  --panel: rgba(18, 17, 14, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --gold: #d4af62;
  --gold-light: #f2d58b;
  --text: #f7f1e6;
  --muted: #b9ad99;
  --line: rgba(212, 175, 98, 0.26);
  --danger: #ff9a8f;
  --success: #b8e6b3;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(212, 175, 98, 0.13), transparent 34%),
    radial-gradient(circle at 75% 18%, rgba(242, 213, 139, 0.1), transparent 28%),
    var(--bg);
  font-family: Inter, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 32px;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 440px);
  gap: 28px;
  min-height: calc(100vh - 64px);
  align-items: stretch;
}

.brand-panel,
.login-panel,
.modal,
.member-view {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 560px;
  padding: clamp(32px, 7vw, 88px);
  position: relative;
  overflow: hidden;
}

.brand-logo {
  align-self: center;
  height: auto;
  margin: 0 auto auto;
  object-fit: contain;
  position: relative;
  width: clamp(280px, 54vw, 660px);
  z-index: 1;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(212, 175, 98, 0.18);
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(transparent, black 35%, black);
  pointer-events: none;
}

.kicker {
  color: var(--gold-light);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0;
}

h1 {
  font-size: clamp(3.6rem, 8vw, 7.6rem);
  line-height: 0.88;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
}

.intro {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
  margin: 28px 0 0;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.signal-row span {
  border: 1px solid var(--line);
  color: var(--gold-light);
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel {
  align-content: center;
  display: grid;
  padding: clamp(26px, 4vw, 44px);
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading p {
  color: var(--muted);
  margin: 0 0 8px;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(212, 175, 98, 0.28);
  background: rgba(0, 0, 0, 0.36);
  color: var(--text);
  min-height: 50px;
  padding: 0 14px;
  outline: none;
}

textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 98, 0.16);
}

.primary-button,
.secondary-button,
.icon-button {
  cursor: pointer;
}

.primary-button,
.secondary-button {
  border: 1px solid var(--gold);
  min-height: 50px;
  padding: 0 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.primary-button {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #17120a;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.secondary-button {
  background: transparent;
  color: var(--gold-light);
}

.compact {
  min-height: 42px;
}

.form-message {
  min-height: 21px;
  color: var(--danger);
  margin: 2px 0 4px;
}

.form-message.success {
  color: var(--success);
}

.member-view {
  min-height: calc(100vh - 64px);
  padding: clamp(24px, 5vw, 58px);
}

.member-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.member-logo {
  display: block;
  height: 72px;
  margin-bottom: 18px;
  object-fit: contain;
  width: 72px;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.page-back {
  margin-top: 28px;
}

.level-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 28px;
  border: 1px solid rgba(212, 175, 98, 0.24);
  background: linear-gradient(135deg, rgba(212, 175, 98, 0.12), rgba(255, 255, 255, 0.035));
  margin-top: 28px;
  padding: 28px;
}

.level-label,
.tier-level,
.event-access {
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.level-copy {
  color: var(--muted);
  line-height: 1.6;
  margin: 14px 0 0;
  max-width: 720px;
}

.level-progress {
  align-self: center;
}

.level-progress-row {
  color: var(--gold-light);
  display: flex;
  font-size: 0.86rem;
  font-weight: 800;
  justify-content: space-between;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.progress-track {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(212, 175, 98, 0.24);
  height: 12px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  height: 100%;
  width: 0;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tier-card {
  border: 1px solid rgba(212, 175, 98, 0.2);
  background: rgba(255, 255, 255, 0.04);
  min-height: 170px;
  padding: 18px;
}

.tier-card.active {
  border-color: var(--gold);
  background: rgba(212, 175, 98, 0.12);
}

.tier-card.locked {
  opacity: 0.58;
}

.tier-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  line-height: 1;
  margin: 0 0 10px;
}

.tier-card p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
  margin: 0;
}

.tier-points {
  border-top: 1px solid rgba(212, 175, 98, 0.18);
  color: var(--gold-light);
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 16px;
  padding-top: 14px;
  text-transform: uppercase;
}

.section-heading {
  margin-top: 38px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.event-card {
  border: 1px solid rgba(212, 175, 98, 0.22);
  background: var(--panel-soft);
  min-height: 270px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.event-date {
  color: var(--gold-light);
  font-weight: 800;
  text-transform: uppercase;
}

.event-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  margin: 18px 0 12px;
}

.event-card-top,
.event-actions,
.detail-actions,
.category-filters,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-card-top {
  align-items: center;
  justify-content: space-between;
}

.event-category,
.pill-row span {
  border: 1px solid rgba(212, 175, 98, 0.22);
  color: var(--gold-light);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 10px;
  text-transform: uppercase;
}

.event-actions {
  margin-top: 18px;
}

.event-actions .primary-button,
.event-actions .secondary-button {
  flex: 1 1 150px;
  margin-top: 0;
}

.category-filters {
  margin-top: 24px;
}

.active-filter {
  background: rgba(212, 175, 98, 0.14);
}

.event-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.event-meta {
  border-top: 1px solid rgba(212, 175, 98, 0.18);
  color: var(--gold-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.86rem;
  font-weight: 700;
}

.event-price {
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 16px;
}

.event-card .primary-button {
  margin-top: 18px;
}

.event-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.member-event-request {
  border: 1px solid rgba(212, 175, 98, 0.24);
  background: rgba(255, 255, 255, 0.04);
  margin-top: 28px;
  padding: 22px;
}

.rules-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.rules-list p {
  border-left: 2px solid var(--gold);
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  padding-left: 12px;
}

.event-points {
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 10px;
  text-transform: uppercase;
}

.profile-panel {
  border: 1px solid rgba(212, 175, 98, 0.24);
  background: linear-gradient(135deg, rgba(212, 175, 98, 0.12), rgba(255, 255, 255, 0.035));
  margin-top: 28px;
  padding: 28px;
}

.soft-panel {
  margin-top: 18px;
}

.notification-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.notification-list article {
  border: 1px solid rgba(212, 175, 98, 0.18);
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.notification-list strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 6px;
}

.notification-list p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.scanner-panel,
.scanner-result {
  border: 1px solid rgba(212, 175, 98, 0.24);
  background: linear-gradient(135deg, rgba(212, 175, 98, 0.12), rgba(255, 255, 255, 0.035));
  margin-top: 28px;
  padding: 28px;
}

.scanner-camera {
  border: 1px solid rgba(212, 175, 98, 0.2);
  background: rgba(0, 0, 0, 0.24);
  padding: 14px;
}

.scanner-camera video {
  background: #000;
  display: block;
  min-height: 180px;
  object-fit: cover;
  width: 100%;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.profile-list div {
  border: 1px solid rgba(212, 175, 98, 0.2);
  background: rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.profile-list span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.profile-list strong {
  color: var(--gold-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
}

.profile-qr-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  border-top: 1px solid rgba(212, 175, 98, 0.18);
  margin-top: 28px;
  padding-top: 28px;
}

.qr-member-code {
  color: var(--gold-light);
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  margin-top: 16px;
  overflow-wrap: anywhere;
}

.qr-wrap {
  display: grid;
  position: relative;
  aspect-ratio: 1;
  background: #f7f1e6;
  border: 10px solid #f7f1e6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  width: 100%;
}

.qr-image,
.qr-card {
  grid-area: 1 / 1;
  height: 100%;
  width: 100%;
}

.qr-image {
  background: #f7f1e6;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.qr-image[src=""] {
  display: none;
}

.qr-card {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
}

.qr-cell {
  background: transparent;
}

.qr-cell.active {
  background: #070707;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.admin-summary article,
.admin-panel {
  border: 1px solid rgba(212, 175, 98, 0.24);
  background: rgba(255, 255, 255, 0.04);
}

.admin-summary article {
  padding: 20px;
}

.admin-summary span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.admin-summary strong {
  color: var(--gold-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.4rem;
}

.admin-panel {
  margin-top: 18px;
  padding: 22px;
}

.admin-panel-header {
  border-bottom: 1px solid rgba(212, 175, 98, 0.18);
  padding-bottom: 18px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.45fr) minmax(130px, 0.4fr) auto auto;
  gap: 10px;
  margin-top: 18px;
}

.admin-table {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  overflow-x: auto;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.admin-form div {
  display: grid;
  gap: 10px;
}

.admin-form-wide {
  grid-column: 1 / -1;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) repeat(4, minmax(80px, 0.6fr)) minmax(90px, 0.5fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.admin-row-three {
  grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 1.3fr) minmax(100px, 0.5fr);
}

.admin-row-pending {
  grid-template-columns: minmax(170px, 1.2fr) minmax(120px, 0.7fr) minmax(120px, 0.8fr) minmax(80px, 0.5fr) minmax(110px, 0.5fr);
}

.admin-row-signups {
  align-items: center;
  grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(180px, 0.8fr);
}

.admin-row-attendee {
  align-items: center;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(130px, 0.6fr) minmax(150px, 0.6fr);
  margin-bottom: 12px;
}

.admin-row-users {
  align-items: center;
  grid-template-columns: minmax(90px, 0.55fr) minmax(90px, 0.5fr) minmax(110px, 0.55fr) minmax(150px, 0.9fr) minmax(150px, 1fr) minmax(80px, 0.4fr) minmax(130px, 0.65fr) minmax(70px, 0.35fr) minmax(180px, 1fr) minmax(95px, 0.5fr) minmax(180px, 1fr) minmax(90px, 0.4fr);
  min-width: 1560px;
}

.admin-row-users input,
.admin-row-users select {
  min-height: 38px;
}

.admin-row-users strong {
  color: var(--text);
}

.admin-row-audit {
  grid-template-columns: minmax(150px, 0.7fr) minmax(100px, 0.5fr) minmax(150px, 0.6fr) minmax(260px, 1.4fr);
}

.admin-inline-actions {
  display: flex;
  gap: 8px;
}

.admin-attendees {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: -2px 0 8px;
}

.admin-row-head {
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table-button {
  min-height: 36px;
  padding: 0 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #000;
  z-index: 1000;
}

.modal {
  width: min(100%, 520px);
  padding: 32px;
  position: relative;
  z-index: 1001;
}

.event-detail-modal {
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  width: min(100%, 760px);
}

.detail-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-list strong {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  overflow-wrap: anywhere;
}

.calendar-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.disabled-link {
  opacity: 0.5;
  pointer-events: none;
}

#signupModal .modal {
  background: #000 !important;
  border-color: rgba(212, 175, 98, 0.45);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.9);
}

#signupModal {
  background: #000 !important;
}

#signupModal[hidden] {
  display: none !important;
}

#signupTitle {
  font-size: clamp(1.8rem, 4vw, 2.45rem);
}

.icon-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-light);
  font-size: 1.35rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .shell {
    padding: 16px;
  }

  .auth-view {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .brand-panel {
    min-height: 420px;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .level-panel,
  .tier-grid {
    grid-template-columns: 1fr;
  }

  .member-header {
    align-items: stretch;
    flex-direction: column;
  }

  .member-actions,
  .profile-list,
  .detail-list,
  .profile-qr-section,
  .admin-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .qr-wrap {
    max-width: 220px;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-row-users,
  .admin-row-attendee {
    min-width: 0;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-panel,
  .login-panel,
  .member-view,
  .modal {
    padding: 24px;
  }

  h1 {
    font-size: 3.2rem;
  }
}
