:root {
  --bg: #f4f5f7; --panel: #fff; --text: #1c2430; --muted: #627084; --line: #dde1e7;
  --accent: #1457c8; --live: #137a43; --warn: #a65b00; --bad: #b3261e; --idle: #5b6675;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; }
button { background: var(--accent); border: 0; border-radius: 4px; color: #fff; cursor: pointer; font: inherit; padding: 8px 12px; }
button.link { background: none; color: var(--accent); padding: 0; margin-left: auto; }
button.danger { background: var(--bad); }
input { border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 8px; width: 100%; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 20px; }
.login { display: grid; height: 100%; place-items: center; padding: 16px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 12px; max-width: 340px; padding: 24px; width: 100%; }
.login h1 { font-size: 20px; margin: 0; }
.login p { margin: 0; }
.login label { display: grid; gap: 4px; }
.app { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 8px; padding: 12px; }
.new-trip { border-bottom: 1px solid var(--line); display: grid; gap: 8px; padding: 12px; }
.code { background: #fff7e0; border-bottom: 1px solid var(--line); margin: 0; padding: 12px; }
.code b { display: block; font: 600 18px ui-monospace, Consolas, monospace; margin-top: 4px; }
.trips { flex: 1; list-style: none; margin: 0; overflow: auto; padding: 0; }
.trips button { background: none; border-bottom: 1px solid var(--line); border-radius: 0; color: inherit; display: block; padding: 10px 12px; text-align: left; width: 100%; }
.trips button[aria-current="true"] { background: #e9f0fc; }
.trips .title { display: block; font-weight: 600; }
.badge { font-weight: 600; }
.badge.live { color: var(--live); }
.badge.no_gps { color: var(--warn); }
.badge.no_connection { color: var(--bad); }
.badge.waiting_driver, .badge.finished { color: var(--idle); }
.content { display: grid; grid-template-rows: 1fr auto; min-height: 0; min-width: 0; }
.map { min-height: 300px; }
.details { background: var(--panel); border-top: 1px solid var(--line); padding: 12px 16px; }
.details h2 { font-size: 16px; margin: 0 0 8px; }
.facts { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 0 0 8px; }
.facts div { display: flex; gap: 8px; justify-content: space-between; }
.facts dt { color: var(--muted); }
.facts dd { font-variant-numeric: tabular-nums; margin: 0; text-align: right; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100%; }
  .trips { max-height: 220px; }
  .map { height: 55vh; }
}
