:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65726c;
  --line: #d9e1dc;
  --paper: #f6f8f5;
  --surface: #ffffff;
  --accent: #136f63;
  --accent-dark: #0d5048;
  --warn: #a34d16;
  --bad: #a12d2d;
  --good: #18734a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.public-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  min-height: 100vh;
  align-items: center;
}

.event-hero,
.panel,
.reservation-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.event-hero {
  overflow: hidden;
}

.banner {
  min-height: 320px;
  background: linear-gradient(135deg, #c4d6d1, #f0d59f 55%, #d8865c);
  display: grid;
  place-items: center;
  color: rgba(23, 33, 29, 0.68);
  font-weight: 800;
  font-size: 32px;
}

.banner.has-image {
  background-position: center;
  background-size: cover;
}

.banner.has-image span {
  display: none;
}

.event-copy,
.reservation-panel,
.panel {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(34px, 6vw, 68px);
}

h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.event-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-size: 18px;
}

.availability {
  color: var(--muted);
  font-size: 18px;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

button,
.download-button,
.secondary-link {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download-button:hover {
  background: var(--accent-dark);
}

.secondary-link,
.compact-button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.ticket-result {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  text-align: center;
}

.ticket-result img {
  width: min(100%, 320px);
}

.uuid {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.status-message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.status-message.good {
  color: var(--good);
}

.status-message.bad {
  color: var(--bad);
}

.admin-header,
.table-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(260px, 0.6fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.stats {
  display: grid;
  gap: 12px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.stats strong {
  font-size: 42px;
}

.stats span,
.muted {
  color: var(--muted);
}

#reader {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f9faf8;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
}

.table-panel {
  margin-top: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td:first-child {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.available {
  background: #dfeee6;
  color: var(--good);
}

.badge.issued {
  background: #f6e3c4;
  color: var(--warn);
}

.badge.used {
  background: #efd4d4;
  color: var(--bad);
}

@media (max-width: 920px) {
  .public-shell,
  .admin-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .banner {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .event-copy,
  .reservation-panel,
  .panel {
    padding: 18px;
  }

  .event-details,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .table-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
