* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 320px;
  bottom: 0;
}

#sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  bottom: 0;
  background: #16213e;
  border-left: 1px solid #0f3460;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar h2 {
  padding: 16px;
  font-size: 1.1rem;
  color: #e94560;
  border-bottom: 1px solid #0f3460;
  flex-shrink: 0;
}

#device-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: #0f3460;
  cursor: pointer;
  transition: background 0.2s;
}

.device-item:hover {
  background: #1a4a8a;
}

.device-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.4);
}

.device-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.device-meta {
  font-size: 0.75rem;
  color: #9aabb8;
}

.device-item.offline .device-dot {
  opacity: 0.4;
}

#status-bar {
  padding: 8px 16px;
  font-size: 0.8rem;
  color: #9aabb8;
  border-top: 1px solid #0f3460;
  flex-shrink: 0;
}

#refresh-info {
  padding: 4px 16px 10px;
  font-size: 0.75rem;
  color: #556677;
  flex-shrink: 0;
}

.leaflet-popup-content-wrapper {
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #0f3460;
}

.leaflet-popup-tip {
  background: #16213e;
}

@media (max-width: 600px) {
  #map {
    right: 0;
    bottom: 200px;
  }

  #sidebar {
    top: auto;
    right: 0;
    left: 0;
    width: 100%;
    height: 200px;
  }
}
