:root {
  --app-primary: #0d6efd;
  --app-dark: #1c2b39;
}
body {
  background-color: #f4f6f9;
  font-family: "Segoe UI", "Sarabun", sans-serif;
}
.app-navbar {
  background-color: var(--app-dark);
}
.app-sidebar {
  width: 240px;
  min-height: calc(100vh - 56px);
  background-color: #fff;
  border-right: 1px solid #e3e6ea;
}
.sidebar-link {
  display: block;
  padding: .6rem .8rem;
  border-radius: .4rem;
  color: #333;
  text-decoration: none;
  margin-bottom: .25rem;
}
.sidebar-link:hover, .sidebar-link.active {
  background-color: var(--app-primary);
  color: #fff;
}
.app-content {
  min-height: calc(100vh - 56px);
}
#liveMap {
  width: 100%;
  height: 65vh;
  border-radius: .5rem;
  border: 1px solid #dee2e6;
}
.status-badge-active { background-color: #198754; }
.status-badge-completed { background-color: #6c757d; }
.status-badge-cancelled { background-color: #dc3545; }
.driver-row-online {
  background-color: #eefaf3;
}
.driver-row-offline {
  background-color: #f5f6f8;
}
.driver-row-online:hover,
.driver-row-offline:hover {
  filter: brightness(0.98);
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #cfd4da;
}
.legend-swatch-online {
  background-color: #eefaf3;
}
.legend-swatch-offline {
  background-color: #f5f6f8;
}
.legend-filter-btn {
  border: 1px solid #d7dce1;
  background: #ffffff;
  color: #495057;
  border-radius: 999px;
  padding: .15rem .55rem;
  line-height: 1.2;
}
.legend-filter-btn:hover {
  background: #f8f9fa;
}
.legend-filter-btn.active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, .15);
}
.trip-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .45rem 0;
  border-bottom: 1px dashed #dee2e6;
  font-size: .95rem;
}
.trip-metric:last-child {
  border-bottom: 0;
}
#tripDetailMap {
  width: 100%;
  height: 52vh;
  min-height: 320px;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
}
.trip-detail-btn {
  min-width: 130px;
}
#checkinPreviewMap {
  width: 100%;
  height: 320px;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #f8f9fa;
}
.checkin-map-wrap {
  position: relative;
}
.checkin-accuracy-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px dashed #6c757d;
  background: rgba(108, 117, 125, .18);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}
.checkin-accuracy-circle.quality-good {
  border-color: #198754;
  background: rgba(25, 135, 84, .18);
}
.checkin-accuracy-circle.quality-medium {
  border-color: #ffc107;
  background: rgba(255, 193, 7, .18);
}
.checkin-accuracy-circle.quality-low {
  border-color: #dc3545;
  background: rgba(220, 53, 69, .2);
}
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c2b39, #0d6efd);
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.start-drive-screen {
  max-width: 760px;
}
.app-content-no-sidebar {
  max-width: 760px;
  margin: 0 auto;
}
.start-drive-back-btn {
  min-height: 44px;
  font-weight: 600;
}
.start-drive-actions .btn {
  min-height: 48px;
  font-weight: 600;
}
.start-drive-status {
  border-top: 1px dashed #dee2e6;
  padding-top: .85rem;
}
@media (max-width: 767.98px) {
  .start-drive-page .navbar-user-meta,
  .start-drive-page #pwaInstallBtn {
    display: none !important;
  }
  .start-drive-page .navbar-actions {
    gap: .4rem !important;
  }
  .start-drive-page .navbar-brand {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 130px);
  }
  .app-navbar {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }
  .app-content {
    padding: 1rem !important;
  }
  .app-content-no-sidebar {
    max-width: 100%;
    margin: 0;
  }
  .start-drive-screen h4 {
    font-size: 1.2rem;
  }
  .start-drive-actions .btn {
    font-size: 1rem;
  }
  .start-drive-status .badge {
    font-size: .9rem;
  }
  #checkinPreviewMap {
    height: 260px;
  }
}
