<?php
/**
 * Shared Leaflet CDN loader — included from any view that renders a map.
 * Leaflet is loaded from unpkg.com (well-established, cached everywhere).
 * If the Tanzania deployment ever needs offline capability, self-host by
 * dropping leaflet.js + leaflet.css into /js/Olibs/leaflet/ and swap the
 * URLs below to PROOT-relative paths.
 */
?>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
      integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="">
<script defer src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
        integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<style>
  .rs-map { height: 68vh; min-height: 420px; border-radius: 6px; }
  .rs-map-full { height: calc(100vh - 220px); min-height: 500px; }
  .marker-truck {
    background: #2626F5; color: #fff; border-radius: 8px;
    padding: 3px 6px; font-size: 11px; font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    white-space: nowrap; border: 2px solid #fff;
  }
  .marker-truck.stale { background: #6B7484; }
  .marker-truck.moving { background: #16A34A; }
  .marker-event {
    background: #DC2626; color: #fff; border-radius: 50%;
    width: 14px; height: 14px; display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,.35); border: 2px solid #fff;
  }
  .marker-event.warn { background: #F59E0B; }
  .marker-event.info { background: #2626F5; }
  .marker-event.crit, .marker-event.critical { background: #DC2626; }
  .leaflet-popup-content { font-size: 12.5px; line-height: 1.35; }
  .leaflet-popup-content .lp-truck { font-weight: 700; color: #2626F5; }
  .rs-live-panel { height: calc(100vh - 220px); overflow-y: auto; }
  .rs-live-row {
    padding: 10px 14px; border-bottom: 1px solid #E2E7EF;
    cursor: pointer; transition: background .15s;
  }
  .rs-live-row:hover { background: #EBEFFA; }
  .rs-live-row.stale { color: #6B7484; background: #F5F7FB; }
  .rs-live-row .rs-live-reg { font-weight: 700; }
  .rs-live-row .rs-live-meta { font-size: 11px; color: #6B7484; }
</style>
