:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #182427;
  background: #f8faf9;
  font-size: 14px;
  letter-spacing: 0;
  --border: #dce3e1;
  --muted: #657571;
  --accent: #087f72;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
a {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  background: white;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  min-height: 38px;
}
button:hover,
.button:hover {
  background: #edf3f1;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #39a99b;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover {
  background: #056859;
}
.icon {
  width: 38px;
  height: 38px;
  padding: 9px;
  flex-shrink: 0;
}
.lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
input {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px;
  min-width: 0;
  background: white;
  color: inherit;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 19px;
}
h2 {
  font-size: 23px;
  overflow-wrap: anywhere;
}
h3 {
  font-size: 14px;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}
header {
  height: 72px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  background: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 650;
  white-space: nowrap;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #087f72;
  color: white;
  font-size: 13px;
  font-weight: 800;
  width: 34px;
  height: 34px;
  border-radius: 6px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
#connection {
  font-size: 12px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
aside {
  border-right: 1px solid var(--border);
  background: white;
  padding: 24px 16px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 4px 20px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding-left: 10px;
  color: var(--muted);
}
.search input {
  width: 100%;
  border: 0;
  background: transparent;
}
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 18px;
  margin-bottom: 10px;
}
.tabs button {
  font-size: 12px;
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 12px 2px;
  background: none;
  border-bottom: 2px solid transparent;
}
.tabs [aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}
.ride {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 15px 10px;
  margin: 0;
  background: transparent;
}
.ride.active {
  background: #edf6f3;
  border-left-color: var(--accent);
}
.ride-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.ride-name {
  font-weight: 650;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ride-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #657571;
  white-space: nowrap;
}
.badge.live {
  color: #087f72;
}
.badge.offline {
  color: #a46513;
}
.ride-view {
  min-width: 0;
  padding: 24px 28px;
}
.ride-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--border);
  padding: 18px 0;
  margin-bottom: 22px;
}
.metrics > div {
  padding: 0 18px;
  border-right: 1px solid var(--border);
}
.metrics > div:first-child {
  padding-left: 0;
}
.metrics > div:last-child {
  border: 0;
}
.metrics span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.metrics strong {
  font-size: 28px;
  font-weight: 600;
}
.metrics small {
  font-size: 12px;
  margin-left: 6px;
  color: var(--muted);
}
.map-wrap {
  height: clamp(300px, 48vh, 620px);
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}
#map {
  width: 100%;
  height: 100%;
  background: #e1e9e5;
}
.map-tools {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 500;
  display: flex;
  gap: 6px;
}
.map-tools [aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.map-status {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 500;
  background: white;
  padding: 8px 12px;
  max-width: calc(100% - 24px);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 12px;
}
.chart {
  height: 150px;
  position: relative;
}
.empty {
  padding: 32px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
#more {
  width: 100%;
  margin-top: 12px;
}
dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  max-height: 85vh;
}
dialog::backdrop {
  background: #15292280;
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.form-row {
  display: flex;
  gap: 8px;
}
.form-row input {
  flex: 1;
}
.device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.device span {
  overflow-wrap: anywhere;
}
#device-form,
#new-token {
  margin-top: 22px;
}
#notice {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #283a35;
  color: white;
  border-radius: 6px;
  z-index: 2000;
  max-width: calc(100vw - 32px);
}
[hidden] {
  display: none !important;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login {
  width: min(380px, calc(100vw - 40px));
}
.login .brand {
  margin-bottom: 42px;
}
.login h1 {
  font-size: 28px;
  margin-bottom: 24px;
}
.login input {
  width: 100%;
  margin-bottom: 18px;
}
.login button {
  width: 100%;
}
.error {
  color: #b62d39;
  font-size: 13px;
  margin-bottom: 16px;
}
@media (min-width: 1100px) {
  aside {
    max-height: calc(100vh - 72px);
    overflow: auto;
    position: sticky;
    top: 0;
  }
}
@media (max-width: 800px) {
  header {
    padding: 0 14px;
    height: 64px;
  }
  .brand {
    font-size: 16px;
    gap: 6px;
  }
  .brand-mark {
    width: 29px;
    height: 29px;
  }
  #connection {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .header-actions button span {
    display: none;
  }
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  aside {
    padding: 18px 10px;
  }
  .ride-view {
    padding: 20px 16px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .metrics > div:nth-child(odd) {
    padding-left: 0;
  }
  .metrics > div:nth-child(even) {
    border: 0;
  }
  .metrics strong {
    font-size: 25px;
  }
}
@media (max-width: 580px) {
  .workspace {
    display: flex;
    flex-direction: column;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .section-title {
    margin-bottom: 12px;
  }
  .search {
    margin-bottom: 0;
  }
  .tabs {
    margin-top: 6px;
  }
  #rides {
    display: flex;
    overflow: auto;
    gap: 6px;
    max-height: 125px;
  }
  .ride {
    min-width: 205px;
    width: 205px;
    padding: 10px;
  }
  .empty {
    padding: 12px 0;
  }
  .ride-view {
    padding: 20px 16px;
  }
  .map-wrap {
    height: 360px;
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 15px 0;
  }
  .metrics > div {
    padding: 0 8px !important;
    border: 0;
  }
  .metrics > div:first-child {
    padding-left: 0 !important;
  }
  .metrics strong {
    font-size: 20px;
  }
  .metrics small {
    display: block;
    margin: 4px 0 0;
  }
  .metrics span {
    font-size: 11px;
  }
  .form-row {
    flex-wrap: wrap;
  }
  .form-row input {
    min-width: 130px;
  }
  .chart {
    height: 135px;
  }
  .brand .muted {
    display: none;
  }
}
