:root {
  color: #1c1917;
  background: #f3efe6;
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

button, input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: #0f6e56;
  color: white;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: #1c1917;
  border: 1px solid #d6d3d1;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input {
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: white;
}

.error { color: #9f1239; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login form, dialog form {
  width: min(420px, 100%);
  display: grid;
  gap: 0.9rem;
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
}

dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
}

dialog::backdrop { background: rgba(28, 25, 23, 0.4); }

header, .header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

header {
  padding: 0.9rem 1.2rem;
  background: white;
  border-bottom: 1px solid #e7e5e4;
}

.workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 61px);
}

aside {
  overflow: auto;
  background: white;
  border-right: 1px solid #e7e5e4;
}

#map { min-height: 320px; background: #e7e5e4; }

#vehicles { list-style: none; margin: 0; padding: 0.5rem; }

#vehicles button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border-radius: 12px;
}

#vehicles button.selected { background: #ecfdf5; }

.vehicle-row { display: grid; gap: 0.2rem; }

.muted { color: #57534e; font-size: 0.85rem; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  background: #e7e5e4;
}

.pill.moving { background: #d1fae5; }
.pill.stopped { background: #e7e5e4; }
.pill.offline { background: #fee2e2; }
.pill.immobilized { background: #fecaca; }
.pill.suspended { background: #ffedd5; }

#detail { padding: 0.8rem 1rem 1.4rem; border-top: 1px solid #e7e5e4; display: grid; gap: 0.7rem; }
#detail button { justify-self: start; }
#alerts { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
#alerts li { font-size: 0.9rem; }

.pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  background: #0f6e56;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.pin.offline, .pin.immobilized { background: #9f1239; }
.pin.stopped { background: #57534e; }

@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  #map { height: 55vh; }
}
