/* Dashboard toolbar and floating picker; see picker-float.js. */
.ldx-bar {
  position: fixed;
  z-index: 201;
  display: flex;
  gap: 6px;
}
.ldx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #ffffff;
  color: #495057;
  font: 600 13px Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(33, 37, 41, 0.1);
  white-space: nowrap;
}
.ldx-btn:hover { background: #f8f9fa; color: #212529; }
.ldx-btn:disabled,
.ldx-btn:disabled:hover { background: #ffffff; color: #adb5bd; cursor: default; box-shadow: none; }
.ldx-icon { width: 28px; padding: 0; justify-content: center; }
.ldx-glyph { font-size: 18px; font-weight: 600; line-height: 1; }
.ldx-filter { border: 1.5px solid #7048e8; color: #7048e8; }
.ldx-filter:hover,
.ldx-btn[aria-expanded="true"] { background: #f3f0ff; color: #7048e8; }

.ldx-float.react-grid-item {
  position: fixed !important;
  top: var(--ldx-top, 150px) !important;
  right: var(--ldx-right, 24px) !important;
  left: auto !important;
  width: min(1180px, calc(100vw - 48px)) !important;
  height: min(480px, calc(100vh - var(--ldx-top, 150px) - 16px)) !important;
  z-index: 200 !important;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(33, 37, 41, 0.18), 0 2px 6px rgba(33, 37, 41, 0.08);
  visibility: hidden;
  pointer-events: none;
}
/* The grid pulled up over the picker's slot (closeGap) would cover the page header; only its tiles take clicks. */
.react-grid-layout.ldx-shifted { pointer-events: none; }
.react-grid-layout.ldx-shifted > .react-grid-item:not(.ldx-float) { pointer-events: auto; }
.ldx-float.react-grid-item.ldx-open { visibility: visible; pointer-events: auto; }

.ldx-help {
  position: fixed;
  z-index: 200;
  top: var(--ldx-top, 150px);
  right: var(--ldx-right, 24px);
  width: min(820px, calc(100vw - 48px));
  max-height: calc(100vh - var(--ldx-top, 150px) - 16px);
  display: none;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(33, 37, 41, 0.18), 0 2px 6px rgba(33, 37, 41, 0.08);
  font: 13px/1.5 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #212529;
}
.ldx-help.ldx-open { display: flex; }
.ldx-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px 20px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 15px;
  font-weight: 600;
}
.ldx-help-close { width: 28px; padding: 0; justify-content: center; border: none; box-shadow: none; }
.ldx-help-body {
  margin: 0;
  padding: 12px 20px 18px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 140px 1fr;
  column-gap: 16px;
  row-gap: 10px;
}
.ldx-help-body dt { font-weight: 600; }
.ldx-help-body dd { margin: 0; }
.ldx-help-body h4 {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 1px solid #f1f3f5;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7048e8;
}
.ldx-help-body h4:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.ldx-summary {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin: 4px 10px 6px;
  font: 12px/1.4 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #495057;
}
.ldx-summary-head { font-weight: 700; color: #212529; margin-right: 2px; }
.ldx-summary-none { color: #868e96; }
.ldx-chip {
  padding: 3px 10px;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  background: #ffffff;
  white-space: nowrap;
}
.ldx-chip b { font-weight: 600; color: #212529; }
.ldx-chip-changed { border-color: #7048e8; background: #f3f0ff; color: #5f3dc4; }
.ldx-chip-changed b { color: #5f3dc4; }

/* Dashboard parameters (Period, Date Type, Breakdown 1-8) on their own line under the filters.
   In the filter bar's wrapping row they follow a vertical divider; an ::after break item with
   order 1 sits between the filters (order 0) and everything from the divider on (order 2).
   CSS order only, so React's DOM is left alone. Class names from Lightdash 2.361. */
[class*="_filters_"]:has(> [role="separator"][data-orientation="vertical"])::after {
  content: "";
  flex-basis: 100%;
  height: 0;
  order: 1;
}
[class*="_filters_"] > [role="separator"][data-orientation="vertical"],
[class*="_filters_"] > [role="separator"][data-orientation="vertical"] ~ * { order: 2; }
[class*="_filters_"] > [role="separator"][data-orientation="vertical"] { display: none; }

/* Column set dialog (columnSetLink) */
.ldx-dialog-back {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 37, 41, 0.25);
}
.ldx-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(33, 37, 41, 0.22);
  font: 13px/1.5 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #212529;
}
.ldx-dialog-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ldx-dialog-text { color: #495057; margin-bottom: 12px; }
.ldx-dialog-input {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font: inherit;
}
.ldx-dialog-input:focus { outline: none; border-color: #4c6ef5; box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.2); }
.ldx-dialog-field { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ldx-dialog-field span { width: 44px; color: #495057; font-weight: 600; }
.ldx-dialog-field .ldx-dialog-input { flex: 1; }
.ldx-dialog-error { min-height: 18px; margin-top: 4px; color: #e03131; font-size: 12px; }
.ldx-dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ldx-dialog-ok { background: #4c6ef5; border-color: #4c6ef5; color: #ffffff; }
.ldx-dialog-ok:hover { background: #4263eb; color: #ffffff; }

/* A search dimension's values (askValues): chips and a text box in one field, suggestions below */
.ldx-dialog.ldx-values { width: min(520px, calc(100vw - 32px)); }
.ldx-values-box {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  cursor: text;
}
.ldx-values-box:focus-within { border-color: #4c6ef5; box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.2); }
.ldx-values-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 1px 2px 1px 8px;
  border-radius: 4px;
  background: #7048e8;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ldx-values-chip button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.ldx-values-input { flex: 1; min-width: 160px; height: 26px; border: 0; outline: none; font: inherit; padding: 0 4px; }
.ldx-values-list {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}
.ldx-values-list:empty { border: 0; }
.ldx-values-list:empty::after { content: attr(data-empty); display: block; padding: 4px 2px; color: #868e96; font-size: 12px; }
.ldx-values-option { padding: 5px 10px; cursor: pointer; overflow-wrap: anywhere; }
.ldx-values-option:hover, .ldx-values-option.ldx-hot { background: #e5dbff; }
.ldx-values-gap { flex: 1; }

/* A view tab kept out of the tab bar is open (VIEW_TABS in picker-float.js): its own tab reads as selected,
   as Lightdash draws the selected tab. */
[role="tab"].ldx-view-tab { color: rgb(24, 24, 27) !important; border-bottom-color: rgb(24, 24, 27) !important; }

/* Updating all at once (the hold in picker-float.js): the dashboard as it was, over its tiles, which load
   unseen and appear together. The copy's tiles take the clicks meanwhile, so nothing half-loaded is clicked;
   the rest of its box lets them through, as it can reach over the page header (a shifted grid, closeGap). */
.ldx-hold { position: absolute; z-index: 2; overflow: hidden; pointer-events: none; }
.ldx-hold > .react-grid-layout { position: relative !important; margin: 0 !important; pointer-events: none !important; }
.ldx-hold > .react-grid-layout > .react-grid-item { pointer-events: auto !important; cursor: progress; }
html.ldx-holding .react-grid-layout:not(.ldx-hold-copy) > .react-grid-item:not(.ldx-float) { visibility: hidden !important; }
.ldx-hold-badge {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 16px;
  background: #212529;
  color: #ffffff;
  font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 4px 12px rgba(33, 37, 41, 0.25);
  pointer-events: none;
}
.ldx-hold-badge::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: ldx-spin 0.8s linear infinite;
}
@keyframes ldx-spin { to { transform: rotate(360deg); } }
