:root { --sidebar-w: 20rem; }

html, body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; }

/* ---------- Sidebar ---------- */
.sidebar { transition: transform .25s ease; }
@media (max-width: 767px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
}

.panel { background: #0f172a; border: 1px solid #1e293b; border-radius: .75rem; padding: .85rem; }
.panel-title { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #38bdf8; margin: 0 0 .6rem; font-weight: 700; }
.row { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .8rem; cursor: pointer; user-select: none; }
.row input { accent-color: #38bdf8; width: 15px; height: 15px; }
.row em { margin-left: auto; font-style: normal; font-size: .7rem; color: #64748b; }
.swatch { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.swatch.round { width: 11px; height: 11px; border-radius: 50%; }
.stat { background: #020617; border: 1px solid #1e293b; border-radius: .6rem; padding: .55rem; }
.stat b { display: block; font-size: 1.15rem; color: #f8fafc; }
.stat span { font-size: .65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Auto-suggest ---------- */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #0f172a; border: 1px solid #334155;
  border-radius: .6rem; max-height: 240px; overflow-y: auto; z-index: 50; box-shadow: 0 10px 25px rgba(0,0,0,.5); }
.suggest li { padding: .5rem .75rem; font-size: .8rem; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04); }
.suggest li:last-child { border-bottom: 0; }
.suggest li:hover, .suggest li.active { background: #1e293b; }
.suggest small { display: block; color: #64748b; font-size: .68rem; }

/* ---------- Detail ---------- */
.kv { display: flex; justify-content: space-between; gap: .75rem; font-size: .78rem; padding: .25rem 0; border-bottom: 1px dashed #1e293b; }
.kv span:first-child { color: #94a3b8; }
.kv span:last-child { text-align: right; font-weight: 600; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #020617; }
.badge.Online { background: #34d399; }
.badge.Degradation { background: #fbbf24; }
.badge.Maintenance { background: #f87171; }

/* ---------- Marker pulsing ---------- */
.pulse-wrap { background: transparent; border: 0; }
.pulse-marker { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--c);
  border: 2px solid #fff; box-shadow: 0 0 8px 2px var(--c); }
.pulse-marker::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--c);
  opacity: 0; animation: pulse 2.2s ease-out infinite; }
.pulse-marker.Degradation::after { animation-duration: 1.2s; }
.pulse-marker.Maintenance { filter: grayscale(.6); }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- Leaflet tweak ---------- */
.leaflet-popup-content-wrapper { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: .7rem; }
.leaflet-popup-tip { background: #0f172a; }
.leaflet-popup-content { margin: .8rem 1rem; font-size: .8rem; }
.leaflet-popup-content h4 { margin: 0 0 .35rem; font-size: .95rem; }
.leaflet-container { background: #e5e7eb; }

.legend { position: absolute; right: 12px; bottom: 24px; z-index: 900; background: rgba(15,23,42,.92); border: 1px solid #334155;
  border-radius: .7rem; padding: .6rem .8rem; font-size: .72rem; color: #e2e8f0; line-height: 1.7; }
.legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.legend .dashed i { background: repeating-linear-gradient(90deg,#94a3b8 0 5px,transparent 5px 9px); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
