@font-face {
  font-family: "Simplon Norm";
  src: url("../fonts/Simplon-Norm-Bold.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #1b2233;
  --muted: #6b7489;
  --line: #e4e7ef;
  --brand: #000fa0;
  --brand-dark: #000a6e;
  --accent: #000fa0;
  --danger: #d63c3c;
  --warn: #e69a00;
  --info: #2b7de9;
  --radius: 6px;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Simplon Norm", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-weight: 800; font-size: 1.3rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo small { font-weight: 500; color: var(--muted); font-size: .7rem; margin-left: 2px; text-transform: uppercase; letter-spacing: .08em; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .92rem; }
.topbar nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.topbar nav a.active { background: #e6e8f7; color: var(--brand-dark); }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 5px; padding: 6px 12px; font: inherit; cursor: pointer; }

@media (max-width: 900px) {
  .burger { display: block; }
  .topbar nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 10px 20px 16px; border-bottom: 1px solid var(--line); }
  body.nav-open .topbar nav { display: flex; }
}

.hero {
  background: #000fa0;
  color: #fff;
  padding: 70px 0 80px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; line-height: 1.1; }
.hero p { font-size: 1.15rem; max-width: 620px; opacity: .92; margin: 0 0 26px; }

.page-head { padding: 34px 0 10px; }
.page-head h1 { margin: 0; font-size: 1.9rem; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

main { padding-bottom: 50px; flex: 1; width: 100%; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: 11px 20px; border-radius: 5px; font-weight: 600; font-size: .95rem; cursor: pointer;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: transparent; border: 2px solid rgba(255,255,255,.6); }
.btn.green { background: var(--brand); }
.btn.small { padding: 6px 12px; font-size: .85rem; }

input, select, textarea {
  font-family: inherit; font-size: .95rem; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9aa3e0; border-color: var(--brand); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; align-items: center; }
.toolbar > * { flex: 1 1 180px; width: auto; }
.toolbar .btn { flex: 0 0 auto; }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; 
}
.card h3 { margin: 0 0 6px; }
.card p { color: var(--muted); margin: 0 0 10px; }

a.card { color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
a.card:hover {  text-decoration: none; border-color: var(--brand); }

.stat { text-align: center; }
.stat .n { font-size: 2.2rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .9rem; }

.badge {
  display: inline-block; min-width: 38px; text-align: center; padding: 3px 9px;
  border-radius: 7px; font-weight: 700; font-size: .85rem;
}
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; background: var(--bg); color: var(--muted); font-size: .78rem; margin-right: 4px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
}
.item.click { cursor: pointer; }
.item.click:hover { border-color: var(--brand); }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: .88rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f0f2f8; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }

.notice { padding: 16px; background: #fff; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); }
.notice.error { border-color: var(--danger); color: var(--danger); background: #fff5f5; }

.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.map { height: 520px; border-radius: var(--radius); border: 1px solid var(--line);  }
.map.tall { height: 68vh; min-height: 460px; }

.vehicle-pin {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.alert { border-left: 6px solid var(--info); background: #fff; border-radius: 6px; padding: 16px 18px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alert.l2 { border-left-color: var(--warn); }
.alert.l3 { border-left-color: var(--danger); }
.alert h3 { margin: 0 0 6px; font-size: 1.05rem; }
.alert .desc { color: #333; white-space: pre-line; font-size: .93rem; }
.alert .meta { margin-top: 8px; color: var(--muted); font-size: .82rem; }

.dep-time { font-size: 1.25rem; font-weight: 800; min-width: 70px; text-align: right; }
.dep-time.rt { color: var(--brand); }
.dep-time.cancelled { text-decoration: line-through; color: var(--danger); }
.late { color: var(--danger); font-size: .8rem; font-weight: 600; }
.ontime { color: var(--brand); font-size: .8rem; font-weight: 600; }

pre.json {
  background: #101626; color: #d4e4ff; padding: 16px; border-radius: 6px;
  overflow: auto; max-height: 560px; font-size: .82rem; margin: 0;
}

.row { display: flex; gap: 20px; flex-wrap: wrap; }
.row > .col { flex: 1 1 340px; min-width: 0; }

.foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .85rem; background: #fff; }

.hero .btn { background: #fff; color: #000fa0; }
.hero .btn.ghost { background: transparent; color: #fff; }
