:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #3d8bfd;
  --danger: #ff5c5c;
  --ok: #3dd68c;
  --border: #2a3548;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; gap: 10px; align-items: center; }
.logo { font-size: 22px; }
.sub { font-size: 12px; color: var(--muted); }
.stats { display: flex; gap: 12px; align-items: center; font-size: 14px; }

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #666;
  box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.4);
}
.dot.on {
  background: var(--ok);
  animation: pulse 2s infinite;
}
.dot.off { background: var(--danger); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(61, 214, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow: auto;
}

.sidebar h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 8px;
}

.sidebar ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  background: #121a26;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.k {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #243044;
}
.k.dps { border: 1px solid #ff5c5c; }
.k.post { border: 1px solid #f0b429; }
.k.motobat { border: 1px solid #3d8bfd; }
.k.camera { border: 1px solid #b07cff; }

.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  background: #121a26;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
}
.feed-item .t { color: var(--text); margin-bottom: 4px; }
.feed-item .m { color: var(--muted); font-size: 11px; }

#map { width: 100%; height: 100%; background: #2b3340; }

.leaflet-container { background: #2b3340; font: inherit; }

/* Скрыть атрибуцию OpenStreetMap / любые плашки в углу */
.leaflet-control-attribution,
.leaflet-bottom.leaflet-right .leaflet-control-attribution {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Mid-dark: светлый Positron приглушаем до средне-серого,
   чтобы не выедало глаза и не конкурировало с маркерами */
.map-tiles-muted {
  filter: brightness(0.78) saturate(0.55) contrast(1.05);
}
.leaflet-marker-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45));
}
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.marker-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-check {
  transform: rotate(45deg);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.street-blob {
  filter: blur(0.2px);
}
.feed-item.is-clear { border-color: #2d6b4f; }
.feed-item.is-active { border-color: #6b2d2d; }
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-right: 4px;
}
.badge.active { background: #5c1f1f; color: #ff8a8a; }
.badge.clear { background: #1a3d2c; color: #3dd68c; }
.k.clear { border: 1px solid #3dd68c; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1f2a3d;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast.hidden { display: none; }

@media (max-width: 800px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 180px;
  }
  .sidebar {
    grid-row: 3;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  #map { grid-row: 2; min-height: 50vh; }
}
