:root {
  --bg: #11161c;
  --panel-bg: #1a222b;
  --border: #2b3542;
  --text: #e4e9ef;
  --muted: #8b98a7;
  --accent: #3b82f6;
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 1.1rem; margin: 0; font-weight: 600; }

.status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status.idle { background: #3a4452; color: var(--muted); }
.status.running { background: #164e2b; color: #4ade80; }
.status.finished { background: #1e3a5c; color: #60a5fa; }

main {
  display: flex;
  height: calc(100% - 52px);
}

#map {
  flex: 1 1 auto;
  height: 100%;
  background: #0b0f14;
}

#panel {
  width: 340px;
  flex: 0 0 340px;
  background: var(--panel-bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#panel h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.6rem 0;
}

.hint { font-size: 0.85rem; color: var(--muted); margin-top: 0; }

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

select, button {
  background: #22303f;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--accent); }

.buttons { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.buttons button { flex: 1; }

.address-row { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.address-row input {
  flex: 1 1 auto;
  background: #22303f;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  min-width: 0;
}
.address-row button { flex: 0 0 auto; }

#trip-info { font-size: 0.85rem; color: var(--muted); flex-direction: column; align-items: flex-start; }

#legend div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
  border: 2px solid transparent;
}
.dot.grey { background: #6b7280; }
.dot.plain { background: #5b6573; opacity: 0.5; }
.dot.blue-idle { background: #60a5fa; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #22c55e; }
.dot.green.preempted { width: 18px; height: 18px; border-width: 3px; border-color: #fff; }
.dot.orange { background: #f97316; border-color: #fff; }
.dot.purple { background: #a855f7; border-color: #fff; }
.dot.ambulance { background: #e11d48; box-shadow: 0 0 0 2px #fff2; }

#log-section { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#log {
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #0f151b;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 150px;
}
#log .entry { padding: 0.15rem 0; border-bottom: 1px solid #1f2733; color: #c7d0da; }
#log .entry.preempt { color: #60a5fa; }
#log .entry.passed { color: #94a3b8; }
