:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #666b74;
  --paper: #f6f4ef;
  --surface: #ffffff;
  --line: #dedbd3;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #9f1239;
  --shadow: 0 16px 50px rgba(23, 23, 23, 0.1);
}

* {
  box-sizing: border-box;
}

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

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #f2e8ea;
  color: var(--danger);
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

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

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

.upload-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.upload-panel {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.upload-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 8vw, 3.8rem);
  line-height: 1;
}

.upload-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.admin-header nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.admin-header nav form {
  margin: 0;
}

.link-button {
  min-height: auto;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
}

.link-button:hover {
  background: transparent;
  color: var(--ink);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 28px;
  padding: 28px;
}

.events-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.settings-panel {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.settings-panel h2,
.section-title h2 {
  margin: 0 0 16px;
}

.qr-block {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.qr-block img {
  width: 180px;
  border: 1px solid var(--line);
}

code {
  white-space: normal;
  word-break: break-word;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-title span {
  color: var(--muted);
  font-weight: 700;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.event-grid {
  display: grid;
  gap: 14px;
}

.event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.event-card h2 {
  margin: 0 0 6px;
}

.event-card p {
  margin: 0;
  color: var(--muted);
}

.event-stats,
.event-actions {
  display: flex;
  gap: 12px;
}

.event-stats span {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.delete-form {
  margin-top: 18px;
}

.delete-form button {
  width: 100%;
}

.photo-card,
.approved-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-card img,
.approved-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e7e3dc;
}

.photo-card form,
.photo-meta {
  margin: 12px;
}

.photo-card button {
  width: 100%;
}

.error-text {
  color: var(--danger);
  font-weight: 750;
}

.photo-meta {
  display: grid;
  gap: 4px;
}

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

.display-shell {
  min-height: 100vh;
  padding: 32px;
}

.display-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}

.display-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.95;
}

.display-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.45;
}

.display-qr {
  width: min(28vw, 260px);
  min-width: 180px;
  border: 10px solid white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.approved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.approved-card {
  position: relative;
}

.approved-card span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 850;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-size: 1.2rem;
}

@media (max-width: 820px) {
  .admin-header,
  .display-hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-stats,
  .event-actions {
    flex-wrap: wrap;
  }

  .display-shell {
    padding: 18px;
  }
}
