:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #ff4f9a;
  --accent2: #ffb347;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; }

#sidebar { width: 320px; flex-shrink: 0; height: 100%; overflow-y: auto; background: var(--panel);
  border-right: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 14px; z-index: 1000; }
h1 { margin: 0; font-size: 22px; background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { margin: 0 0 6px; font-size: 15px; }
.tag, .muted { color: var(--muted); margin: 2px 0 0; font-size: 12px; }

.progress-label { margin-bottom: 6px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }

input, select, textarea, button, .button {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; }
button, .button { cursor: pointer; text-align: center; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); }
.danger:hover { border-color: #ff5555; color: #ff7777; }
.toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.toggle input { width: auto; }

#categories { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#categories li label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
#categories li label:hover { background: var(--bg); }
#categories input { width: auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.count { margin-left: auto; color: var(--muted); font-size: 12px; }

#edit-panel { border: 1px dashed var(--accent); border-radius: 8px; padding: 10px; }
#edit-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.actions .danger { grid-column: span 2; }
footer { margin-top: auto; color: var(--muted); font-size: 11px; }

#map { flex: 1; height: 100%;
  background-color: #0b2233;
  background-image: linear-gradient(#123a52 1px, transparent 1px), linear-gradient(90deg, #123a52 1px, transparent 1px);
  background-size: 50px 50px; }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
.leaflet-popup-content h3 { margin: 0 0 4px; font-size: 15px; }
.leaflet-popup-content p { margin: 4px 0 8px; }
.popup-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.marker { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.marker.found { opacity: .35; border-style: dashed; }

#menu { display: none; position: fixed; top: 10px; left: 10px; z-index: 1100; width: 42px; height: 42px; font-size: 20px; }
@media (max-width: 760px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .25s; width: 85vw; }
  #sidebar.open { transform: none; }
  #menu { display: block; }
}
