.dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.dialog h4 {
  margin: 0 0 10px;
}

.dialog label {
  display: block;
  margin: 10px 0 5px;
}

.dialog select,
.dialog input,
.dialog textarea {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
}

.dialog input[type="color"] {
  height: 30px;
  padding: 2px;
}

.dialog-buttons {
  display: flex;
  justify-content: space-between;
}

.dialog-buttons button {
  padding: 8px 15px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.dialog-buttons button:nth-child(1) {
  background: #6c757d; /* loadGeoJSONBtn */
  color: white;
}

.dialog-buttons button:nth-child(2) {
  background: #007bff; /* drawBtn */
  color: white;
}

.dialog-buttons button:last-child {
  background: #dc3545; /* closeBtn */
  color: white;
}

#randomStyleBtn {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.hidden {
  display: none;
}

#projectionSel {
  position: absolute;
  top: 10px;
  left: 50px;
  z-index: 1000;
  padding: 5px;
  margin: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* Для улучшения читаемости и совместимости с темами */
#projectionSel:focus {
  outline: none;
  border-color: #0078A8;
}


#dlg, #editDlg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 20px;
  z-index: 1000;
  width: 450px;
  max-width: 90%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#dlg h4, #editDlg h4 {
  margin: 0 0 15px;
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

#dlg label, #editDlg label {
  display: block;
  margin: 10px 0;
  color: #555;
  font-size: 14px;
}

#dlg select, #editDlg input, #dlg textarea, #editDlg textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: #f9f9f9;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#dlg select:focus, #editDlg input:focus, #dlg textarea:focus, #editDlg textarea:focus {
  border-color: #6e8efb;
  box-shadow: 0 0 5px rgba(110, 142, 251, 0.5);
  outline: none;
}

#dlg textarea, #editDlg textarea {
  height: 120px;
  resize: vertical;
}

.dlg-buttons {
  margin-top: 15px;
  text-align: right;
}

.dlg-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.dlg-buttons button i {
  margin-right: 6px;
}

.dlg-buttons button:first-child {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: #fff;
}

.dlg-buttons button:last-child {
  background: #e0e0e0;
  color: #333;
}

.dlg-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dlg-buttons button:first-child:hover {
  background: linear-gradient(135deg, #5a7be8, #9466d0);
}

.dlg-buttons button:last-child:hover {
  background: #d0d0d0;
}
.absolute-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 550px;
  padding: 10px;
  background: #fff;
  border: 1px solid #999;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  /* Убрали max-height, чтобы панель расширялась по содержимому */
}

.absolute-panel h4 {
  margin: 0 0 10px;
}

.db-filters {
  margin: 10px 0;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 5px; /* Отступ между элементами */
}

.filter-row label[for="dbParam"] {
  margin: 0;
  font-size: 14px;
}

.filter-row select#dbParam {
  flex: 1; /* Занимает доступное пространство */
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.filter-row label.equals-label {
  margin: 0 5px;
  font-size: 14px;
  white-space: nowrap;
}

.filter-row input#dbParamValue {
  flex: 1; /* Занимает доступное пространство */
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Существующие стили для остальной части панели */
.absolute-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 500px;
  padding: 10px;
  background: #fff;
  border: 1px solid #999;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.absolute-panel h4 {
  margin: 0 0 10px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #ff0000;
}

.db-results {
  margin-top: 10px;
}

.db-results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.db-results-table th,
.db-results-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.db-results-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.db-results-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.db-results-table tr:hover {
  background-color: #f1f1f1;
}

#dbResultsContent {
  max-height: 200px;
  overflow-y: auto;
}

.db-results-table .clickable {
  cursor: pointer;
  color: #0066cc;
  text-decoration: underline;
}

.db-results-table .clickable:hover {
  color: #003366;
  background-color: #e6f3ff;
}