:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1a2230;
  --muted: #6b7280;
  --line: #e5e9f0;
  --green: #1f8a3b;
  --amber: #d98a00;
  --orange: #e0691a;
  --blue: #2563eb;
  --shadow: 0 1px 3px rgba(20,30,50,.08), 0 1px 2px rgba(20,30,50,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 720px; margin: 0 auto; padding: 12px 12px 40px; }

.hero { padding: 6px 4px 12px; }
.route-line { font-size: 22px; font-weight: 700; line-height: 1.25; }
.route-line .arrow { color: var(--muted); margin: 0 6px; }
.status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 20px; font-weight: 600; }
.status #status-emoji { font-size: 22px; }
.freshness { color: var(--muted); font-size: 14px; margin-top: 4px; }

.alert {
  background: #fff4e5; border: 1px solid #ffd9a8; color: #8a4b00;
  padding: 10px 12px; border-radius: 10px; margin: 8px 0; font-size: 14px;
}
.hidden { display: none !important; }

.cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.card.wide { grid-column: span 2; }
.card-k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.card-v { font-size: 20px; font-weight: 700; margin-top: 2px; }

#progressbar {
  position: relative; height: 22px; background: #e9edf3; border-radius: 12px;
  overflow: hidden; margin: 6px 0 12px;
}
#progressfill { height: 100%; width: 0; background: linear-gradient(90deg, #2bbf5a, #1f8a3b); transition: width .6s ease; }
#progresstext {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #123;
}

#map {
  height: 320px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 14px;
}

.lists { display: grid; grid-template-columns: 1fr; gap: 12px; }
.list-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow);
}
.list-block h3 { margin: 4px 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.list-block ul { list-style: none; margin: 0; padding: 0; }
.list-block li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.list-block li:last-child { border-bottom: none; }
.list-block li.muted { color: var(--muted); }
.passed li { color: var(--green); }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

@media (min-width: 560px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .card.wide { grid-column: span 2; }
  #map { height: 380px; }
}

/* ---------- Admin ---------- */
body.admin { background: #eef1f5; }
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 16px; }
.admin-wrap h1 { font-size: 22px; }
.admin-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  padding: 9px 14px; border-radius: 9px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn.secondary { background: #6b7280; }
.btn.green { background: var(--green); }
.btn.red { background: #dc2626; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.trip-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trip-row:last-child { border-bottom: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=number], input[type=password], textarea, input[type=datetime-local], select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { padding: 3px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.planned { background: #eef; color: #334; }
.pill.moving { background: #e6f6ec; color: var(--green); }
.pill.stopped { background: #fff4e0; color: var(--amber); }
.pill.offline { background: #ffe9dc; color: var(--orange); }
.pill.finished { background: #e8ffe8; color: #147a2b; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.warn { background: #fff4e5; border: 1px solid #ffd9a8; color: #8a4b00; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.login-box { max-width: 360px; margin: 8vh auto; }
.err { color: #dc2626; font-size: 14px; margin-top: 8px; }
