:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --border: #334155;
}

* { box-sizing: border-box; }

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

header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}

header h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }

main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 24px 32px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.panel h2 { margin-top: 0; font-size: 16px; }

label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

input[type="text"], input[type="email"], select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

input[type="range"] { width: 100%; margin-top: 6px; }

.hint { font-size: 12px; color: var(--accent); margin: -10px 0 16px; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
}

legend { color: var(--muted); font-size: 13px; padding: 0 6px; }

#poles-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

#poles-list input { width: auto; margin: 0; }

.actions { display: flex; gap: 10px; }

button {
  background: var(--accent);
  color: #0b1220;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

button#run-now { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

.status { font-size: 13px; color: var(--muted); min-height: 18px; }

.suggestions {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.suggestions li { padding: 8px 10px; cursor: pointer; font-size: 13px; }
.suggestions li:hover { background: var(--border); }
.suggestions:empty { display: none; }

.filters { margin-bottom: 12px; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.filters select { width: 180px; display: inline-block; }
.filters button { margin-bottom: 0; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 14px;
  font-size: 14px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel.hidden { display: none; }

.muted { color: var(--muted); font-size: 12px; }
.scan-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.scan-btn:disabled { opacity: 0.5; cursor: wait; }
.prospect-status { width: 120px; margin: 0; padding: 4px 6px; font-size: 12px; }

.badge-open, .badge-closed {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-open { background: #052e16; color: #4ade80; }
.badge-closed { background: #1f2937; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.badge-review {
  display: inline-block;
  background: #422006;
  color: #fbbf24;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
}
