:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #65758b;
  --line: #dce3ed;
  --brand: #0a7c72;
  --brand-strong: #075d56;
  --accent: #e8b021;
  --danger: #bd3b32;
  --good: #16803c;
  --shadow: 0 18px 45px rgba(16, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(8, 28, 43, 0.78), rgba(8, 28, 43, 0.82)),
    url("https://images.unsplash.com/photo-1570125909232-eb263c188f7e?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.login-panel button,
.primary-button,
.secondary-button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 700;
}

.login-panel button,
.primary-button {
  background: var(--brand);
  color: white;
}

.secondary-button,
.icon-button {
  background: #eef4f3;
  color: var(--brand-strong);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px;
  background: #102033;
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand span {
  display: block;
  color: #a9b7c7;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.logout {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #d8e1ec;
  text-align: left;
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.logout {
  margin-top: auto;
  color: #ffc9c3;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.04);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: 27px;
}

.metric.alert strong {
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-heading h3 {
  margin: 0;
}

.panel-heading span {
  color: var(--muted);
  font-size: 14px;
}

.map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(10, 124, 114, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(10, 124, 114, 0.08) 1px, transparent 1px),
    #edf6f5;
  background-size: 46px 46px;
}

.route {
  position: absolute;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
  transform-origin: left center;
}

.route-one {
  width: 78%;
  left: 10%;
  top: 38%;
  transform: rotate(16deg);
}

.route-two {
  width: 66%;
  left: 18%;
  top: 62%;
  background: var(--brand);
  transform: rotate(-12deg);
}

.bus {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 32px;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.bus-a { left: 24%; top: 31%; }
.bus-b { left: 52%; top: 44%; }
.bus-c { left: 68%; top: 56%; }
.bus-d { left: 36%; top: 66%; }
.bus.delayed { background: var(--danger); }

.queue,
.tickets {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue li,
.tickets article,
.route-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue span,
.tickets span,
.route-list span {
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 99px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status.good {
  background: #e3f5e9;
  color: var(--good);
}

.status.warn {
  background: #fff4d8;
  color: #8a6100;
}

.status.neutral {
  background: #e8eef6;
  color: #42546d;
}

.route-list {
  display: grid;
  gap: 12px;
}

.route-list article,
.tickets article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.route-list button,
.tickets button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--brand-strong);
  font-weight: 700;
}

.settings-panel {
  display: grid;
  gap: 16px;
  max-width: 680px;
}

.settings-panel label {
  grid-template-columns: auto 1fr;
  justify-content: start;
  align-items: center;
}

.settings-panel input {
  width: auto;
  min-height: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 32, 51, 0.56);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: #eef1f5;
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item,
  .logout {
    text-align: center;
  }

  .metrics,
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .content-grid,
  nav {
    grid-template-columns: 1fr;
  }

  .route-list article,
  .tickets article,
  .queue li {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }
}
