* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body, html { width: 100%; height: 100%; overflow: hidden; background: #f3f4f6; }

#app-container { position: relative; width: 100%; height: 100vh; display: flex; flex-direction: column; }
#map { width: 100%; height: 100%; z-index: 1; background: #e5e3df; }

.menu-bar-left {
  position: absolute; top: 12px; left: 12px; z-index: 1000; display: flex; gap: 8px; flex-direction: column;
}

.top-bar-right {
  position: absolute; top: 12px; right: 12px; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: flex-end;
}

.btn-icon-menu {
  width: 38px; height: 38px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08); border: none; font-size: 15px; color: #333; cursor: pointer;
  flex-shrink: 0;
}

.btn-close-modal {
  width: 36px; height: 36px; background: #ff5500; border: 2px solid #ffffff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #ffffff; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.btn-install-badge {
  background: #5046e5; color: white; border-radius: 19px; padding: 0 14px; height: 38px;
  display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(80,70,229,0.3); border: none; cursor: pointer; text-transform: uppercase;
}

.stats-card {
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px);
  border-radius: 16px; padding: 6px 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-size: 8px; font-weight: 700; color: #9ca3af; letter-spacing: 0.5px; text-transform: uppercase; }
.stat-value { font-size: 11px; font-weight: 800; color: #1f2937; margin-top: 1px; }
.stat-divider { width: 1px; height: 18px; background-color: rgba(229, 231, 235, 0.8); }

.bottom-sheet {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(252, 252, 254, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top-left-radius: 22px; border-top-right-radius: 22px; padding: 14px 18px 22px 18px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.sheet-handle { width: 36px; height: 4px; background: #e5e5ea; border-radius: 2px; margin: 0 auto 10px auto; }

.tags-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.tags-right-group { display: flex; gap: 8px; align-items: center; }

.step-counter-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  background: transparent;
  border: none;
  padding: 0;
  margin-right: 4px;
}

.step-counter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #5046e5;
  display: inline-block;
}

.tag-blue { 
  background: #eeefff; color: #5046e5; padding: 6px 12px; border-radius: 12px; 
  font-size: 10px; font-weight: 800; text-transform: uppercase; display: inline-flex; align-items: center;
  border: none;
}

.tag-packages-btn {
  background: #fff2ec; color: #ff5500; padding: 6px 12px; 
  border-radius: 12px; font-size: 10px; font-weight: 800; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; text-transform: uppercase; border: none;
}

.address-title { 
  font-size: 13px; font-weight: 700; color: #111827; margin-top: 6px; margin-bottom: 3px; 
  text-transform: uppercase; line-height: 1.35; white-space: normal; word-break: break-word; overflow: visible;
}
.address-subtitle { font-size: 11px; color: #6b7280; margin-bottom: 14px; line-height: 1.3; }

.actions-row { display: flex; gap: 10px; margin-top: 6px; }
.btn-waze-blue {
  flex: 1; height: 44px; background: #5046e5; color: white; border: none;
  border-radius: 22px; font-weight: 700; font-size: 12px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(80, 70, 229, 0.3);
}
.btn-start-route {
  flex: 1; height: 44px; background: #5046e5; color: white; border: none;
  border-radius: 22px; font-weight: 700; font-size: 13px; display: flex;
  align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 70, 229, 0.3);
}
.btn-fail {
  flex: 1; height: 44px; background: #f1f5f9; color: #dc2626; border: none;
  border-radius: 22px; font-weight: 700; font-size: 10px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.08);
}
.btn-success {
  flex: 1.2; height: 44px; background: #059669; color: white; border: none;
  border-radius: 22px; font-weight: 700; font-size: 10px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.modal {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: white;
  z-index: 2000; display: none; flex-direction: column;
}
.modal.active { display: flex; }

.modal-header { padding: 12px 16px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 14px; font-weight: 700; color: #1f2937; }

.modal-body { flex: 1; overflow-y: auto; padding: 12px 16px; background: #f8fafc; }

.stop-item {
  padding: 12px; border-radius: 12px; background: #ffffff; border: 1px solid #e2e8f0;
  margin-bottom: 10px; display: flex; flex-direction: column; align-items: stretch; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stop-item.completed { background: #f0fdf4; border-color: #bbf7d0; }
.stop-item.failed { background: #fef2f2; border-color: #fecaca; }

.stop-badge {
  background: #5046e5; color: white; padding: 4px 8px; border-radius: 8px;
  font-size: 10px; font-weight: 800; display: inline-block;
}
.upload-btn {
  width: 100%; padding: 10px; background: #5046e5; color: white; border: none;
  border-radius: 10px; font-weight: 700; font-size: 11px; margin-bottom: 12px; cursor: pointer; text-align: center; display: block;
}

.custom-pin-wrapper { position: relative; width: 42px; height: 42px; display: flex; justify-content: center; align-items: flex-start; cursor: pointer; }
.custom-pin {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  background: #5046e5; color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px; border: 2px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}
.custom-pin::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #5046e5;
}
.pkg-badge {
  position: absolute; top: -4px; right: -10px; width: 16px; height: 16px; border-radius: 50%;
  background: #ffffff; color: #ff5500; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); border: 1px solid #ff5500; z-index: 10;
}
.custom-pin.active { width: 32px; height: 32px; font-size: 12px; background: #ff5500; color: #ffffff; z-index: 999; }
.custom-pin.active::after { border-top-color: #ff5500; }
.custom-pin.done { background: #10b981; color: white; }
.custom-pin.done::after { border-top-color: #10b981; }
.custom-pin.failed { background: #ef4444; color: white; }
.custom-pin.failed::after { border-top-color: #ef4444; }

/* Cor diferenciada para paradas sem coordenadas reais*/
.custom-pin.no-coords { background: #c207cb; color: white; }
.custom-pin.no-coords::after { border-top-color: #c207cb; }

.gps-pin-container { background: transparent; border: none; cursor: pointer; }
.gps-marker-ring {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(225, 29, 72, 0.2); border: 2px solid #e11d48;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.5);
  animation: pulse-ring 2s infinite;
}
.gps-marker-inner { width: 12px; height: 12px; background: #ffffff; border: 3px solid #e11d48; border-radius: 50%; }
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
