:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #38bdf8;
  --ok: #22c55e;
  --stale: #f59e0b;
  --none: #64748b;
}

* {
  box-sizing: border-box;
}

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

#app {
  display: flex;
  height: 100%;
}

#sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
}

#sidebar header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

#logo {
  width: 46px;
  height: auto;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#sidebar h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #284195;
}

#clock {
  font-variant-numeric: tabular-nums;
  color: #64748b;
  font-size: 12px;
}

#vehicle-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.vehicle {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.vehicle:hover {
  background: var(--panel-2);
}

.vehicle.active {
  background: var(--panel-2);
  border-color: var(--accent);
}

.vehicle .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.vehicle .name {
  font-weight: 600;
}

.vehicle .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.vehicle .age {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.age.ok {
  color: var(--ok);
}
.age.stale {
  color: var(--stale);
}
.age.none {
  color: var(--none);
}

#sidebar footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.track-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

#status-line {
  font-variant-numeric: tabular-nums;
}

#map {
  flex: 1;
  background: #1a2233;
}

/* Bílamerki á korti */
.car-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #fff;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.car-marker.stale {
  opacity: 0.55;
  border-style: dashed;
}

.leaflet-popup-content {
  font: 13px/1.4 system-ui, sans-serif;
}
.leaflet-popup-content b {
  font-size: 14px;
}

@media (max-width: 640px) {
  #app {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    height: 44%;
  }
  #map {
    height: 56%;
  }
}
