:root {
  --bg: #0f172a;
  --panel: #1e2937;
  --accent: #f59e0b;
  --border: #334155;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --sidebar-w: 340px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid #475569;
  background: #334155;
  color: #f1f5f9;
  border-radius: 4px;
  padding: 8px 12px;
}
button.primary, .btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #1e2937;
  font-weight: 700;
}
button.secondary, .btn.ghost {
  background: transparent;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 8px 10px;
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: #64748b; line-height: 1.4; }
.error { color: #f87171; font-size: 14px; }
.success { color: #4ade80; font-size: 14px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.header h1 { margin: 0 0 4px; font-size: 20px; color: #f1f5f9; }
.header .subtitle { margin: 0; font-size: 12px; color: #64748b; }
.site-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.site-nav a { font-size: 13px; }
.filters { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filters h3, .section-title {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.stats { padding: 12px 20px; font-size: 13px; color: #64748b; border-bottom: 1px solid var(--border); }
.locations-list { padding: 8px 0 16px; }
.location-item {
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.location-item:hover, .location-item.active { background: #334155; }
.location-item .name { font-weight: 600; color: #f1f5f9; }
.location-item .meta { font-size: 11px; color: #64748b; margin-top: 2px; }
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-pane { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.map-logo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  height: 150px;
  width: auto;
  max-width: min(280px, 42vw);
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
}
.club-pin span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #1e2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.leaflet-popup-content { font-size: 13px; line-height: 1.4; margin: 10px 12px; }
.leaflet-popup-content .popup-title { color: #000; font-weight: 700; font-size: 15px; }
.leaflet-popup-content .popup-summary { font-size: 12px; color: #334155; margin: 8px 0; }
.leaflet-popup-content .popup-details-link {
  display: inline-block;
  background: #f59e0b;
  color: #1e2937;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.page { min-height: 100%; }
.page-header, .page-main { max-width: 820px; margin: 0 auto; padding: 24px 20px; }
.page-header { padding-bottom: 0; }
.page-header h1 { margin: 8px 0 4px; font-size: 28px; }
.back-link { font-size: 13px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.meta-row { margin-bottom: 14px; }
.meta-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 4px;
}
.notes { white-space: pre-wrap; line-height: 1.45; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-tab.active { background: var(--accent); color: #1e2937; border-color: transparent; font-weight: 700; }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.club-mine { list-style: none; padding: 0; margin: 12px 0 0; }
.club-mine li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: 46vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .map-pane { height: 54vh; }
  .map-logo { height: 72px; }
  .field-row { grid-template-columns: 1fr; }
}
