:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #65736d;
  --line: #dfe6e1;
  --accent: #11684f;
  --accent-dark: #0b4d3b;
  --warn: #b33b2e;
  --ok: #236d3b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
.button-link {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
}

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

button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.danger {
  background: var(--warn);
}

button.danger:hover {
  background: #8f2e24;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 8px;
}

h1,
h2,
h3,
p { margin-top: 0; }

.centered {
  align-items: center;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 420px;
  padding: 32px;
  width: 100%;
}

.login-panel h1 {
  font-size: 2rem;
  letter-spacing: 0;
  margin-bottom: 24px;
}

.stack {
  display: grid;
  gap: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.topbar {
  align-items: center;
  background: rgba(246, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar h1 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  letter-spacing: 0;
  margin: 0;
}

.page {
  padding: 28px clamp(18px, 4vw, 56px) 56px;
}

.shop-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

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

.section-head h2 {
  font-size: 1.2rem;
  margin: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tickets-head { margin-top: 32px; }

.product-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ticket-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.product-card,
.checkout-panel,
.order-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.ticket-card {
  display: flex;
  flex-direction: column;
}

.ticket-card .selection-panel {
  margin-top: auto;
  width: 100%;
}

.ticket-card--visual {
  gap: 16px;
  padding: 16px;
}

.simple-ticket-card {
  align-items: stretch;
}

.product-image {
  aspect-ratio: 16 / 9;
  background: #f7f9f7;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.ticket-card--visual .product-image {
  box-shadow: inset 0 0 0 1px rgba(23, 33, 28, 0.12);
  filter: contrast(1.06) saturate(1.02);
  height: 150px;
}

.product-info {
  display: grid;
  gap: 8px;
}

.product-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.product-card p {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0;
}

.price {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-price { display: none; }

.product-card:has(.upgrade-toggle input:checked) .base-price {
  color: var(--muted);
  font-size: 1rem;
  text-decoration: line-through;
}

.product-card:has(.upgrade-toggle input:checked) .variant-price {
  color: var(--accent);
  display: inline;
}

.upgrade-toggle {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 44px;
}

.upgrade-toggle input {
  flex: 0 0 auto;
  min-height: auto;
  width: auto;
}

.upgrade-toggle span {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
}

.upgrade-toggle input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.selection-panel {
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.selection-panel--compact {
  gap: 8px;
  padding: 10px;
}

.quantity input { max-width: 110px; }

.selection-panel .quantity {
  gap: 7px;
}

.checkout-panel {
  display: grid;
  gap: 20px;
  padding: 22px;
  position: sticky;
  top: 112px;
}

.checkout-panel h2 { margin-bottom: 0; }

.payment-box {
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.payment-box h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dl div {
  display: grid;
  gap: 3px;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.alert,
.success {
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.alert {
  background: #fff0ee;
  color: var(--warn);
}

.success {
  background: #edf8f0;
  color: var(--ok);
}

.orders {
  display: grid;
  gap: 18px;
}

.order-card {
  overflow: hidden;
  padding: 0;
}

.order-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.order-head h2 {
  font-size: 1.12rem;
  margin-bottom: 6px;
}

.order-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.status {
  background: #eaf2ef;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 7px 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.status-form {
  align-items: end;
  display: flex;
  gap: 12px;
  padding: 18px;
}

.order-actions {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  padding: 18px 18px 12px;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

.empty-state {
  color: var(--muted);
  padding: 24px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .topbar .eyebrow {
    margin-bottom: 4px;
  }

  .topbar button {
    min-height: 38px;
    padding: 0 12px;
  }

  .page {
    padding: 18px 14px 36px;
  }

  .shop-grid {
    gap: 20px;
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    gap: 16px;
    padding: 18px;
    position: static;
  }

  .section-head,
  .order-head,
  .status-form {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    gap: 6px;
    margin-bottom: 10px;
  }

  .tickets-head {
    margin-top: 24px;
  }

  .product-grid {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .product-card {
    align-items: center;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 96px;
    padding: 14px;
  }

  .ticket-card--visual {
    align-items: stretch;
    gap: 14px;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .simple-ticket-card {
    align-items: stretch;
  }

  .ticket-card--visual .product-image {
    aspect-ratio: 16 / 10;
    height: auto;
  }

  .product-card h3 {
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 5px;
  }

  .product-card p {
    font-size: 1.18rem;
  }

  .quantity {
    gap: 5px;
  }

  .quantity input {
    max-width: none;
  }

  .selection-panel {
    gap: 12px;
    padding: 12px;
  }

  .selection-panel .quantity,
  .selection-panel .upgrade-toggle {
    width: 100%;
  }

  .selection-panel .upgrade-toggle span {
    flex: 1;
    justify-content: center;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar form,
  .topbar button {
    width: 100%;
  }

  .product-card {
    grid-template-columns: minmax(0, 1fr) 84px;
    padding: 12px;
  }

  .checkout-panel {
    padding: 16px;
  }
}
