/* DoorForce GPS + MapLibre / MapTiler live map */

.df-empty-state {
  padding: 18px 14px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px dashed var(--df-border, #d1d5db);
  border-radius: 12px;
  background: var(--df-bg-soft, #f5f7fa);
}

.df-gps-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}

.df-gps-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.df-gps-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.df-gps-filter,
.df-gps-action {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--df-border, #d1d5db);
  background: var(--df-card, #fff);
  color: var(--text-primary, #111827);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.df-gps-filter.is-active {
  background: var(--df-accent, #0f4c81);
  border-color: var(--df-accent, #0f4c81);
  color: #fff;
}

.df-gps-filter-count {
  display: inline-block;
  min-width: 1.1em;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.df-gps-action:hover {
  border-color: var(--df-accent, #0f4c81);
  color: var(--df-accent, #0f4c81);
}

.df-live-tech-map-host {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--df-border, #d1d5db);
  background: #e5e7eb;
}

.df-live-tech-map,
#df-live-tech-map.df-live-tech-map,
#df-live-tech-map.df-map-sim {
  position: relative;
  width: 100%;
  height: 420px;
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: #d1d5db !important;
  background-image: none !important;
  z-index: 1;
}

.df-live-tech-map .maplibregl-map,
#df-live-tech-map .maplibregl-canvas-container,
#df-live-tech-map .maplibregl-canvas {
  width: 100%;
  height: 100%;
}

.df-ml-marker {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.df-ml-marker-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--df-accent, #0f4c81);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
}

.df-ml-marker.is-online .df-ml-marker-dot { background: #059669; }
.df-ml-marker.is-driving .df-ml-marker-dot { background: #0369a1; }
.df-ml-marker.is-on-site .df-ml-marker-dot { background: #15803d; }
.df-ml-marker.is-working .df-ml-marker-dot { background: #0f4c81; }
.df-ml-marker.is-paused .df-ml-marker-dot { background: #b45309; }
.df-ml-marker.is-offline .df-ml-marker-dot,
.df-ml-marker.is-stale .df-ml-marker-dot {
  background: #6b7280;
  border-style: dashed;
  opacity: 0.9;
}

.df-ml-popup {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #111827;
  min-width: 180px;
}

.df-ml-popup strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.df-ml-popup.is-stale {
  border-left: 3px solid #b45309;
  padding-left: 8px;
}

.df-ml-stale-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff7ed;
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.df-ml-marker.is-selected .df-ml-marker-dot {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.df-ml-reset-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.df-ml-reset-block > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 6px;
}

.df-ml-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.df-ml-reset-actions button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}

.df-ml-reset-actions button:hover {
  border-color: #0f4c81;
  color: #0f4c81;
}

.df-ml-reset-actions button.is-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.df-gps-emergency-reset {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff7f7;
}

.df-gps-emergency-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.df-gps-emergency-head span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #b91c1c;
}

.df-gps-emergency-reset p {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #6b7280;
}

.df-gps-emergency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.df-gps-action-danger {
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

.df-gps-map-message {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 500;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.df-gps-map-message.is-empty {
  background: rgba(255, 255, 255, 0.94);
  color: #374151;
  border: 1px solid #d1d5db;
}

.df-gps-map-message.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.df-live-pill.is-active {
  background: #15803d;
  color: #fff;
}

.df-live-pill.is-warn {
  background: #ea580c;
  color: #fff;
}

.df-live-pill.is-off {
  background: #6b7280;
  color: #fff;
}

.df-gps-web-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.35;
}

.df-gps-tracking-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 12050;
  max-width: min(560px, 92vw);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}

.df-gps-tracking-banner.is-ok {
  background: #14532d;
  color: #ffffff;
}

.df-gps-tracking-banner.is-warn {
  background: #9a3412;
  color: #ffffff;
}

.df-gps-waiting-list {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  color: #111827;
  font-size: 0.8rem;
  z-index: 500;
  max-height: 96px;
  overflow: auto;
}

.df-gps-waiting-item {
  margin-top: 4px;
  color: #374151;
}

.df-gps-diag {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #f59e0b;
  background: #fffbeb;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 220px;
}

@media (max-width: 1024px) {
  .df-live-tech-map,
  #df-live-tech-map.df-live-tech-map,
  #df-live-tech-map.df-map-sim {
    height: 360px;
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .df-live-tech-map,
  #df-live-tech-map.df-live-tech-map,
  #df-live-tech-map.df-map-sim {
    height: 300px;
    min-height: 300px;
  }

  .df-gps-filter {
    flex: 1 1 auto;
  }
}
