:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --ink: #1c221f;
  --muted: #68726c;
  --line: #d8ddd7;
  --panel: #fff;
  --accent: #23705c;
  --accent-dark: #164e40;
  --soft: #e7f3ee;
  --warn: #9b5c00;
  --danger: #a33d3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar,
.admin-head,
.section-line,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  align-items: flex-end;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 40px;
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.hidden {
  display: none !important;
}

.intro,
.panel,
.outing-card,
.outing-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.intro,
.panel,
.outing-detail {
  padding: 18px;
}

.intro {
  margin-bottom: 14px;
}

.intro p,
.small,
#adminStatus,
#outingMeta {
  margin-bottom: 0;
  color: var(--muted);
}

.instructions-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfb;
}

.instructions-box h3 {
  margin-bottom: 8px;
}

.instructions-box p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.outing-list,
.admin-outings {
  display: grid;
  gap: 12px;
}

.outing-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
}

.outing-card h3 {
  margin-bottom: 6px;
}

.card-meta {
  margin-bottom: 8px;
  color: var(--muted);
}

.button,
.link-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

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

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.link-button {
  margin-bottom: 12px;
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
}

.pill {
  margin: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 700;
  white-space: nowrap;
}

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

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

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.field-group p {
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 700;
}

.field-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

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

textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--ink);
}

.checkbox-label input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.names-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.names-list li {
  margin-bottom: 6px;
}

.admin-login {
  max-width: 440px;
}

.admin-event {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.registrations-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.registrations-table th,
.registrations-table td {
  border-top: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.registrations-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.registrations-table select {
  min-height: 34px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 18px, 1160px);
    padding-top: 18px;
  }

  .topbar,
  .admin-head,
  .section-line,
  .detail-head,
  .outing-card,
  .admin-event-head {
    display: block;
  }

  h1 {
    margin-bottom: 12px;
    font-size: 33px;
  }

  .detail-grid,
  .form-grid,
  .field-group-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .form-actions .button {
    width: 100%;
  }

  .registrations-table {
    min-width: 820px;
  }

  .admin-event {
    overflow-x: auto;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 9mm;
  }

  body {
    background: white;
  }

  .topbar,
  #clientView,
  #outingView,
  #adminLoginForm,
  .admin-head,
  .form,
  .button,
  .toast {
    display: none !important;
  }

  #adminView,
  #adminPanel {
    display: block !important;
  }

  .app {
    width: 100%;
    padding: 0;
  }

  .panel,
  .admin-event {
    border: 0;
    padding: 0;
  }

  .admin-event {
    page-break-inside: avoid;
    margin-bottom: 16px;
  }

  .registrations-table {
    font-size: 11px;
  }
}
