.designer-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 13px;
  color: #333;
}

/* Header */
.designer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f7fa;
  border-bottom: 1px solid #dde2ea;
  flex-shrink: 0;
}

.query-name-input {
  flex: 2;
  min-width: 180px;
  padding: 5px 8px;
  border: 1px solid #ccd3de;
  border-radius: 4px;
  font-size: 13px;
}

.query-type-select,
.order-by-input {
  flex: 1;
  min-width: 120px;
  padding: 5px 8px;
  border: 1px solid #ccd3de;
  border-radius: 4px;
  font-size: 13px;
}

.btn-save {
  padding: 6px 18px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;

  &:disabled { opacity: 0.6; cursor: default; }
  &:hover:not(:disabled) { background: #1558b0; }
}

.save-message {
  font-size: 12px;
  color: #2e7d32;
}

/* Body */
.designer-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* Palette */
.palette-panel {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #dde2ea;
  overflow: hidden;
}

.palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  background: #fafbfd;
}

/* Zones grid */
.zones-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0;
  overflow: hidden;
}

.zone-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #dde2ea;
  border-bottom: 1px solid #dde2ea;
  overflow: hidden;
}

/* Panel titles */
.panel-title {
  padding: 5px 8px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f6b7a;
  background: #eef1f6;
  border-bottom: 1px solid #dde2ea;
  flex-shrink: 0;
}

/* Field lists (drop targets) */
.field-list {
  min-height: 40px;
  transition: background 0.15s;

  &.cdk-drop-list-dragging { background: #e8f0fe; }
  &.cdk-drop-list-receiving { background: #f0f8ff; outline: 2px dashed #1a73e8; }
}

.zone-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

/* Chips */
.field-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  margin-bottom: 3px;
  background: #fff;
  border: 1px solid #dde2ea;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  font-size: 12px;

  &.cdk-drag-placeholder { opacity: 0.4; }
  &.cdk-drag-animating { transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); }
}

.chip-obj {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
}

.chip-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agg-select {
  font-size: 11px;
  padding: 1px 3px;
  border: 1px solid #ccd3de;
  border-radius: 3px;
  flex-shrink: 0;
}

.btn-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;

  &:hover { color: #d32f2f; }
}

/* CDK drag preview */
.cdk-drag-preview {
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border-radius: 4px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0.9;
}
