.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 {
  position: relative;
  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-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.route-sidebar-summary em {
  font-style: normal;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  min-width: 1.6em;
  padding: 1px 8px;
  text-align: center;
}

.route-driver-stats .stat-moving {
  color: #0f766e;
}

.route-moving-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-moving-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f766e;
}

.route-moving-item i {
  margin-top: 2px;
}

.route-moving-item--clickable {
  cursor: pointer;
}

.route-moving-item--clickable:hover {
  background: #ccfbf1;
}

.route-moving-item--clickable:focus {
  outline: 2px solid #5eead4;
  outline-offset: 1px;
}

.route-moving-item--active {
  background: #99f6e4;
  box-shadow: inset 0 0 0 1px #2dd4bf;
}

.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);
  cursor: pointer;
}

.route-driver-card:hover {
  border-color: #93a5ff;
  box-shadow: 0 0 0 1px rgba(103, 130, 229, 0.16);
}

.route-driver-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.route-driver-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.route-driver-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.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;
}

.route-driver-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
  display: block;
  box-sizing: border-box;
}

.route-driver-status.is-active {
  background: #16a34a;
}

.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-item.is-delivered,
.route-address-item.is-delivered .route-address-text,
.route-address-item.is-delivered .route-address-index,
.route-moving-item.is-delivered {
  color: #16a34a;
}

.route-address-item.is-pending,
.route-address-item.is-pending .route-address-text,
.route-address-item.is-pending .route-address-index,
.route-moving-item.is-pending {
  color: #dc2626;
}

.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.ops-geocode-tag-active {
  cursor: crosshair;
}

.route-map-wrap .ops-geocode-panel {
  left: 12px;
  right: auto;
  top: 12px;
}

.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;
}

.peta-store-marker,
.peta-customer-marker,
.peta-driver-marker-wrap {
  background: transparent;
  border: 0;
}

.peta-store-marker-inner {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.35);
  font-size: 17px;
}

.peta-store-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  border: 1px solid #fff;
}

.peta-customer-marker-inner {
  width: 30px;
  height: 30px;
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.peta-customer-marker-inner i {
  transform: rotate(45deg);
  font-size: 0.85rem;
}

.peta-customer-marker--fins {
  background: #dc2626;
}

.peta-customer-marker--sponji {
  background: #7c3aed;
}

.peta-driver-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}

.peta-driver-marker i {
  font-size: 13px;
}

.peta-driver-marker span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.peta-driver-marker.is-online {
  background: #16a34a;
}

.peta-driver-marker.is-delivery {
  background: #ea580c;
}

.peta-popup-kind {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.peta-moving-popup-id,
.peta-moving-popup-route {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f766e;
  margin-top: 4px;
}

.peta-moving-popup-route {
  color: #115e59;
}

.peta-moving-popup-section {
  margin-top: 8px;
}

.peta-moving-popup-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.peta-moving-popup-products {
  margin: 0;
  padding-left: 16px;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

.peta-moving-popup-products li {
  margin: 1px 0;
}

.peta-moving-popup-empty {
  color: #94a3b8;
  font-size: 0.8rem;
}

.peta-moving-popup-notes {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  white-space: pre-wrap;
}

.peta-moving-popup-row {
  padding: 6px 0;
  border-top: 1px solid #e2e8f0;
}

.peta-moving-popup-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.peta-driver-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.peta-driver-popup-head strong {
  min-width: 0;
  line-height: 1.25;
  display: block;
}

.peta-driver-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #2563eb;
  flex-shrink: 0;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.peta-driver-play-btn:hover,
.peta-driver-play-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.peta-driver-play-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}

.peta-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  min-width: 196px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  font-family: "Nunito", sans-serif;
}

.peta-legend-title {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.peta-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.peta-legend-item input {
  margin: 0;
}

.peta-legend-item em {
  margin-left: auto;
  font-style: normal;
  font-weight: 800;
  color: #0f172a;
}

.peta-legend-swatch {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.peta-legend-swatch--store {
  border-radius: 6px;
  background: #0f766e;
}

.peta-legend-swatch--customer {
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  background: #dc2626;
}

.peta-legend-swatch--customer i {
  transform: rotate(45deg);
  font-size: 11px;
}

.peta-legend-swatch--driver {
  border-radius: 50%;
  background: #2563eb;
}

.peta-legend-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.peta-legend-sub span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.peta-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.peta-legend-dot--delivery {
  background: #ea580c;
}

.peta-legend-dot--online {
  background: #16a34a;
}

.peta-legend-dot--offline {
  background: #64748b;
}

.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: none;
  overflow: visible;
}

.route-customer-popup .route-popup-total {
  display: block;
  margin-top: 2px;
  color: #111827;
}

.route-popup-photos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.route-popup-photos img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #f8fafc;
}

.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-legend {
    left: 8px;
    bottom: 8px;
    min-width: 168px;
    padding: 8px 10px;
  }

  .peta-map {
    height: 48vh;
    min-height: 280px;
  }

  .route-sidebar {
    max-height: 360px;
  }
}
