:root {
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap { max-width: 840px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--brand); color: #fff; padding: 28px 0; }
.site-header h1 { margin: 0 0 4px; font-size: 1.8rem; }
.site-header .brand-link { color: #fff; text-decoration: none; }
.tagline { margin: 0; opacity: 0.9; }

main { padding: 24px 0 40px; }

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.search label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.search input, .search select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}
.search button {
  padding: 9px 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}
.search button:hover { background: var(--brand-dark); }

.custom-dates { margin-top: 10px; gap: 14px; }
.custom-dates label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.85rem; }
.custom-dates input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }

.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 14px; border-radius: 8px; }
.hint, .muted { color: var(--muted); }
.empty { color: var(--muted); }

h2 { font-size: 1.3rem; margin: 28px 0 8px; }

.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.event { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.event h3 { margin: 0 0 6px; font-size: 1.15rem; }
.event h3 a { color: var(--text); text-decoration: none; }
.event h3 a:hover { color: var(--brand); text-decoration: underline; }
.distance {
  display: inline-block;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.85rem;
  margin-left: 8px;
  font-weight: 600;
}
.meta { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; }
.cat { color: var(--brand-dark); font-weight: 600; }
.venue { margin: 0; color: var(--muted); font-size: 0.9rem; }

.unlocated-heading { color: var(--muted); margin-top: 24px; font-size: 1rem; }

article { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-top: 12px; }
article h1 { margin: 0 0 8px; font-size: 1.6rem; }
article .desc { white-space: pre-wrap; }
article .source a { color: var(--brand); }
.backlink { display: inline-block; margin-top: 16px; color: var(--brand); text-decoration: none; }
.backlink:hover { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: 0.85rem; }
.site-footer a { color: var(--muted); }

/* ----- Admin ----- */
.btn { display: inline-block; padding: 8px 14px; background: var(--brand); color: #fff; border-radius: 8px; text-decoration: none; border: none; cursor: pointer; font-size: 0.95rem; }
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--brand-dark); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.inline { display: inline; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.status-tabs a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 0.9rem; background: var(--card); }
.status-tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: top; }
.admin-table th { background: var(--bg); }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-verified { background: #ecfdf5; color: #047857; }
.status-pending { background: #fffbeb; color: #b45309; }
.status-needs_update { background: #fef2f2; color: #b91c1c; }
.status-rejected { background: #f1f5f9; color: #64748b; }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions .link { color: var(--brand); text-decoration: none; margin-right: 8px; }
.row-actions .link { background: none; border: none; padding: 0; cursor: pointer; font-size: inherit; }
.row-actions .link.danger { color: #b91c1c; }
.admin-form { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 640px; }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.admin-form input, .admin-form select, .admin-form textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: inherit; }
.admin-form textarea { resize: vertical; }
.venue-fields { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.venue-fields legend { padding: 0 6px; font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-buttons { display: flex; gap: 8px; }
.import-help { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.import-help pre { background: var(--bg); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; }
.import-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.import-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }
.import-form .btn { margin-top: 8px; align-self: flex-start; }
.import-result { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.error-list { color: #b91c1c; }
.admin-login { max-width: 360px; margin: 8vh auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.admin-login-form { display: flex; flex-direction: column; gap: 12px; }
.admin-login-form input { padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.admin-login-form button { padding: 10px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; }
.admin-login-form button:hover { background: var(--brand-dark); }

/* Map + extras */
#map { height: 400px; margin: 18px 0; border-radius: 12px; border: 1px solid var(--border); z-index: 0; }
.leaflet-container { font-family: inherit; }
.distance-line { margin: 6px 0 0; }
.notice { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
