:root {
  --bg: #f4f6f8;
  --panel-bg: #ffffff;
  --border: #dde2e7;
  --text: #1c2530;
  --text-muted: #6b7580;
  --accent: #1a6b3c;
  --accent-dark: #0f4a28;
  --open: #2e9e5b;
  --exception: #d99a1f;
  --capped: #c76b1f;
  --closed: #c0392b;
  --unclear: #8b8f96;
}

* { box-sizing: border-box; }

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

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  background: var(--accent-dark);
  color: white;
  padding: 10px 20px;
}
.topbar h1 { margin: 0; font-size: 1.2rem; }
.topbar-sub { font-size: 0.8rem; opacity: 0.85; }

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 340px;
  min-width: 300px;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 12px;
}

#map { flex: 1; }

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.panel h2 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: var(--accent-dark);
}
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

button {
  width: 100%;
  padding: 9px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }

.hidden { display: none; }

.results { max-height: 260px; overflow-y: auto; }

.result-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  font-size: 0.85rem;
}
.result-card .title { font-weight: 600; margin-bottom: 4px; }
.result-card .status-line { margin-bottom: 4px; }
.result-card a { color: var(--accent-dark); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
}
.status-badge.open { background: var(--open); }
.status-badge.exception { background: var(--exception); }
.status-badge.capped { background: var(--capped); }
.status-badge.closed { background: var(--closed); }
.status-badge.unclear { background: var(--unclear); }

.legend { font-size: 0.82rem; }
.legend div { margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.open { background: var(--open); }
.dot.exception { background: var(--exception); }
.dot.capped { background: var(--capped); }
.dot.closed { background: var(--closed); }
.dot.unclear { background: var(--unclear); }

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fff8ec;
  border-color: #f0d9a8;
}

.result-box {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
.result-box.ban-yes { background: #fdecea; border-color: var(--closed); }
.result-box.ban-no { background: #eaf7ee; border-color: var(--open); }

.leaflet-popup-content { font-size: 0.85rem; max-width: 260px; }
.leaflet-popup-content a { color: var(--accent-dark); }
