:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --muted: rgba(255, 255, 255, 0.72);
  --text: rgba(255, 255, 255, 0.92);
  --stroke: rgba(255, 255, 255, 0.12);
  --accent: #7c5cff;
  --accent2: #39d98a;
  --danger: #ff5c7c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans",
    sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(1000px 500px at 80% 0%, rgba(57, 217, 138, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(11, 18, 32, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__count {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--stroke);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.topbar__search {
  flex: 1;
  max-width: 560px;
}

.topbar__actions {
  display: flex;
  gap: 10px;
}
.topbar__menuBtn {
  display: none;
}

.btn {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 58px);
}

.layout--map {
  display: block;
  padding: 0;
  height: calc(100vh - 58px);
}

.input--top {
  height: 40px;
}

.panel {
  background: rgba(15, 26, 46, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel__row {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--stroke);
}

.kpi {
  flex: 1;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.kpi__label {
  color: var(--muted);
  font-size: 12px;
}
.kpi__value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.input:focus {
  border-color: rgba(124, 92, 255, 0.5);
}

.panel__list {
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px;
}
.card__title {
  font-weight: 700;
  font-size: 14px;
}
.card__addr {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.badgeRow {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  border: 1px solid var(--stroke);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
}
.badge--yes {
  border-color: rgba(57, 217, 138, 0.35);
  color: rgba(57, 217, 138, 0.95);
}
.badge--no {
  border-color: rgba(255, 92, 124, 0.35);
  color: rgba(255, 92, 124, 0.95);
}
.badge--na {
  border-color: rgba(255, 255, 255, 0.18);
}

.mapWrap {
  background: rgba(15, 26, 46, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
}

.mapWrap--full {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  height: calc(100vh - 58px);
}

#map {
  width: 100%;
  height: 100%;
}

.notice {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}
.marker-dot--blue {
  background: #2f80ff;
}
.marker-dot--green {
  background: #31c475;
}

.popup {
  width: 320px;
}
.popup h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
}
.popup .muted {
  color: #5e6b86;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 8px;
}
.popup .row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.checkRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 14px;
}
.checkRow input {
  width: 18px;
  height: 18px;
}
.popup .btn2 {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  padding: 8px;
  cursor: pointer;
  background: #f5f7ff;
}
.popup .btn2.yes {
  background: rgba(57, 217, 138, 0.15);
  border-color: rgba(57, 217, 138, 0.35);
}
.popup .btn2.no {
  background: rgba(255, 92, 124, 0.14);
  border-color: rgba(255, 92, 124, 0.35);
}
.popup input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
}
.popup textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  resize: vertical;
}
.popup select {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
}
.contactsBlock {
  margin-top: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
}
.contactsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.contactsTitle {
  font-weight: 600;
  font-size: 13px;
}
.contactRow {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
}
.popup .btn2.small {
  padding: 6px 10px;
}
.popup .btn2.small.danger {
  background: rgba(255, 92, 124, 0.15);
  border-color: rgba(255, 92, 124, 0.35);
  color: #b64057;
  font-weight: 700;
}
.popup .btn2.danger {
  margin-top: 8px;
  background: rgba(255, 92, 124, 0.15);
  border-color: rgba(255, 92, 124, 0.35);
  color: #b64057;
  font-weight: 600;
}
.popup .btn2[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.popup .save {
  width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.18);
  cursor: pointer;
  padding: 9px 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: stretch;
  justify-content: center;
  background: rgba(0, 0, 0, 0.48);
  z-index: 50;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.modal--open {
  display: flex;
}
.modal__sheet {
  width: min(920px, 100%);
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  border-radius: 0;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(15, 26, 46, 0.9);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal__title {
  font-weight: 700;
}
.modal__close {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 36px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.modal__body {
  padding: 12px 14px 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.modal__body .popup {
  width: 100%;
  max-width: 720px;
}

body.modal-open {
  overflow: hidden;
}
body.modal-open #map {
  pointer-events: none;
}

@media (min-width: 720px) {
  .modal__sheet {
    height: calc(100% - 48px);
    margin: 24px;
    border-radius: 14px;
  }
}

@media (max-width: 1020px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .mapWrap {
    height: 60vh;
  }
  .layout--map {
    height: calc(100vh - 58px);
  }
  .mapWrap--full {
    height: calc(100vh - 58px);
  }
  .topbar__title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar__search {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .topbar__actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar__menuBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .topbar__actions {
    display: none;
  }
  .topbar.topbar--open .topbar__actions {
    display: flex;
    flex-direction: column;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .topbar__search {
    width: 100%;
  }
  .input--top {
    height: 44px;
    font-size: 16px;
  }
  .mapWrap--full {
    height: calc(100vh - 140px);
  }
  .popup {
    width: auto;
    max-width: 90vw;
  }
  .popup input,
  .popup textarea,
  .popup select {
    font-size: 16px;
  }
  .contactRow {
    grid-template-columns: 1fr;
  }
}


