* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f0f0;
}

/* ── Mapa ──────────────────────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Panel de información ──────────────────────────────────────────────── */
#panel {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;

  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);

  width: min(480px, calc(100vw - 32px));
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon {
  font-size: 18px;
}

#tracker-id {
  font-weight: 700;
  font-size: 16px;
  flex: 1;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge.online {
  background: #d4edda;
  color: #155724;
}

.badge.offline {
  background: #e2e3e5;
  color: #383d41;
}

.divider {
  height: 1px;
  background: #e9ecef;
  margin: 12px 0;
}

/* ── Select de dispositivo ─────────────────────────────────────────────── */
.tracker-select {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  max-width: 200px;
}


.metrics {
  display: flex;
  gap: 4px;
}

.metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
}

.metric-icon {
  font-size: 18px;
}

.metric-label {
  font-size: 10px;
  color: #6c757d;
}

.metric-value {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

/* ── Coordenadas ───────────────────────────────────────────────────────── */
.coords {
  margin-top: 8px;
  font-size: 11px;
  color: #6c757d;
  min-height: 16px;
}

/* ── Botón centrar ─────────────────────────────────────────────────────── */
#btn-center {
  position: fixed;
  bottom: 160px;
  left: 16px;
  z-index: 1000;

  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.15s;
}

#btn-center:hover {
  transform: scale(1.1);
}

#btn-center:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* ── Icono del marcador tracker ────────────────────────────────────────── */
.tracker-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

.user-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* ── Pulsación en el marcador tracker ──────────────────────────────────── */
@keyframes pulse {
  0%   { transform: scale(1);    opacity: 1; }
  50%  { transform: scale(1.25); opacity: 0.7; }
  100% { transform: scale(1);    opacity: 1; }
}

.tracker-icon.updated {
  animation: pulse 0.6s ease-in-out;
}
