:root {
  --green: #22c55e;
  --orange: #f97316;
  --blue: #2563eb;
  --bg: #ffffff;
  --bg-alt: #f4f4f5;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

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

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
}

header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}
#search-form {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
}
#search-wrap {
  position: relative;
  flex: 1;
}
#search-form input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}
#search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 1100;
  max-height: 300px;
  overflow-y: auto;
}
#search-suggestions li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
#search-suggestions li:last-child {
  border-bottom: none;
}
#search-suggestions li:hover,
#search-suggestions li.active {
  background: var(--bg-alt);
}
#search-suggestions .primary {
  font-weight: 500;
}
#search-suggestions .secondary {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}
#search-form button, #panel-toggle, #csv-clear {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
#panel-toggle { display: none; }

main {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
}

#panel {
  border-right: 1px solid var(--border);
  padding: 0.75rem 1rem;
  overflow-y: auto;
  background: var(--bg-alt);
}
#panel h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
}
#panel section:first-child h2 { margin-top: 0; }
#panel label {
  display: block;
  padding: 0.15rem 0;
  font-size: 14px;
  cursor: pointer;
}
#panel input[type=file] {
  font-size: 13px;
  margin-top: 0.4rem;
  width: 100%;
}
#panel #csv-clear { margin-top: 0.4rem; }
#panel #csv-download { display: inline-block; margin-top: 0.4rem; font-size: 13px; }

.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-active { background: var(--green); }
.dot-pending { background: var(--orange); }
.dot-candidate { background: var(--blue); }

.muted { color: var(--muted); font-size: 13px; }

#map {
  width: 100%;
  height: 100%;
}

footer {
  padding: 0.4rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

@media (max-width: 720px) {
  header h1 { display: none; }
  #panel-toggle { display: inline-block; }
  main { grid-template-columns: 1fr; }
  #panel {
    position: absolute;
    top: 50px;
    left: 0;
    z-index: 1000;
    width: 100%;
    max-height: calc(100vh - 50px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  #panel.open { transform: translateX(0); }
}
