.peta-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.route-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: visible;
  min-height: calc(100vh - 120px);
}

.route-content.boxy {
  padding: 0;
  overflow: visible;
}

.route-map-wrap {
  min-width: 0;
  overflow: hidden;
  border-radius: 10px 0 0 10px;
}

.route-side-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  background: #f8fafc;
  max-height: calc(100vh - 120px);
  min-width: 0;
}

.route-sidebar-toolbar {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.route-sidebar-toolbar .date-toolbar {
  padding-bottom: 0;
}

.route-sidebar-toolbar .date-input {
  flex: 1;
  min-width: 0;
}

.route-sidebar {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.route-sidebar-empty {
  font-size: 0.9rem;
  font-weight: 600;
}

.route-driver-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.route-driver-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.route-driver-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #93a5ff, #6782e5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.route-driver-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.route-driver-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.route-driver-stats .stat-delivered {
  color: #111827;
}

.route-driver-stats .stat-pending {
  color: #2563eb;
}

.route-address-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.route-address-item {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ea580c;
  line-height: 1.45;
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.route-address-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.route-address-time {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 999px;
  padding: 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.route-address-text {
  color: #ea580c;
}

.route-address-coords {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
}

.route-address-item--clickable {
  cursor: pointer;
}

.route-address-item--clickable:hover {
  background: #fff7ed;
}

.route-address-item--clickable:hover .route-address-text {
  text-decoration: underline;
}

.route-address-item--clickable:focus {
  outline: 2px solid #93a5ff;
  outline-offset: 1px;
}

.route-address-item--active {
  background: #ffedd5;
  box-shadow: inset 0 0 0 1px #fdba74;
}

.route-address-index {
  color: #9a3412;
  font-weight: 800;
  min-width: 16px;
}

.route-map-wrap .leaflet-control-layers {
  border: 1px solid rgba(147, 165, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  font-family: "Nunito", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.route-map-wrap .leaflet-control-layers-expanded {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
}

.route-map-wrap .leaflet-control-layers-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.route-measure-control {
  margin-top: 8px;
}

.route-measure-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: #1d4ed8;
  background: #fff;
}

.route-measure-btn:hover,
.route-measure-btn.is-active {
  background: #eff6ff;
  color: #1e40af;
}

.route-measure-btn.is-active {
  box-shadow: inset 0 0 0 2px #93c5ff;
}

.route-map-wrap .leaflet-container.route-measure-active {
  cursor: crosshair;
}

.route-measure-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  min-width: 220px;
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(147, 165, 255, 0.35);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  font-family: "Nunito", sans-serif;
}

.route-measure-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
}

.route-measure-total,
.route-measure-segment {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1d4ed8;
}

.route-measure-segment {
  color: #374151;
  margin-top: 2px;
}

.route-measure-hint {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
}

.route-measure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.route-measure-point-label {
  background: transparent;
  border: 0;
}

.route-measure-point-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.peta-map {
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 480px;
  background: #eef2ff;
}

.route-branch-marker {
  background: transparent;
  border: 0;
}

.route-branch-marker-inner {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: #4f63c7;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-branch-marker-inner::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: rotate(45deg);
}

.route-customer-marker {
  background: transparent;
  border: 0;
}

.route-customer-marker-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
}

.route-customer-marker--fins {
  background: #ecfdf5;
  border-color: #16a34a;
  color: #16a34a;
}

.route-customer-marker--sponji {
  background: #fff7ed;
  border-color: #ea580c;
  color: #ea580c;
}

.route-customer-popup .route-popup-row {
  margin-top: 8px;
}

.route-customer-popup .route-popup-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.route-marker-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
}

.route-marker-popup .leaflet-popup-content {
  margin: 12px 14px;
  max-height: 260px;
  overflow-y: auto;
}

.route-customer-popup .route-popup-total {
  display: block;
  margin-top: 2px;
  color: #111827;
}

.leaflet-popup-content {
  margin: 10px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

@media (max-width: 991.98px) {
  .route-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .route-side-panel {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
    max-height: none;
  }

  .route-sidebar {
    max-height: 420px;
  }

  .peta-map {
    height: 52vh;
    min-height: 320px;
  }
}

@media (max-width: 575.98px) {
  .peta-map {
    height: 48vh;
    min-height: 280px;
  }

  .route-sidebar {
    max-height: 360px;
  }
}
