:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #eef2f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(33, 99, 235, .16), transparent 34%),
    #eef2f7;
}
.login-card {
  width: min(420px, 100%);
  background: white;
  border-radius: 20px;
  padding: 34px;
  box-shadow: 0 20px 60px rgba(20, 35, 60, .14);
}
.brand-mark {
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center;
  background: #1f63e9; color: white; font-weight: 800;
}
.login-card h1 { margin: 18px 0 8px; font-size: 26px; }
.login-card p { margin: 0 0 24px; color: #68738a; }
.login-card label { display: block; margin: 14px 0; font-size: 13px; font-weight: 650; }
.login-card input {
  width: 100%; margin-top: 7px; padding: 13px 14px;
  border: 1px solid #d7deea; border-radius: 10px; outline: none;
}
.login-card input:focus { border-color: #1f63e9; box-shadow: 0 0 0 3px rgba(31,99,233,.10); }
.login-card button {
  width: 100%; border: 0; border-radius: 10px; padding: 13px;
  background: #1f63e9; color: white; font-weight: 750; margin-top: 8px;
}
.error { min-height: 20px; margin-top: 12px; color: #b42318; font-size: 13px; }

.dashboard { height: 100vh; overflow: hidden; }
.topbar {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: #101827; color: white;
}
.topbar strong { margin-right: 14px; }
.connection { font-size: 12px; color: #a8b3c7; }
.ghost-button, .small-button, .icon-button {
  border: 1px solid #d6deeb; background: white; border-radius: 8px;
}
.ghost-button { background: transparent; border-color: #41506b; color: white; padding: 8px 12px; }

.main-grid {
  height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}
.sidebar {
  background: white; border-right: 1px solid #e3e8f0;
  overflow-y: auto; padding: 16px;
}
.summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid #e3e8f0; border-radius: 14px; overflow: hidden;
}
.summary div { padding: 14px 8px; text-align: center; border-right: 1px solid #e3e8f0; }
.summary div:last-child { border-right: 0; }
.summary span { display: block; font-size: 22px; font-weight: 800; }
.summary small { color: #758198; }

.sidebar-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.sidebar-title h2 { font-size: 17px; margin: 0; }
.small-button { padding: 6px 9px; font-size: 12px; color: #34435f; }

.vehicle-item {
  padding: 13px 12px; border: 1px solid #e4e8ef; border-radius: 12px;
  margin: 8px 0; transition: .15s ease; cursor: pointer;
}
.vehicle-item:hover { border-color: #9bb8ef; background: #f8fbff; }
.vehicle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vehicle-name { font-weight: 750; }
.vehicle-meta { color: #6c7890; font-size: 12px; margin-top: 5px; }
.dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; margin-right: 7px; }
.dot.online { background: #16a34a; }
.dot.offline { background: #d97706; }

.map-section { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; background: #dfe5ec; }

.vehicle-panel {
  position: absolute; right: 18px; top: 18px; width: min(390px, calc(100% - 36px));
  background: white; border-radius: 16px; padding: 18px;
  box-shadow: 0 16px 45px rgba(20, 35, 60, .22);
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-heading h3 { margin: 0 0 7px; font-size: 21px; }
.icon-button { width: 32px; height: 32px; font-size: 20px; }
.badge { display: inline-block; border-radius: 99px; padding: 4px 8px; font-size: 12px; background: #eef2f7; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.metrics div { background: #f5f7fa; border-radius: 11px; padding: 11px; }
.metrics small { display: block; color: #718096; margin-bottom: 4px; }
.metrics strong { font-size: 15px; }
.history-button {
  width: 100%; border: 0; border-radius: 10px; padding: 11px;
  margin-top: 15px; background: #172033; color: white; font-weight: 700;
}

@media (max-width: 800px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: absolute; z-index: 5; width: 280px; height: calc(100vh - 62px); display: none; }
}


/* Leaflet / OpenStreetMap */
.leaflet-container {
  font: inherit;
}
.gps-marker-wrapper {
  background: transparent;
  border: 0;
}
.gps-marker {
  min-width: 58px;
  height: 32px;
  padding: 0 9px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 4px 12px rgba(15,23,42,.28);
  white-space: nowrap;
}
.gps-marker-online { background: #16a34a; }
.gps-marker-offline { background: #d97706; }
.leaflet-control-attribution {
  font-size: 10px;
}
