/* ---------- Generic components (complements Tailwind utilities) ---------- */
.section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #475569; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #2563eb; color: #fff; font-weight: 600; font-size: .875rem;
  padding: .65rem 1rem; border-radius: .6rem; transition: background .15s, transform .05s;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08);
}
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  background: #fff; color: #334155; font-weight: 500; border: 1px solid #cbd5e1;
  padding: .45rem .75rem; border-radius: .5rem; transition: background .15s;
}
.btn-secondary:hover { background: #f1f5f9; }

.chip { padding: .2rem .55rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.chip-neutral { background: #334155; color: #cbd5e1; }
.chip-ok { background: #14532d; color: #bbf7d0; }
.chip-warn { background: #713f12; color: #fde68a; }
.chip-off { background: #7f1d1d; color: #fecaca; }

/* Segmented radio control */
.segmented { display: inline-flex; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: .5rem; padding: 2px; }
.segmented-option { cursor: pointer; }
.segmented-option > span {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  padding: .3rem .6rem; border-radius: .4rem; font-size: 11px; font-weight: 500; color: #475569;
  transition: all .15s; white-space: nowrap;
}
.segmented-option input:checked + span { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgb(0 0 0 / .12); font-weight: 600; }
.segmented-option input:focus-visible + span { outline: 2px solid #2563eb; outline-offset: 1px; }

/* Checkbox row */
.checkbox-row { display: flex; gap: .6rem; align-items: flex-start; font-size: .8rem; cursor: pointer; }
.checkbox { margin-top: .15rem; width: 1rem; height: 1rem; accent-color: #2563eb; flex-shrink: 0; }

/* Range */
.range { accent-color: #2563eb; height: 1.1rem; }

/* Sidebar scrollbar */
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

/* Skeleton shimmer */
.skeleton {
  border-radius: .5rem;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.spinner {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 3px solid #e2e8f0; border-top-color: #2563eb;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts */
.toast {
  min-width: 260px; max-width: 360px; padding: .7rem .9rem; border-radius: .6rem; font-size: .8rem;
  color: #fff; box-shadow: 0 10px 25px rgb(0 0 0 / .18); animation: toast-in .2s ease-out;
}
.toast-info { background: #1e293b; }
.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-warn { background: #b45309; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Map markers ---------- */
.marker-depot { position: relative; width: 44px; height: 52px; }
.marker-depot svg { width: 44px; height: 44px; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .35)); }
.marker-depot .marker-shadow { position: absolute; bottom: 2px; left: 50%; width: 22px; height: 8px; transform: translateX(-50%); background: rgb(0 0 0 / .25); border-radius: 50%; filter: blur(2px); }

.marker-stop { position: relative; width: 34px; height: 44px; }
.marker-stop .pin {
  position: absolute; left: 50%; top: 0; width: 30px; height: 30px; margin-left: -15px;
  background: var(--pin, #475569); border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 3px 6px rgb(0 0 0 / .35); transition: background .3s;
}
.marker-stop .pin-label {
  position: absolute; left: 50%; top: 5px; width: 30px; margin-left: -15px; text-align: center;
  font: 700 12px/20px Inter, system-ui, sans-serif; color: #fff; pointer-events: none;
}
.marker-stop .demand-badge {
  position: absolute; right: -4px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  background: #0f172a; color: #fff; border: 2px solid #fff; border-radius: 999px;
  font: 700 10px/14px Inter, system-ui, sans-serif; text-align: center; box-shadow: 0 1px 3px rgb(0 0 0 / .3);
}
.marker-stop.out-of-bounds .pin { background: #94a3b8; opacity: .8; }
.marker-stop.unserved .pin { background: #f59e0b; }

/* Popups */
.leaflet-popup-content-wrapper { border-radius: .75rem; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
.leaflet-popup-content { margin: 12px 14px; font-family: Inter, system-ui, sans-serif; font-size: 12px; line-height: 1.35; min-width: 230px; }
.popup-title { font-weight: 600; font-size: 13px; color: #0f172a; margin-bottom: 2px; padding-right: 12px; }
.popup-sub { color: #64748b; font-size: 11px; margin-bottom: 8px; }
.popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.popup-grid label { display: block; }
.popup-grid span { display: block; color: #64748b; font-size: 10px; margin-bottom: 2px; }
.popup-grid input { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.popup-actions { display: flex; gap: 6px; margin-top: 10px; }
.popup-actions button { flex: 1; border-radius: 6px; padding: 5px 8px; font-size: 11px; font-weight: 600; border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.popup-actions button:hover { background: #f1f5f9; }
.popup-actions button.danger { color: #b91c1c; border-color: #fecaca; }
.popup-actions button.danger:hover { background: #fef2f2; }

/* Route polylines get a subtle animated dash while geometry is "straight" (pending road snap) */
.route-pending { stroke-dasharray: 8 8; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }

/* Google Places dropdown should sit above Leaflet */
.pac-container { z-index: 3000 !important; font-family: Inter, system-ui, sans-serif; border-radius: .5rem; margin-top: 4px; }
gmp-place-autocomplete { width: 100%; }
