/* APMap — identità visiva
   Palette: petrolio #0F5E63 (rete), inchiostro #0C1E24 (sidebar),
   ambra #E8A33D (segnalazioni), carta #F4F6F6, bianco superficie. */

:root {
  --ap-petrol: #0F5E63;
  --ap-ink: #0C1E24;
  --ap-amber: #E8A33D;
  --ap-paper: #F4F6F6;
}

html, body { overscroll-behavior: none; }

.v-application {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* numeri tecnici (MAC, SN, IP) sempre in tabulare/mono */
.mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace; font-size: .85em; letter-spacing: .02em; }

.brand-title { font-weight: 700; letter-spacing: .04em; }
.brand-title .accent { color: var(--ap-amber); }
.brand-bar { gap: 10px; }
.brand-bar .brand-logo {
  max-height: 36px; max-width: 120px; object-fit: contain;
  background: #fff; border-radius: 6px; padding: 3px 5px;
}

/* ---------- Marker AP sulla planimetria: cerchio con onde wifi ---------- */
.ap-marker {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ap-petrol); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  border: 2px solid #fff; cursor: pointer;
}
.ap-marker.draggable { background: var(--ap-amber); animation: ap-pulse 1.4s ease-out infinite; }
.ap-marker.unsaved { background: #C24536; }
@keyframes ap-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,163,61,.55); }
  100% { box-shadow: 0 0 0 16px rgba(232,163,61,0); }
}
@media (prefers-reduced-motion: reduce) {
  .ap-marker.draggable { animation: none; }
}

/* ---------- Marker sede sulla mappa geografica ---------- */
.site-marker {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--ap-petrol); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.site-marker i { transform: rotate(45deg); color: #fff; font-size: 16px; }
.site-marker.empty { background: #6B7C80; }

/* ---------- Marker sede a pallino con conteggio (stile dashboard) ---------- */
.site-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  font-weight: 700; color: #fff; font-size: 14px;
}
.site-badge.ok { background: #3FA34D; }
.site-badge.empty { background: #E8A33D; }
.site-badge .badge-count { line-height: 1; }
.site-badge i { font-size: 18px; }

/* ---------- Pin GPS con etichetta codice sede ---------- */
.site-pin { position: relative; display: inline-flex; align-items: center; white-space: nowrap; }
.site-pin > i { font-size: 30px; line-height: 1; }
.site-pin.ok > i { color: #3FA34D; }
.site-pin.empty > i { color: #E8A33D; }
.site-pin > i { -webkit-text-stroke: 1.5px #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.site-pin-label {
  position: absolute; left: 26px; top: 2px;
  background: #fff; border-radius: 4px; padding: 1px 6px;
  font-size: 11px; font-weight: 700; color: #2A3B3D;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* ---------- Banner sedi senza coordinate ---------- */
.map-geo-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 600; max-width: 90%;
}
.map-geo-tools { position: absolute; top: 12px; right: 12px; z-index: 600; }

/* ---------- Legenda mappa ---------- */
.map-legend {
  position: absolute; left: 12px; bottom: 26px; z-index: 500;
  background: #fff; border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 12px; line-height: 1.7;
}
.map-legend .legend-title { font-weight: 700; margin-bottom: 4px; }
.map-legend .legend-row { display: flex; align-items: center; }
.map-legend .legend-dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.map-legend .legend-dot.ok { background: #3FA34D; }
.map-legend .legend-dot.empty { background: #E8A33D; }

/* ---------- Riga tabella selezionata ---------- */
.row-selected { background: rgba(15,94,99,.07); }

/* ---------- Popup AP sulla planimetria (clic / touch) ---------- */
.ap-pop { min-width: 180px; }
.ap-pop-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--ap-petrol); }
.ap-pop-row { font-size: 12.5px; line-height: 1.5; }
.ap-pop-actions { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ap-pop-btn {
  border: none; border-radius: 6px; padding: 7px 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: #fff; background: var(--ap-petrol);
}
.ap-pop-btn.move { background: var(--ap-amber); }
.ap-pop-btn:hover { filter: brightness(1.08); }
.leaflet-popup-content { margin: 12px 14px; }

/* ---------- Viewer planimetria ---------- */
.plan-viewer { position: relative; background: #E8ECEC; border-radius: 8px; overflow: hidden; }
.plan-viewer .leaflet-container { background: #E8ECEC; }
.plan-toolbar {
  position: absolute; top: 10px; right: 10px; z-index: 800;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.plan-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 800; background: rgba(12,30,36,.88); color: #fff;
  padding: 6px 14px; border-radius: 20px; font-size: .8rem; white-space: nowrap;
}

/* ---------- Mappa Home fullscreen ---------- */
.home-map-wrap { position: relative; height: calc(100dvh - 64px); }
.home-map { position: absolute; inset: 0; }
.map-filter-card {
  position: absolute; top: 12px; left: 12px; z-index: 900;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100% - 24px); overflow: auto;
  backdrop-filter: blur(6px);
}

.leaflet-tooltip.ap-tip { padding: 8px 10px; line-height: 1.35; }

/* ---------- Sidebar ---------- */
.v-navigation-drawer .v-list-item--active {
  border-left: 3px solid var(--ap-amber);
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .home-map-wrap { height: calc(100dvh - 56px); }
  .map-filter-card { width: calc(100vw - 24px); max-height: 55%; }
  .v-data-table { font-size: .8rem; }
}

:focus-visible { outline: 2px solid var(--ap-amber); outline-offset: 1px; }

.kpi-number { font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
