/* ============================================================
   Quest Builder / Global Search / Provider Health
   ============================================================ */

.quest-builder-modal-block,
.global-search-modal-block,
.provider-health-modal-block {
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto; overflow-x: hidden;
  left: 50%; top: 50%;
  padding: 0; background: transparent; box-shadow: none;
  border-radius: 0; backdrop-filter: none;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  letter-spacing: normal;
}
.quest-builder-modal-shell,
.global-search-modal-shell,
.provider-health-modal-shell { width: 100%; padding: 0; }

.quest-builder-modal-card,
.global-search-modal-card,
.provider-health-modal-card {
  background: #0d1e35; border: 1px solid #1a3a5c; border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column; min-height: 480px;
}
.quest-builder-modal-top,
.provider-health-modal-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid #1a3a5c;
}
.quest-builder-modal-title,
.provider-health-modal-title { font-size: 20px; font-weight: 700; color: #a8bfd8; margin: 0 0 4px; }
.quest-builder-modal-lead,
.provider-health-modal-lead  { margin: 0; font-size: 13px; color: #a8bfd8; opacity: .7; }

/* ============================================================
   Quest Builder
   ============================================================ */
.qb-steps { display: flex; align-items: center; padding: 14px 24px; border-bottom: 1px solid #1a3a5c; gap: 4px; }
.qb-step { display: flex; align-items: center; gap: 8px; opacity: .45; transition: opacity .2s; }
.qb-step.is-active, .qb-step.is-done { opacity: 1; }
.qb-step-num {
  width: 24px; height: 24px; border-radius: 50%; background: #1a3a5c; color: #6a80a8;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.qb-step.is-active .qb-step-num { background: #4fa3e0; color: #0a1628; }
.qb-step.is-done   .qb-step-num { background: #50c878; color: #0a1628; }
.qb-step-label { font-size: 12px; color: #a8bfd8; }
.qb-step-line { flex: 1; height: 1px; background: #1a3a5c; margin: 0 8px; }

.qb-body { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.qb-field-group { display: flex; flex-direction: column; gap: 5px; }
.qb-row { display: flex; gap: 12px; flex-wrap: wrap; }
.qb-label { font-size: 11px; font-weight: 600; color: #6a80a8; text-transform: uppercase; letter-spacing: .04em; }
.qb-required { color: #e06b4f; }
.qb-input, .qb-textarea, .qb-select {
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 6px;
  color: #a8bfd8; font-size: 13px; padding: 7px 10px; font-family: inherit;
}
.qb-input:focus, .qb-textarea:focus, .qb-select:focus { outline: none; border-color: #4fa3e0; }
.qb-textarea { resize: vertical; min-height: 64px; }
.qb-section-hint { margin: 0 0 4px; font-size: 12px; color: #6a80a8; }

.qb-objectives-list { display: flex; flex-direction: column; gap: 8px; }
.qb-no-obj { color: #4a6080; font-size: 12px; padding: 14px; text-align: center; border: 1px dashed #1a3a5c; border-radius: 8px; }
.qb-obj-row { display: flex; align-items: center; gap: 10px; }
.qb-obj-num {
  width: 22px; height: 22px; border-radius: 50%; background: #1a3a5c; color: #4fa3e0;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.qb-obj-fields { flex: 1; display: flex; gap: 8px; }
.qb-obj-desc { flex: 1; }
.qb-obj-del {
  background: none; border: 1px solid #1a3a5c; border-radius: 5px;
  color: #6a80a8; cursor: pointer; font-size: 12px; padding: 4px 8px; flex-shrink: 0;
}
.qb-obj-del:hover { color: #e06b4f; border-color: #e06b4f; }
.qb-add-obj-btn {
  background: none; border: 1px dashed #1a3a5c; border-radius: 6px;
  color: #4fa3e0; cursor: pointer; font-size: 12px; padding: 8px; margin-top: 4px;
}
.qb-add-obj-btn:hover { border-color: #4fa3e0; background: rgba(79,163,224,.06); }

.qb-preview-card { background: #0a1628; border: 1px solid #1a3a5c; border-radius: 10px; padding: 16px 18px; }
.qb-preview-title { font-size: 17px; font-weight: 700; color: #a8bfd8; margin-bottom: 6px; }
.qb-preview-desc { margin: 0 0 10px; font-size: 13px; color: #6a80a8; line-height: 1.5; }
.qb-preview-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.qb-meta-chip { background: #1a3a5c; color: #a8bfd8; border-radius: 10px; font-size: 11px; padding: 3px 10px; }
.qb-preview-objs-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #4a6080; border-bottom: 1px solid #1a3a5c; padding-bottom: 4px; margin-bottom: 8px;
}
.qb-preview-obj-list { margin: 0; padding-left: 18px; font-size: 12px; color: #a8bfd8; line-height: 1.7; }
.qb-publish-status { margin: 10px 0 0; font-size: 12px; min-height: 16px; }

.qb-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-top: 1px solid #1a3a5c;
}
.qb-primary-btn {
  background: #4fa3e0; border: none; border-radius: 6px;
  color: #0a1628; cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 18px;
}
.qb-primary-btn:hover { background: #3a8ecf; }
.qb-primary-btn:disabled { opacity: .6; cursor: not-allowed; }
.qb-secondary-btn {
  background: none; border: 1px solid #1a3a5c; border-radius: 6px;
  color: #6a80a8; cursor: pointer; font-size: 13px; padding: 8px 16px;
}
.qb-secondary-btn:hover { color: #a8bfd8; border-color: #4fa3e0; }
.qb-error-msg { font-size: 12px; color: #e06b4f; display: none; }

/* ============================================================
   Global Search
   ============================================================ */
.global-search-modal-card { min-height: 420px; }
.gs-search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid #1a3a5c;
}
.gs-search-icon { font-size: 16px; flex-shrink: 0; }
.gs-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #a8bfd8; font-size: 16px; font-family: inherit;
}
.gs-input::placeholder { color: #2a4a6c; }

.gs-type-chips { display: flex; gap: 6px; padding: 10px 20px; border-bottom: 1px solid #1a3a5c; flex-wrap: wrap; }
.gs-chip {
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 14px;
  color: #6a80a8; cursor: pointer; font-size: 11px; padding: 4px 12px;
}
.gs-chip:hover { color: #a8bfd8; }
.gs-chip.is-active { background: #4fa3e0; border-color: #4fa3e0; color: #0a1628; font-weight: 600; }

.gs-status-bar { padding: 6px 20px; font-size: 11px; color: #50c8c8; min-height: 14px; }
.gs-results { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.gs-hint { color: #4a6080; padding: 30px 20px; text-align: center; font-size: 13px; }

.gs-section { margin-bottom: 4px; }
.gs-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #4a6080; padding: 8px 20px 4px; display: flex; align-items: center; gap: 6px;
}
.gs-section-count { background: #1a3a5c; color: #6a80a8; border-radius: 8px; padding: 0 6px; font-size: 10px; }
.gs-result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 20px; cursor: pointer; border-bottom: 1px solid #0a1628;
}
.gs-result-row:hover { background: #0a1628; }
.gs-result-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gs-result-name { font-size: 13px; font-weight: 600; color: #a8bfd8; }
.gs-result-desc { font-size: 11px; color: #6a80a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-result-meta { flex-shrink: 0; }
.gs-result-prov { font-size: 10px; color: #4a6080; }

/* ============================================================
   Provider Health Monitor
   ============================================================ */
.ph-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid #1a3a5c;
}
.ph-btn {
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 6px;
  color: #a8bfd8; cursor: pointer; font-size: 12px; padding: 6px 12px;
}
.ph-btn:hover { border-color: #4fa3e0; }
.ph-btn:disabled { opacity: .5; cursor: not-allowed; }
.ph-poll-btn--on { border-color: #50c878 !important; color: #50c878 !important; }
.ph-last-checked { font-size: 11px; color: #4a6080; }
.ph-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6a80a8; }

.ph-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ph-dot--online   { background: #50c878; }
.ph-dot--degraded { background: #c8a050; }
.ph-dot--offline  { background: #e06b4f; }

.ph-grid {
  flex: 1; overflow-y: auto; padding: 14px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
  align-content: start;
}
.ph-card {
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.ph-card--online   { border-left: 3px solid #50c878; }
.ph-card--degraded { border-left: 3px solid #c8a050; }
.ph-card--offline  { border-left: 3px solid #e06b4f; }
.ph-card--pending  { border-left: 3px solid #1a3a5c; }
.ph-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ph-card-name { font-size: 13px; font-weight: 700; color: #a8bfd8; }
.ph-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; }
.ph-badge--online   { background: rgba(80,200,120,.15);  color: #50c878; }
.ph-badge--degraded { background: rgba(200,160,80,.15);  color: #c8a050; }
.ph-badge--offline  { background: rgba(224,107,79,.15);  color: #e06b4f; }
.ph-badge--pending  { background: #1a3a5c;               color: #4a6080; }
.ph-card-latency { font-size: 15px; font-weight: 600; color: #a8bfd8; }
.ph-card-url { font-size: 10px; color: #2a4a6c; font-family: monospace; }
.ph-history { display: flex; gap: 2px; align-items: center; }
.ph-tick { width: 6px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.ph-tick--online   { background: #50c878; }
.ph-tick--degraded { background: #c8a050; }
.ph-tick--offline  { background: #e06b4f; }
.ph-tick--empty    { background: #1a3a5c; }

@media (max-width: 520px) {
  .ph-grid { grid-template-columns: 1fr; }
  .qb-row { flex-direction: column; }
}
