.dbm-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dbm-overlay[hidden] {
  display: none !important;
}
.dbm-panel {
  background: #fff;
  border-radius: 10px;
  width: min(1200px, 98vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.dbm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.dbm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.dbm-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.dbm-tab.is-active {
  background: #2e75b6;
  color: #fff;
  border-color: #2e75b6;
}
.dbm-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}
.dbm-tab-panel[hidden] {
  display: none !important;
}
.dbm-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
}
.dbm-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.65rem;
}
.dbm-field span {
  font-size: 0.8rem;
  color: #475569;
}
.dbm-field input,
.dbm-field select,
.dbm-field textarea {
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}
.dbm-note--warn {
  color: #b45309;
}
.dbm-note {
  font-size: 0.8rem;
  color: #64748b;
}
.dbm-list {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}
.dbm-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.dbm-status {
  font-size: 0.85rem;
  color: #166534;
}
.dbm-error {
  color: #b91c1c;
  font-size: 0.85rem;
}
.dbm-kpi-split {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 1rem;
  min-height: 320px;
  align-items: start;
}
.dbm-kpi-list-col {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.dbm-kpi-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}
.dbm-kpi-list-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.dbm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #2e75b6;
  cursor: pointer;
  padding: 0;
}
.dbm-icon-btn:hover {
  background: #e0f2fe;
  border-color: #2e75b6;
}
.dbm-icon-btn--danger {
  color: #b91c1c;
}
.dbm-icon-btn--danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}
.dbm-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.dbm-kpi-show-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}
.dbm-kpi-show-toggle:hover {
  background: rgba(255, 255, 255, 0.6);
}
.dbm-kpi-show-toggle input {
  margin: 0;
  cursor: pointer;
}
.dbm-kpi-list-item.is-hidden-on-dashboard .dbm-kpi-list-item-title {
  color: #94a3b8;
  font-style: italic;
}
.dbm-kpi-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  flex: 1;
}
.dbm-kpi-list-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.2rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.dbm-kpi-list-item:hover {
  background: #e2e8f0;
}
.dbm-kpi-list-item.is-selected {
  background: #dbeafe;
  border-color: #93c5fd;
}
.dbm-kpi-list-item-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbm-kpi-list-item.is-selected .dbm-kpi-list-item-title {
  color: #1e3a5f;
}
.dbm-kpi-list-item-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}
.dbm-kpi-detail-col {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  min-height: 280px;
}
.dbm-kpi-detail-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #0f172a;
}
.dbm-kpi-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dbm-kpi-icon-preview {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
}
.dbm-toc-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.dbm-toc-icon-label {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
  width: 100%;
}
.dbm-toc-icon-preview {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.dbm-admin-slot .dbm-toc-icon-row {
  margin-top: 0.35rem;
}
.dbm-basemaps-show-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.dbm-basemaps-show-row span {
  flex: 1;
}
.dbm-basemap-config-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dbm-basemap-config-row {
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.dbm-basemap-config-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.dbm-basemap-thumb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.dbm-basemap-thumb-preview {
  width: 80px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #1e293b;
}
.dbm-kpi-mappings-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin: 0.5rem 0 1rem;
}
.dbm-kpi-mappings-fieldset legend {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 0.25rem;
}
.dbm-kpi-map-block {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed #e2e8f0;
}
.dbm-kpi-map-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.dbm-kpi-map-block h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: #334155;
}
.dbm-kpi-map-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.dbm-kpi-update-btn {
  width: 100%;
  margin-top: 0.25rem;
}
.dbm-kpi-value-fieldset {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
}
.dbm-kpi-value-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.dbm-kpi-value-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.dbm-kpi-value-scale-hint {
  margin-top: 0.25rem;
  font-size: 0.78rem;
}
#dbm-kpi-value-scale-wrap.is-disabled {
  opacity: 0.55;
}
#dbm-kpi-value-scale-wrap.is-disabled input {
  pointer-events: none;
}
.dbm-kpi-help-fieldset {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
}
.dbm-kpi-help-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.dbm-kpi-help-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}
.dbm-kpi-help-toggle input {
  width: auto;
  margin: 0;
}
.dbm-kpi-help-note {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}
.dbm-kpi-help-editor-wrap {
  width: 100%;
  margin-top: 0.15rem;
}
.dbm-kpi-help-editor-wrap .ql-toolbar.ql-snow {
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: #f1f5f9;
  font-family: inherit;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
}
.dbm-kpi-help-editor-wrap .ql-toolbar.ql-snow .ql-formats {
  margin-right: 8px;
}
.dbm-kpi-help-editor-wrap .ql-container.ql-snow {
  border: 1px solid #cbd5e1;
  border-radius: 0 0 6px 6px;
  font-family: inherit;
  font-size: 0.875rem;
  background: #fff;
}
.dbm-kpi-help-editor-wrap .ql-container.ql-disabled .ql-editor {
  cursor: text;
}
.dbm-kpi-help-editor-wrap .ql-editor {
  min-height: 10rem;
  max-height: 18rem;
  overflow-y: auto;
  line-height: 1.55;
  color: #0f172a;
  caret-color: #0f172a;
}
.dbm-kpi-help-editor-wrap .ql-editor.ql-blank::before {
  color: #94a3b8;
  font-style: normal;
}
.dbm-kpi-help-editor-wrap--ar .ql-editor {
  direction: rtl;
  text-align: right;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
.dbm-kpi-help-fallback {
  width: 100%;
  min-height: 10rem;
  resize: vertical;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
  color: #0f172a;
  background: #fff;
}
.dbm-kpi-overview-note {
  margin-top: 0;
}
.dbm-kpi-overview-section textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
}
.dbm-kpi-spider-slots-fieldset {
  margin-top: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem 0.75rem;
}
.dbm-kpi-spider-slots-fieldset legend {
  font-weight: 600;
  padding: 0 0.35rem;
}
.dbm-kpi-spider-slot-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.35rem;
}
.dbm-kpi-spider-slot-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.dbm-kpi-spider-slot-check input {
  margin: 0;
  cursor: pointer;
}
.dbm-kpi-spider-fieldset {
  margin-top: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem 0.75rem;
}
.dbm-kpi-spider-fieldset legend {
  font-weight: 600;
  padding: 0 0.35rem;
}
.dbm-kpi-spider-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.65rem 0.75rem;
}
.dbm-kpi-spider-fields input[type="color"] {
  width: 100%;
  height: 2rem;
  padding: 0.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
}
.dbm-charts-intro {
  margin-top: 0;
}
.dbm-charts-tab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dbm-charts-tab-field {
  margin: 0;
  min-width: 200px;
}
.dbm-charts-split {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 1rem;
  min-height: 320px;
  align-items: start;
}
.dbm-charts-list-col {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.dbm-charts-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}
.dbm-charts-list-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.dbm-charts-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  flex: 1;
}
.dbm-charts-list-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.2rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.dbm-charts-list-item:hover {
  background: #e2e8f0;
}
.dbm-charts-list-item.is-selected {
  background: #dbeafe;
  border-color: #93c5fd;
}
.dbm-charts-list-item-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbm-charts-list-item-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}
.dbm-charts-detail-col {
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 280px;
}
.dbm-charts-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.dbm-charts-editor-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.dbm-charts-editor-tab.is-active {
  background: #2e75b6;
  color: #fff;
  border-color: #2e75b6;
}
.dbm-charts-editor-panels {
  display: block;
}
.dbm-charts-editor-tab-panel[hidden] {
  display: none !important;
}
.dbm-charts-data-panel,
.dbm-charts-appearance-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  min-height: 280px;
  max-height: 62vh;
  overflow-y: auto;
}
.dbm-charts-panel-heading {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}
.dbm-charts-editor-footer {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}
.dbm-charts-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.dbm-chart-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.75rem;
}
.dbm-chart-fieldset legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  padding: 0 0.25rem;
}
.dbm-chart-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dbm-chart-checkbox input {
  margin: 0;
}
.dbm-chart-boundary-note {
  margin-bottom: 0.65rem;
}
.dbm-chart-update-btn {
  width: auto;
  min-width: 10rem;
  margin-top: 0;
}
.dbm-chart-shadow-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.5rem;
}
.dbm-chart-shadow-fields.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.dbm-chart-pie-3d-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.65rem;
  margin-top: 0.35rem;
}
.dbm-chart-pie-3d-fields.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.dbm-chart-pie-3d-angle-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.78rem;
}
.dbm-chart-class-order-th,
.dbm-chart-class-order-cell {
  width: 4.5rem;
  text-align: center;
  white-space: nowrap;
}
.dbm-chart-class-order-cell {
  display: flex;
  gap: 0.15rem;
  justify-content: center;
}
.dbm-chart-class-order-cell .dbm-icon-btn {
  width: 26px;
  height: 26px;
}
.dbm-chart-class-order-th.is-hidden,
.dbm-chart-class-order-cell.is-hidden {
  display: none;
}
.dbm-chart-classes-wrap {
  margin: 0.5rem 0 0.75rem;
}
.dbm-chart-classes-note {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
}
.dbm-chart-classes-scroll {
  max-height: 200px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.dbm-chart-classes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.dbm-chart-classes-table th,
.dbm-chart-classes-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}
.dbm-chart-classes-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  z-index: 1;
}
.dbm-chart-class-val-cell {
  max-width: 120px;
}
.dbm-chart-class-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-weight: 500;
}
.dbm-chart-class-label {
  width: 100%;
  min-width: 0;
  padding: 0.25rem 0.35rem;
  font-size: 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}
.dbm-chart-class-color {
  width: 40px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}
.dbm-chart-classes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.dbm-chart-classes-reload,
.dbm-chart-classes-add-other {
  font-size: 0.78rem;
}
.dbm-chart-class-actions-th {
  width: 2rem;
}
.dbm-chart-class-actions-cell {
  text-align: center;
  vertical-align: middle;
}
.dbm-chart-class-remove {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.dbm-chart-class-remove:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.dbm-chart-class-value--other {
  font-style: italic;
  color: #64748b;
}
.btn.primary {
  background: linear-gradient(135deg, #2e75b6, #1d4ed8);
  color: #fff;
  border: none;
}
