/* === Базовые переменные и глобальные стили === */
:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Верхняя панель === */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.brand {
  font-weight: 700;
  letter-spacing: .2px;
}

.actions {
  display: flex;
  gap: 8px;
}

/* === Кнопки === */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.btn:hover {
  background: color-mix(in srgb, var(--border) 25%, transparent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* === Модалки === */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  z-index: 1200;
}

.modal.hidden {
  display: none;
}

.card {
  width: min(520px, 92vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

.card h2 {
  margin: 0 0 10px;
}

.card label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0;
}

.card textarea,
.card select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* === Leaflet === */
.leaflet-container {
  background: var(--bg);
}

.leaflet-control-attribution {
  background: rgba(255,255,255,.8) !important;
  color: var(--muted);
}
