/* Карта отделений МФЦ — стили */
:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #6b7789;
  --accent: #3b6ef6;
  --border: #e2e8f0;
  --green: #2e9e5b;
  --yellow: #df9e00;
  --red: #d64541;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ---------- Сайдбар ---------- */

.sidebar {
  width: 340px;
  min-width: 340px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px;
  background: var(--card);
  border-right: 1px solid var(--border);
}

.sidebar__header h1 { margin: 0; font-size: 20px; }
.sidebar__subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.card {
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.card__title {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.card__hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ---------- Фильтры ---------- */

.filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.filter:hover { background: #eaeff6; }
.filter__count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter--toggle { margin-top: 8px; color: var(--muted); }

.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot--green  { background: var(--green); }
.dot--yellow { background: var(--yellow); }
.dot--red    { background: var(--red); }

/* ---------- Предупреждения ---------- */

.card--warnings { border-color: #f0d089; background: #fdf6e3; }
.warnings__list { margin: 0; padding-left: 18px; }
.warnings__list li { margin: 4px 0; font-size: 12.5px; line-height: 1.4; }

.sidebar__footer {
  margin-top: auto;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#data-updated { color: var(--muted); }

/* ---------- Карта ---------- */

#map { flex: 1; height: 100vh; }

.map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  color: var(--red);
  font-size: 15px;
  text-align: center;
}

/* ---------- Содержимое балуна ---------- */

.balloon-status { margin: 0 0 8px; }

.balloon-table { border-collapse: collapse; }
.balloon-table th,
.balloon-table td {
  padding: 3px 12px 3px 0;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.balloon-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.balloon-empty { color: var(--muted); font-style: italic; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.badge--green  { background: var(--green); }
.badge--yellow { background: var(--yellow); }
.badge--red    { background: var(--red); }

/* ---------- Адаптивность ---------- */

@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 46vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  #map { height: 54vh; }
}
