.donut-cluster-wrapper {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.donut-cluster-wrapper:hover {
  transform: scale(1.12);
}
.donut-tooltip {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translate(-50%);
  background: #282828e6;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 99;
}
.donut-cluster-wrapper:hover .donut-tooltip {
  opacity: 1;
}
.device-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 3px #0000004d;
}
.pulse-alerting {
  animation: pulseGlow 2.2s infinite;
  border-radius: 50%;
}
.donut-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  z-index: 4;
  transform-origin: 50% 50%;
  transition: box-shadow 0.2s ease;
}
.donut-cluster .arc {
  cursor: pointer;
  transition:
    filter 0.2s ease,
    stroke-width 0.2s ease;
}
.donut-cluster .arc:hover {
  filter: brightness(1.15);
  stroke-width: 12px;
}
.leaflet-marker-icon.donut-cluster {
  overflow: visible !important;
}
.device-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 2px #0006;
}
.pulse-marker {
  animation: pulseMarker 2s infinite;
  transform-origin: center;
}
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 #f39c1299;
  }
  70% {
    box-shadow: 0 0 0 8px #f39c1200;
  }
  to {
    box-shadow: 0 0 #f39c1200;
  }
}
@keyframes pulseMarker {
  0% {
    transform: scale(1);
    box-shadow: 0 0 #f39c1299;
  }
  70% {
    transform: scale(1.6);
    box-shadow: 0 0 0 10px #f39c1200;
  }
  to {
    transform: scale(1);
    box-shadow: 0 0 #f39c1200;
  }
}
.meraki-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: 320px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #ddd;
  box-shadow: -3px 0 8px #00000026;
  transform: translate(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
}
.meraki-panel:not(.hidden) {
  transform: translate(0);
}
.panel-header {
  background: #f7f8fa;
  padding: 10px 14px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header button {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
}
.panel-header button:hover {
  color: #111;
}
.panel-content {
  padding: 12px;
  overflow-y: auto;
  font-size: 13px;
}
.seg-online:hover {
  box-shadow: 0 0 8px 2px #2ecc71cc inset;
}
.seg-alerting:hover {
  box-shadow: 0 0 8px 2px #f39c12cc inset;
}
.seg-offline:hover {
  box-shadow: 0 0 8px 2px #e74c3ccc inset;
}
.seg-dormant:hover {
  box-shadow: 0 0 8px 2px #95a5a6cc inset;
}
.leaflet-control-meraki-legend {
  background: #fffffff2;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px #0003;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  min-width: 160px;
}
.leaflet-left .leaflet-control-meraki-legend {
  margin-bottom: 25px; /* Eleva a legenda acima da escala e coordenadas */
  margin-left: 12px;
}
.meraki-legend-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  text-align: center;
}
.meraki-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.meraki-legend-item {
  display: flex;
  align-items: center;
  margin: 4px 0;
  position: relative;
}
.meraki-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
}
@keyframes pulseStatus {
  0% {
    box-shadow: 0 0 #f39c1299;
  }
  70% {
    box-shadow: 0 0 0 8px #f39c1200;
  }
  to {
    box-shadow: 0 0 #f39c1200;
  }
}
.pulse-status .meraki-status-dot {
  animation: pulseStatus 2.2s infinite;
}

/* ============================================================
   MERAKI PREMIUM POPUP — SMART CITIES DESIGN SYSTEM
   ============================================================ */

/* --- Leaflet Shell Overrides --- */
.leaflet-popup-content-wrapper {
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.10) !important;
  border: none !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
}
.leaflet-popup-tip-container {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}
.leaflet-popup-close-button {
  top: 12px !important;
  right: 14px !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: rgba(255,255,255,0.55) !important;
  font-weight: 300 !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
  background: transparent !important;
}
.leaflet-popup-close-button:hover {
  color: #ffffff !important;
  transform: scale(1.25) !important;
  background: transparent !important;
}

/* --- Container --- */
.meraki-popup-container {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  border-radius: 14px;
  color: #1e293b;
}

/* --- Header (Dark) --- */
.meraki-popup-header {
  background: linear-gradient(145deg, #587da9 0%, #46658b 100%);
  padding: 16px 18px 14px 18px;
  position: relative;
}
.meraki-popup-header-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.meraki-popup-device-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 10px 0;
  padding-right: 28px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.meraki-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fff;
  padding: 4px 11px 4px 8px;
  border-radius: 20px;
  width: fit-content;
}
.meraki-badge-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

/* Organic pulse for "Em Alerta" */
@keyframes merakiBadgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.45); }
  65%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
@keyframes merakiDotPulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.7); opacity: 0.4; }
  100% { transform: scale(1);   opacity: 1; }
}
.meraki-status-badge.alerting {
  animation: merakiBadgePulse 2.2s ease-in-out infinite;
}
.meraki-status-badge.alerting .meraki-badge-dot {
  animation: merakiDotPulse 2.2s ease-in-out infinite;
}

/* --- Body (White) --- */
.meraki-popup-body {
  background: #ffffff;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Info Cards --- */
.meraki-info-card {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  padding: 10px 12px;
}
.meraki-info-card--address {
  background: #fffbf0;
  border-color: #fde68a;
}
.meraki-card-title {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.meraki-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #eef2f7;
}
.meraki-popup-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.meraki-popup-row--address {
  align-items: flex-start;
}
.meraki-popup-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
  padding-top: 1px;
}
.meraki-popup-value {
  font-size: 11px;
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  max-width: 170px;
}
.meraki-popup-value.missing {
  color: inherit;
  font-style: italic;
  font-weight: 400;
}

/* --- Address with Maps Link --- */
.meraki-address-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  white-space: normal;
  font-size: 11px;
  line-height: 1.4;
}
.meraki-maps-link {
  display: inline-block;
  color: #f59e0b;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  margin-top: 1px;
}
.meraki-maps-link:hover {
  color: #d97706;
  transform: scale(1.05);
}
