/* FR-DASH-1.1 — панель инструментов главной карты (префикс dmt-) */

#map-container {
  position: relative;
  overflow: hidden;
}

/* Зум +/− по Figma: чёрные квадраты, левый верх */
#map-container .maplibregl-ctrl-top-left {
  top: 10px;
  left: 10px;
}

#map-container .maplibregl-ctrl-group {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

#map-container .maplibregl-ctrl-group button {
  width: 32px;
  height: 32px;
  background-color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  margin-bottom: 4px;
}

#map-container .maplibregl-ctrl-group button + button {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#map-container .maplibregl-ctrl-group button:hover {
  background-color: #2d2d2d;
}

#map-container .maplibregl-ctrl-group button:focus {
  box-shadow: none;
}

#map-container .maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
#map-container .maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  background-color: transparent;
  filter: invert(1);
}

.dmt-root {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: 'Roboto', system-ui, sans-serif;
  color: #1a1a1a;
}

.dmt-root * {
  box-sizing: border-box;
}

.dmt-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  pointer-events: none;
  max-width: calc(100% - 56px);
}

.dmt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.dmt-row[hidden] {
  display: none !important;
}

.dmt-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #1a1a1a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.dmt-btn:hover:not(:disabled) {
  background: rgba(48, 178, 230, 0.18);
}

.dmt-btn.is-active {
  background: rgba(48, 178, 230, 0.35);
  color: #0277bd;
}

.dmt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dmt-btn-label {
  width: auto;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
}

.dmt-flyout {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  z-index: 3;
  pointer-events: auto;
}

.dmt-flyout[hidden] {
  display: none !important;
}

.dmt-flyout-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #1a1a1a;
}

.dmt-flyout-item:hover:not(:disabled) {
  background: rgba(48, 178, 230, 0.12);
}

.dmt-flyout-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dmt-settings-wrap {
  position: relative;
}

.dmt-panel-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 48px;
  width: min(320px, calc(100% - 20px));
  pointer-events: none;
  z-index: 2;
}

.dmt-panel {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dmt-panel[hidden] {
  display: none !important;
}

.dmt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex: none;
}

.dmt-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.dmt-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #555;
}

.dmt-panel-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.dmt-panel-body {
  padding: 12px;
  overflow: auto;
  flex: 1;
  font-size: 13px;
  color: #555;
}

.dmt-layers-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex: none;
  pointer-events: auto;
}

.dmt-layers-filter {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.dmt-panel-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex: none;
  display: flex;
  justify-content: flex-end;
}

.dmt-btn-primary {
  border: none;
  border-radius: 4px;
  background: #30b2e6;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}

.dmt-btn-primary:hover {
  background: #0290c0;
}

.dmt-layers-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.dmt-layers-tab {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f5f5f5;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.dmt-layers-tab.is-active {
  background: rgba(48, 178, 230, 0.2);
  border-color: #30b2e6;
  color: #0277bd;
  font-weight: 600;
}

.dmt-layers-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin: 10px 0 6px;
}

.dmt-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  cursor: pointer;
}

.dmt-layer-label {
  flex: 1;
  min-width: 0;
  color: #1a1a1a;
}

.dmt-layer-count {
  font-size: 11px;
  color: #888;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 1px 7px;
}

.dmt-layer-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}

.dmt-layer-sub {
  margin: 0 0 6px 18px;
  padding-left: 6px;
  border-left: 2px solid rgba(48, 178, 230, 0.35);
}

.dmt-layer-empty {
  color: #999;
  font-size: 12px;
  padding: 4px 0 8px;
}

.dmt-online-nopos {
  margin: 0 0 8px 22px;
  font-size: 12px;
  color: #666;
}

.dmt-online-nopos-list {
  margin: 4px 0 0;
  padding-left: 16px;
  max-height: 120px;
  overflow: auto;
}

.home-map-marker {
  position: relative;
  width: 24px;
  height: 36px;
  cursor: pointer;
}

.home-map-marker-pin {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  margin: 4px 0 0 3px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.home-map-marker-online {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.dmt-toasts {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 3;
}

.dmt-toast {
  pointer-events: auto;
  background: rgba(26, 26, 26, 0.9);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dmt-toast-hint {
  background: rgba(2, 119, 189, 0.92);
}

/* Когда открыта правая панель — сдвинуть тулбар влево от панели */
.dmt-root.is-panel-open .dmt-toolbar {
  right: min(340px, calc(100% - 10px));
}

/* Этап 4: геопоиск + координаты курсора */
.dmt-cursor-bar {
  position: absolute;
  left: 8px;
  right: auto;
  bottom: 8px;
  z-index: 2;
  width: auto;
  max-width: min(320px, calc(100% - 72px)); /* запас справа под attrib «i» и центр-тосты */
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  color: #333;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmt-geo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dmt-geo-overlay[hidden] {
  display: none !important;
}

.dmt-geo-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.dmt-geo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dmt-geo-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0277bd;
}

.dmt-geo-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
}

.dmt-geo-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dmt-geo-tab {
  flex: 1 1 auto;
  min-width: 56px;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.dmt-geo-tab.is-active {
  color: #0277bd;
  border-bottom-color: #0277bd;
  background: rgba(2, 119, 189, 0.06);
}

.dmt-geo-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dmt-geo-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dmt-geo-row,
.dmt-geo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.dmt-geo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 120px;
  min-width: 100px;
  font-size: 12px;
  color: #555;
}

.dmt-geo-label {
  font-weight: 500;
}

.dmt-geo-input {
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.dmt-geo-input:focus {
  border-color: #0277bd;
  box-shadow: 0 0 0 2px rgba(2, 119, 189, 0.15);
}

.dmt-geo-input.is-invalid {
  border-color: #e1302d;
  background: rgba(225, 48, 45, 0.06);
}

.dmt-geo-input:disabled {
  background: #f3f3f3;
  color: #777;
}

.dmt-geo-grid-title {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-top: 4px;
}

.dmt-geo-error {
  margin: 0 14px 8px;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(225, 48, 45, 0.1);
  color: #b71c1c;
  font-size: 12px;
}

.dmt-geo-error[hidden] {
  display: none !important;
}

.dmt-geo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  justify-content: flex-end;
}

.dmt-geo-temp-marker {
  width: 22px;
  height: 28px;
  background: #0277bd;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  position: relative;
}

.dmt-geo-temp-close {
  position: absolute;
  top: -10px;
  right: -10px;
  transform: rotate(45deg);
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 0;
}

/* Этап 5: зона видимости */
.dmt-los-host {
  display: contents;
}

.dmt-los-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dmt-los-status {
  font-size: 12px;
  color: #555;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(2, 119, 189, 0.08);
}

.dmt-los-status.is-error {
  background: rgba(225, 48, 45, 0.1);
  color: #b71c1c;
}

.dmt-los-obs {
  font-size: 12px;
  color: #333;
}

.dmt-los-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #555;
}

.dmt-los-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dmt-los-legend {
  font-size: 12px;
  color: #333;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dmt-los-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  vertical-align: middle;
}

.dmt-los-seen {
  background: #00c853;
}

.dmt-los-unseen {
  background: #e53935;
}

.dmt-los-obs-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff9800;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Этап 6: экспорт */
.dmt-export-host {
  display: contents;
}

.dmt-export-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dmt-export-step-title {
  font-size: 13px;
  font-weight: 600;
  color: #0277bd;
}

.dmt-export-tree,
.dmt-export-formats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dmt-export-check,
.dmt-export-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.dmt-export-toggle {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dmt-export-hint {
  font-size: 12px;
  color: #666;
}

.dmt-export-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
