/* Report designer — ribbon + resizable panes + catalog */

.report-designer-root {
  min-width: 0;
  position: relative;
}

.report-ribbon-tabs .mud-tabs-panels {
  min-height: 48px;
}

.report-designer-panes {
  min-width: 0;
}

.report-designer-pane {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Left pane must be a flex column so height:100% / flex children resolve. */
.report-designer-root .report-designer-pane-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.report-splitter {
  width: 6px;
  flex: 0 0 6px;
  cursor: col-resize;
  background: color-mix(in srgb, var(--mud-palette-lines-default, #ccc) 70%, transparent);
  align-self: stretch;
  z-index: 2;
}

.report-splitter:hover,
.report-splitter:focus-visible {
  background: var(--mud-palette-primary, #594ae2);
  outline: none;
}

.report-splitter-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  cursor: col-resize;
  user-select: none;
}

.report-designer-root .report-designer-sidebar {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  height: 100%;
}

.report-designer-root .report-designer-catalog-tabs {
  width: 100%;
}

.report-designer-root .report-designer-catalog-tabs .mud-button-root {
  flex: 1 1 0;
}

/*
 * Direct flex child of the sidebar MudPaper (center-pane pattern).
 * No MudTabs in this chain — overflow-y:auto gets a definite capped height.
 */
.report-designer-root .report-designer-tab-scroll {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

/* Long field keys / captions: wrap, never force a horizontal scrollbar. */
.report-designer-root .report-designer-tab-scroll .mud-typography,
.report-designer-root .report-designer-tab-scroll .mud-list-item-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.report-toolbox-item {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  cursor: grab;
  border-radius: var(--mud-default-borderradius, 4px);
  outline: 1px solid transparent;
  outline-offset: 0;
}

.report-toolbox-item:focus-visible {
  outline: 2px solid var(--mud-palette-primary, #594ae2);
  outline-offset: 2px;
}

.report-toolbox-item:active {
  cursor: grabbing;
}

.report-toolbox-item-active {
  outline: 2px solid var(--mud-palette-primary, #594ae2);
  outline-offset: 0;
  background-color: color-mix(in srgb, var(--mud-palette-primary, #594ae2) 10%, transparent);
}

.report-toolbox-item .mud-paper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rd-group {
  border-bottom: 1px solid var(--mud-palette-divider);
}

.rd-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  text-align: start;
  color: var(--mud-palette-text-primary);
}

.rd-group-header:hover {
  background: var(--mud-palette-action-default-hover);
}

.rd-group-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-group-count {
  font-size: 0.75rem;
  color: var(--mud-palette-text-secondary);
}

.rd-group-body {
  padding-bottom: 4px;
    overflow: auto;
    height: 80%;
}

.rd-field-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
}

.rd-field-item:hover {
  background: var(--mud-palette-action-default-hover);
}

.rd-field-name {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.rd-field-key {
  font-size: 0.75rem;
  color: var(--mud-palette-text-secondary);
  overflow-wrap: anywhere;
}
