/* ==========================================================================
   ITEM SETTER MODAL — item-setter.css
   Centered via flex overlay. White, readable, clean.
   ========================================================================== */

/* ── Overlay — full screen centered ── */
.setter-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 20, 35, 0.4) !important;
  backdrop-filter: blur(3px) !important;
  -webkit-backdrop-filter: blur(3px) !important;
  z-index: 10000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

/* ── Modal box ── */
.setter-modal {
  position: relative !important;
  top: auto !important; left: auto !important;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #ffffff !important;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.14), 0 2px 10px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
  color: #111827;
}
.setter-modal.settings-modal-width {
  width: 90vw !important;
  max-width: 900px !important;
  max-height: 90vh !important;
  min-width: 0 !important;
}
.setter-modal.code-modal-width {
  width: 80vw !important;
  max-width: 700px !important;
  max-height: 90vh !important;
}
/* Medium-wide for analysis/data/visualization setters */
.setter-modal.setter-modal-wide {
  max-width: 560px !important;
}

/* ── Header ── */
.setter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0; background: #fff;
}
#set-title {
  font-size: 13px; font-weight: 600; color: #374151; margin: 0;
}
#set-title strong { color: #111827; }

.close-setter {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; flex-shrink: 0; padding: 0; font-family: inherit;
}
.close-setter:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* ── Scrollable body ── */
.setter-content {
  padding: 14px 16px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: #e5e7eb transparent;
  background: #fff;
}
.setter-content::-webkit-scrollbar { width: 4px; }
.setter-content::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* ── Sections ── */
.setter-section { margin-bottom: 14px; }

/* ── Field label ── */
.field-label {
  display: block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #6b7280; margin-bottom: 5px;
}

/* ── Section row header ── */
.section-row-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.section-row-header .field-label { margin-bottom: 0; }

/* ── Description ── */
.setter-description-block {
  background: #f0f9ff; border: 1px solid #bae6fd;
  border-left: 3px solid var(--primary); border-radius: 6px;
  padding: 9px 12px; font-size: 12px; color: #374151; line-height: 1.5;
}

/* ── Inputs ── */
.setter-input {
  display: block; width: 100%;
  background: #f9fafb !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  color: #111827 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  padding: 7px 10px !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.12s, box-shadow 0.12s !important;
}
.setter-input:focus {
  border-color: var(--primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
}
.setter-input::placeholder { color: #9ca3af !important; }
.setter-input:disabled { background: #f3f4f6 !important; color: #9ca3af !important; cursor: not-allowed; }
select.setter-input { appearance: auto; cursor: pointer; }

/* ── Field rows ── */
.field-row {
  display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px;
}
.field-row .key-input { width: 36% !important; flex-shrink: 0; }

/* ── Hint ── */
.field-hint { font-size: 11px; color: #9ca3af; margin: 3px 0 0 0; line-height: 1.4; }

/* ── Buttons ── */
.btn-add-field {
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 5px;
  color: #374151; font-size: 11px; font-weight: 600; padding: 3px 9px;
  cursor: pointer; transition: all 0.12s; font-family: inherit;
}
.btn-add-field:hover { background: var(--primary-light); border-color: var(--border-accent); color: var(--primary); }

.btn-remove-field {
  background: transparent; border: 1px solid #e5e7eb; border-radius: 5px;
  color: #d1d5db; font-size: 10px; padding: 7px 8px;
  cursor: pointer; transition: all 0.12s; flex-shrink: 0;
}
.btn-remove-field:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* ── Footer ── */
.setter-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 11px 16px; border-top: 1px solid #f3f4f6;
  background: #f9fafb; flex-shrink: 0;
}
.btn-cancel {
  background: #fff; border: 1px solid #e5e7eb; color: #374151;
  border-radius: 6px; padding: 7px 16px; font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.12s;
}
.btn-cancel:hover { border-color: #d1d5db; background: #f9fafb; }
.btn-cancel:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-save {
  background: #111827; border: none; color: #fff;
  border-radius: 6px; padding: 7px 18px; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.12s;
}
.btn-save:hover { background: #1f2937; }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Bootstrap compat inside modal ── */
.setter-content .form-control,
.setter-content .form-control:focus {
  background: #f9fafb !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  box-shadow: none !important;
}
.setter-content .form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
}
option { background: #fff; color: #111827; }
.text-muted { color: #9ca3af !important; font-size: 11px !important; }