/* ============================================================
   OPORTAL extra modals — Provider Benchmark, OAPP Launcher,
   Activity Feed
   ============================================================ */

/* ---- Shared block sizing ---- */
.provider-benchmark-modal-block,
.oapp-launcher-modal-block,
.activity-feed-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;
}

.provider-benchmark-modal-shell,
.oapp-launcher-modal-shell,
.activity-feed-modal-shell { width: 100%; padding: 0; }

.provider-benchmark-modal-card,
.oapp-launcher-modal-card,
.activity-feed-modal-card {
  background: #0d1e35;
  border: 1px solid #1a3a5c;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.provider-benchmark-modal-top,
.oapp-launcher-modal-top,
.activity-feed-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #1a3a5c;
}

.provider-benchmark-modal-title,
.oapp-launcher-modal-title,
.activity-feed-modal-title {
  font-size: 20px; font-weight: 700; color: #a8bfd8; margin: 0 0 4px;
}

.provider-benchmark-modal-lead,
.oapp-launcher-modal-lead,
.activity-feed-modal-lead {
  margin: 0; font-size: 13px; color: #a8bfd8; opacity: .7;
}

/* ============================================================
   Provider Benchmark
   ============================================================ */
.pbench-body { flex: 1; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.pbench-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pbench-run-btn {
  background: #4fa3e0; border: none; border-radius: 6px;
  color: #0a1628; cursor: pointer; font-size: 13px; font-weight: 700; padding: 7px 18px;
}
.pbench-run-btn:hover { background: #3a8ecf; }
.pbench-status-text { font-size: 11px; color: #50c8c8; }
.pbench-hint { margin: 0; font-size: 11px; color: #4a6080; }
.pbench-rows { display: flex; flex-direction: column; gap: 8px; }
.pbench-row { display: flex; align-items: center; gap: 10px; }
.pbench-name { min-width: 110px; font-size: 12px; color: #6a80a8; }
.pbench-bar-wrap { flex: 1; height: 10px; background: #0a1628; border-radius: 5px; overflow: hidden; }
.pbench-bar { height: 100%; border-radius: 5px; transition: width .3s, background .3s; }
.pbench-val { min-width: 76px; font-size: 12px; font-weight: 600; text-align: right; }
.pbench-url { min-width: 170px; font-size: 10px; color: #4a6080; font-family: monospace; }
.pbench-spin { display: inline-block; animation: pbench-spin 1s linear infinite; }
@keyframes pbench-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.pbench-summary {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; background: #0a1628; border: 1px solid #1a3a5c;
  border-radius: 8px; font-size: 12px; margin-top: 4px;
}
.pbench-sum-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #4a6080; }
.pbench-sum-val { color: #a8bfd8; font-weight: 600; }

/* ============================================================
   OAPP Launcher
   ============================================================ */
.oapp-launcher-tabs { display: flex; border-bottom: 1px solid #1a3a5c; }
.oapp-launcher-tab {
  flex: 1; background: none; border: none;
  border-bottom: 2px solid transparent; color: #6a80a8;
  cursor: pointer; font-size: 12px; padding: 8px 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.oapp-launcher-tab.is-active { color: #4fa3e0; border-bottom-color: #4fa3e0; }
.oapp-badge {
  background: #4fa3e0; color: #0a1628; border-radius: 8px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
}
.oapp-launcher-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.oapp-launcher-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid #1a3a5c; flex-wrap: wrap;
}
.oapp-store-grid {
  flex: 1; overflow-y: auto; padding: 10px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.oapp-store-card {
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 8px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 5px;
}
.oapp-store-card:hover { border-color: #2a5a8c; }
.oapp-store-card-header { display: flex; align-items: center; justify-content: space-between; }
.oapp-store-card-name { font-size: 13px; font-weight: 700; color: #a8bfd8; }
.oapp-store-cat-badge {
  background: #1a3a5c; color: #4fa3e0; border-radius: 8px;
  font-size: 10px; padding: 2px 8px;
}
.oapp-store-card-desc { margin: 0; font-size: 12px; color: #6a80a8; line-height: 1.4; }
.oapp-store-card-meta { display: flex; align-items: center; gap: 10px; }
.oapp-store-stars { color: #c8a050; font-size: 12px; }
.oapp-store-karma { color: #50c8c8; font-size: 11px; }
.oapp-store-card-footer { display: flex; align-items: center; justify-content: space-between; }
.oapp-store-author { font-size: 11px; color: #4a6080; }
.oapp-install-btn {
  background: #4fa3e0; border: none; border-radius: 5px;
  color: #0a1628; cursor: pointer; font-size: 11px; font-weight: 700; padding: 4px 12px;
}
.oapp-install-btn:hover { background: #3a8ecf; }
.oapp-uninstall-btn {
  background: none; border: 1px solid #1a3a5c; border-radius: 5px;
  color: #6a80a8; cursor: pointer; font-size: 11px; padding: 4px 10px;
}
.oapp-uninstall-btn:hover { color: #e06b4f; border-color: #e06b4f; }
.oapp-installed-list-panel {
  flex: 1; overflow-y: auto; padding: 10px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.oapp-installed-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #0a1628; border: 1px solid #1a3a5c; border-radius: 8px; padding: 10px 14px;
}
.oapp-installed-name { font-size: 13px; font-weight: 600; color: #a8bfd8; }
.oapp-installed-meta { font-size: 11px; color: #4a6080; margin-top: 2px; }
.oapp-launch-btn {
  background: #50c878; border: none; border-radius: 5px;
  color: #0a1628; cursor: pointer; font-size: 11px; font-weight: 700; padding: 5px 12px;
}
.oapp-launch-btn:hover { background: #3ab060; }

/* ============================================================
   Activity Feed
   ============================================================ */
.activity-feed-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid #1a3a5c; flex-wrap: wrap;
}
.afeed-live-on { border-color: #50c878 !important; color: #50c878 !important; }
.activity-feed-list { flex: 1; overflow-y: auto; }
.afeed-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 16px; border-bottom: 1px solid #0a1628; font-size: 12px;
}
.afeed-row:hover { background: #0a1628; }
.afeed-icon { font-size: 14px; flex-shrink: 0; }
.afeed-body { flex: 1; line-height: 1.5; }
.afeed-type { color: #4fa3e0; font-weight: 600; }
.afeed-actor { color: #a8bfd8; }
.afeed-subject { color: #6a80a8; }
.afeed-provider { color: #4a6080; font-size: 10px; }
.afeed-karma { color: #50c8c8; font-size: 10px; }
.afeed-time { font-size: 10px; color: #4a6080; white-space: nowrap; flex-shrink: 0; }

/* ============================================================
   Notifications Panel
   ============================================================ */
.notif-panel {
  position: fixed; top: 0; right: 0; width: 320px; height: 100vh; z-index: 12;
  background: #0d1e35; border-left: 1px solid #1a3a5c;
  display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(0,0,0,.5);
  transform: translateX(0); transition: transform .25s ease;
}
.notif-panel[hidden] { display: none !important; }
.notif-backdrop {
  position: fixed; inset: 0; z-index: 11;
  background: rgba(0,0,0,.35);
}
.notif-backdrop[hidden] { display: none !important; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid #1a3a5c;
}
.notif-panel-title { font-size: 16px; font-weight: 700; color: #a8bfd8; }
.notif-text-btn {
  background: none; border: none; color: #4fa3e0; cursor: pointer;
  font-size: 11px; padding: 3px 6px;
}
.notif-text-btn:hover { text-decoration: underline; }
.notif-tabs { display: flex; border-bottom: 1px solid #1a3a5c; }
.notif-tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: #6a80a8; cursor: pointer; font-size: 12px; padding: 8px 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.notif-tab.is-active { color: #4fa3e0; border-bottom-color: #4fa3e0; }
.notif-count-badge {
  background: #e06b4f; color: #fff; border-radius: 8px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
}
.notif-list { flex: 1; overflow-y: auto; }
.notif-empty { color: #4a6080; padding: 20px 16px; text-align: center; font-size: 13px; }
.notif-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid #0a1628; cursor: default;
}
.notif-row:hover { background: #0a1628; }
.notif-row--read { opacity: .55; }
.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; }
.notif-title { font-size: 12px; font-weight: 700; color: #a8bfd8; margin-bottom: 2px; }
.notif-text  { font-size: 11px; color: #6a80a8; line-height: 1.4; margin-bottom: 3px; }
.notif-time  { font-size: 10px; color: #4a6080; }
.notif-read-btn {
  background: none; border: 1px solid #1a3a5c; border-radius: 4px;
  color: #4a6080; cursor: pointer; font-size: 11px; padding: 2px 6px; flex-shrink: 0;
}
.notif-read-btn:hover { color: #50c878; border-color: #50c878; }

/* Bell button in header */
.notif-bell-wrap { position: relative; display: inline-flex; align-items: center; }
.notif-bell-btn {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: #6a80a8; padding: 4px 6px; line-height: 1; transition: color .2s;
}
.notif-bell-btn:hover { color: #a8bfd8; }
.notif-bell-badge {
  position: absolute; top: 0; right: 0; width: 16px; height: 16px;
  background: #e06b4f; color: #fff; border-radius: 50%;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* ============================================================
   Quest Builder / Global Search / Provider Health
   ============================================================ */
.quest-builder-modal-block,
.global-search-modal-block,
.provider-health-modal-block {
  width: min(880px, 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; gap: 8px;
  padding: 14px 24px; border-bottom: 1px solid #1a3a5c;
}
.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: #0a1628; border: 1px solid #1a3a5c; color: #6a80a8;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.qb-step.is-active .qb-step-num { background: #4fa3e0; border-color: #4fa3e0; color: #0a1628; }
.qb-step.is-done   .qb-step-num { background: #50c878; border-color: #50c878; color: #0a1628; }
.qb-step-label { font-size: 12px; color: #a8bfd8; white-space: nowrap; }
.qb-step-line { flex: 1; height: 1px; background: #1a3a5c; }

.qb-body { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.qb-row { display: flex; gap: 12px; flex-wrap: wrap; }
.qb-field-group { display: flex; flex-direction: column; gap: 5px; }
.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; width: 100%;
}
.qb-input:focus, .qb-textarea:focus, .qb-select:focus { outline: none; border-color: #4fa3e0; }
.qb-textarea { resize: vertical; line-height: 1.5; }
.qb-section-hint { margin: 0; font-size: 12px; color: #6a80a8; }

.qb-objectives-list { display: flex; flex-direction: column; gap: 8px; }
.qb-no-obj { color: #4a6080; font-size: 12px; padding: 12px; 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-del {
  background: none; border: 1px solid #1a3a5c; border-radius: 5px;
  color: #4a6080; 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; width: 100%;
}
.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; }
.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: 10px; }
.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; margin: 12px 0 6px;
}
.qb-preview-obj-list { margin: 0; padding-left: 20px; color: #a8bfd8; font-size: 12px; 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 20px;
}
.qb-primary-btn:hover:not(:disabled) { background: #3a8ecf; }
.qb-primary-btn:disabled { opacity: .55; 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 { color: #e06b4f; font-size: 12px; }

/* ---------------- Global Search ---------------- */
.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; opacity: .6; }
.gs-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #a8bfd8; font-size: 16px; font-family: inherit;
}
.gs-input::placeholder { color: #3a5070; }

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

.gs-status-bar { padding: 6px 20px; font-size: 11px; color: #50c8c8; min-height: 14px; }
.gs-results { flex: 1; overflow-y: auto; }
.gs-hint { color: #4a6080; padding: 28px 20px; text-align: center; font-size: 13px; }
.gs-result-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid #0a1628; cursor: pointer;
}
.gs-result-row:hover { background: #0a1628; }
.gs-result-body { flex: 1; min-width: 0; }
.gs-result-name { font-size: 13px; font-weight: 600; color: #a8bfd8; }
.gs-result-desc {
  font-size: 11px; color: #6a80a8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-result-type {
  background: #1a3a5c; color: #4fa3e0; border-radius: 8px;
  font-size: 10px; padding: 2px 8px; flex-shrink: 0;
}
.gs-result-provider { font-size: 10px; color: #4a6080; flex-shrink: 0; }

/* ---------------- Provider Health ---------------- */
.ph-summary { margin: 6px 0 0; font-size: 12px; color: #50c8c8; }
.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: #6a80a8; cursor: pointer; font-size: 12px; padding: 5px 12px; white-space: nowrap;
}
.ph-btn:hover { color: #a8bfd8; border-color: #4fa3e0; }
.ph-poll-btn--on { border-color: #50c878 !important; color: #50c878 !important; }
.ph-last-checked { font-size: 11px; color: #4a6080; }
.ph-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #4a6080; }
.ph-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ph-dot--online   { background: #50c878; }
.ph-dot--degraded { background: #c8a050; }
.ph-dot--offline  { background: #e06b4f; }
.ph-dot--pending  { background: #4a6080; }

.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-left-width: 3px;
  border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px;
}
.ph-card--online   { border-left-color: #50c878; }
.ph-card--degraded { border-left-color: #c8a050; }
.ph-card--offline  { border-left-color: #e06b4f; }
.ph-card--pending  { border-left-color: #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 { border-radius: 8px; font-size: 10px; font-weight: 600; padding: 2px 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: rgba(74,96,128,.15);   color: #4a6080; }
.ph-card-latency { font-size: 18px; font-weight: 700; color: #a8bfd8; }
.ph-history { display: flex; gap: 2px; }
.ph-tick { flex: 1; height: 14px; border-radius: 2px; min-width: 3px; }
.ph-tick--online   { background: #50c878; }
.ph-tick--degraded { background: #c8a050; }
.ph-tick--offline  { background: #e06b4f; }
.ph-tick--empty    { background: #12233d; }
.ph-card-url { font-size: 10px; color: #4a6080; font-family: monospace; word-break: break-all; }

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