/* Scoped bundle dialogs: shared by every filter canvas. */
.filter-bundle-modal .modal-dialog {
  width: min(1000px, 96vw);
  max-width: none;
  margin: 1.75rem auto;
}

.filter-bundle-modal .modal-dialog.modal-lg {
  width: min(850px, 94vw);
}

.filter-bundle-modal .modal-content {
  border: 0;
  border-radius: 15px;
  box-shadow: 0 24px 70px #192d4147;
  overflow: hidden;
  color: #34424c;
}

.filter-bundle-modal .modal-header {
  padding: 12px;
  border-bottom: 1px solid #e1e7eb;
}

.filter-bundle-modal .modal-title {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.filter-bundle-modal .modal-body {
  overflow: auto;
  max-height: 70vh;
  padding: 0;
}

.filter-bundle-modal .modal-footer {
  padding: 16px 30px;
  border-top: 1px solid #e1e7eb;
  gap: 8px;
}

.filter-bundle-modal .bundle-subtitle {
  color: #718096;
  font-size: 14px;
  margin: 12px 0;
  padding: 0 12px;
}

.filter-bundle-modal .bundle-name {
  width: min(440px, 100%);
  height: 44px;
  margin: 0 auto 24px;
}

.filter-bundle-modal .bundle-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 0 12px;
}

.bundle-section-title-groups-extension {
  padding: 0 !important;
}

.filter-bundle-modal .bundle-filter-list {
  border: 1px dashed #c8d2d9;
  border-radius: 11px;
  padding: 8px;
  background: #fcfdfd;
  max-height: 340px;
  overflow: auto;
}

.filter-bundle-modal .bundle-filter-row {
  padding: 11px 12px;
  border-bottom: 1px solid #e8edef;
  font-size: 14px;
}

.filter-bundle-modal .bundle-filter-row.selectable {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  border: 0;
  border-radius: 8px;
}

.filter-bundle-modal .bundle-filter-row.selectable:hover {
  background: #f5f8fa;
}

.filter-bundle-modal .form-check-input:checked {
  background-color: #3b9b62;
  border-color: #3b9b62;
}

.filter-bundle-modal .bundle-field {
  min-width: 0;
  overflow-wrap: anywhere;
}

.filter-bundle-modal .bundle-value,
.filter-bundle-modal .bundle-details {
  color: #6f7c85;
  font-size: 13px;
  margin-top: 5px;
}

.filter-bundle-modal .bundle-details summary {
  cursor: pointer;
  width: fit-content;
}

.filter-bundle-modal .bundle-details summary:hover {
  color: #3478a8;
}

.filter-bundle-modal .bundle-values {
  max-height: 155px;
  overflow: auto;
  list-style: none;
  padding: 5px 0;
  margin: 8px 0 0;
  border: 1px solid #d4dfe5;
  border-radius: 8px;
  background: #f8fafb;
}

.filter-bundle-modal .bundle-values li {
  padding: 7px 11px;
  border-bottom: 1px solid #e9eef1;
}

.filter-bundle-modal .bundle-values li:last-child {
  border-bottom: none;
}

.filter-bundle-modal .bundle-note {
  font-size: 12px;
  color: #718096;
  margin: 12px 0;
  padding: 0 12px;
}

.filter-bundle-modal .bundle-columns {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 330px;
  border-top: 1px solid #e1e7eb;
}

.filter-bundle-modal .bundle-sidebar {
  background: #f8fafb;
  border-right: 1px solid #dbe3e9;
  padding: 18px 12px;
  min-width: 0;
}

.filter-bundle-modal .bundle-list {
  max-height: 390px;
  overflow: auto;
}

.filter-bundle-modal .bundle-list-item {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

.filter-bundle-modal .bundle-list label.dash-options-list-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 3px 0;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #34424c;
  cursor: pointer;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.filter-bundle-modal .bundle-list label.dash-options-list-option:hover,
.filter-bundle-modal .bundle-list label.dash-options-list-option.selected {
  background: #eaf3f8;
  border-color: #c8dbe8;
}

.filter-bundle-modal .bundle-list label.dash-options-list-option.selected {
  color: #245c86 !important;
  font-weight: 700;
}

.filter-bundle-modal .bundle-list label.dash-options-list-option:focus-within {
  outline: 3px solid #3478a8;
  outline-offset: -3px;
}

.filter-bundle-modal .bundle-list input {
  accent-color: #3478a8;
  flex: none;
}

.filter-bundle-modal .bundle-main {
  padding: 18px 22px 0;
  min-width: 0;
}

.filter-bundle-modal .bundle-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e5eaed;
  padding-bottom: 16px;
}

.filter-bundle-modal .bundle-main-header h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.filter-bundle-modal .bundle-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.filter-bundle-modal .bundle-action {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--border, rgb(15 23 42 / 10%));
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

/* Secondary actions: clean, quiet, and consistent with the app's neutral UI. */
.filter-bundle-modal .bundle-action.btn-light {
  color: var(--text, #0f172a);
  background: #fff;
}

.filter-bundle-modal .bundle-action.btn-light:hover {
  color: var(--primary, #2563eb);
  background: #f8fafc;
  border-color: #bfdbfe;
}

/* Primary actions use the same gradient as the app's main buttons. */
.filter-bundle-modal .bundle-action.btn-primary {
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--primary, #2563eb),
    var(--primary-2, #06b6d4)
  );
  border-color: transparent;
}

.filter-bundle-modal .bundle-action.btn-primary:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 10px rgb(37 99 235 / 20%);
}

/* Destructive actions stay restrained until hovered. */
.filter-bundle-modal .bundle-action.bundle-danger {
  color: #b42318;
  background: #fff;
  border-color: #fecaca;
}

.filter-bundle-modal .bundle-action.bundle-danger:hover {
  color: #842029;
  background: #fef2f2;
  border-color: #fca5a5;
}

.filter-bundle-modal .bundle-preview {
  max-height: 340px;
  overflow: auto;
  padding-top: 8px;
}

.filter-bundle-modal .bundle-status {
  font-size: 13px;
  margin-top: 12px;
  color: #43535d;
  overflow-wrap: anywhere;
}

.filter-bundle-modal .bundle-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.filter-bundle-modal .bundle-inline[hidden] {
  display: none !important;
}

.filter-bundle-modal .bundle-inline input {
  max-width: 240px;
}

.filter-bundle-modal .bundle-empty {
  padding: 40px 16px;
  text-align: center;
  color: #718096;
  font-size: 14px;
}

.filter-bundle-modal :focus-visible {
  outline: 3px solid #72a9cc;
  outline-offset: 2px;
}

/* Neutral search border and accessible focus outline. */
.filter-bundle-modal #filter-bundle-search {
  color: #343434;
  border-color: #c7c7c7;
}

.filter-bundle-modal #filter-bundle-search:focus {
  border-color: #777;
  box-shadow: none;
  outline: 0 solid #777;
}

/* Thin gray clear icon; retains the browser's native clear behavior. */
.filter-bundle-modal #filter-bundle-search::-webkit-search-cancel-button {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 4 8 8M12 4l-8 8' fill='none' stroke='%23666' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@media (width <= 900px) {
  .filter-bundle-modal .modal-header,
  .filter-bundle-modal .modal-footer {
    padding: 12px;
  }

  .filter-bundle-modal .bundle-columns {
    grid-template-columns: 1fr;
  }

  .filter-bundle-modal .bundle-sidebar {
    border-right: 0;
    border-bottom: 1px solid #dbe3e9;
  }

  .filter-bundle-modal .bundle-list {
    max-height: 150px;
  }

  .filter-bundle-modal .bundle-main {
    padding: 16px 0 0 12px;
  }

  .filter-bundle-modal .bundle-main-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
