/*
 * components-campaigns.css — campaign card extras: origin reach badge,
 * forensic audit commands, auth-signal verdict, referrer panel,
 * campaign enrichment (CVE chips, IP rep), pattern feedback.
 */

/* ── Origin reach status badge (inside campaign cards) ───────────────────── */
.origin-reach {
  font-size: 12px; font-weight: 500;
  padding: .3rem .7rem; border-radius: 5px;
  margin: .35rem 0 .1rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.origin-reach--2xx {
  background: rgba(239,83,80,.12); color: #c62828;
  border: 1px solid rgba(239,83,80,.25);
}
.origin-reach--srv {
  background: rgba(255,152,0,.1); color: #e65100;
  border: 1px solid rgba(255,152,0,.22);
}
.origin-reach--waf {
  background: rgba(56,217,169,.1); color: var(--allow);
  border: 1px solid rgba(56,217,169,.22);
}

/* ── Forensic audit commands (collapsible inside campaign cards) ─────────── */
.campaign-forensic {
  margin-top: .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.forensic-summary {
  font-size: 12px; font-weight: 600; color: var(--text2);
  padding: .4rem .7rem; cursor: pointer;
  background: var(--surface2);
  list-style: none; user-select: none;
  display: flex; align-items: center; gap: .4rem;
}
.forensic-summary::-webkit-details-marker { display: none; }
.campaign-forensic[open] .forensic-summary { border-bottom: 1px solid var(--border); }
.forensic-body {
  padding: .6rem .75rem;
  background: var(--surface);
}
.forensic-title {
  font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 .15rem;
}
.forensic-note {
  font-size: 11px; color: var(--muted); margin: 0 0 .65rem; font-style: italic;
}
.forensic-cmds {
  display: flex; flex-direction: column; gap: .45rem;
}
.forensic-cmd {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: .5rem;
  align-items: center;
  padding: .35rem .5rem;
  background: var(--surface2);
  border-radius: 5px;
  border: 1px solid var(--border);
}
.forensic-cmd-label {
  font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.forensic-cmd-code {
  font-size: 11.5px; font-family: var(--font-mono);
  color: var(--text); word-break: break-all; line-height: 1.4;
}
.copy-cmd-btn {
  font-size: 11px; padding: .2rem .55rem; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text2); cursor: pointer; white-space: nowrap;
  font-weight: 500;
}
.copy-cmd-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 600px) {
  .forensic-cmd { grid-template-columns: 1fr auto; }
  .forensic-cmd-label { display: none; }
}

.ops-mini-fix {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
}

.ops-mini-fix:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.server-stack-card {
  display: grid;
  gap: 1rem;
}

.server-stack-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.server-stack-label {
  color: var(--text);
  font-size: 22px;
  font-weight: 300;
}

.server-stack-confidence {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.server-stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.server-stack-badges span {
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
}

.checklist-intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Free-plan / optional rule count note in the intro */
.checklist-plan-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: .6rem;
}
.plan-note-free {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56,217,169,.12);
  color: var(--accent2);
}
.plan-note-optional {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(136,146,164,.1);
  color: var(--muted);
}

.checklist-groups {
  display: grid;
  gap: 12px;
}

.checklist-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  padding: 14px;
}

.checklist-group-head {
  margin-bottom: 10px;
}

.checklist-group-head span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.checklist-group-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

/* Slot + optional badges in the group header */
.checklist-slot-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(79,156,249,.12);
  color: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}
.checklist-optional-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(136,146,164,.1);
  color: var(--muted);
  border: 1px solid var(--border2);
  margin-left: 6px;
  vertical-align: middle;
}

/* Optional groups — subdued appearance */
.group-optional {
  opacity: .72;
  border-style: dashed;
}
.group-optional:hover {
  opacity: 1;
}

.checklist-items {
  display: grid;
  gap: 7px;
  margin: 0 0 12px 0;
  padding: 0;
  list-style: none;
}

.checklist-items label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.checklist-items input {
  margin-top: 3px;
  accent-color: var(--accent2);
}

.checklist-rule {
  position: relative;
  margin-top: 10px;
}

.checklist-rule .copy-rule-btn {
  position: absolute;
  top: 0;
  right: 0;
}

.checklist-note {
  margin-top: 10px;
  border-left: 2px solid var(--border2);
  padding-left: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.checklist-note a {
  color: var(--accent);
  text-decoration: underline;
}
.checklist-note a:hover {
  color: var(--text);
}

.waf-order-group {
  border-left: 3px solid var(--accent2);
}

.waf-order-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.waf-order-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.waf-order-list li > div {
  flex: 1;
  min-width: 0;
}

.waf-order-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.waf-order-list span:not(.waf-order-slot):not(.waf-order-optional-label) {
  display: block;
}

/* Numbered slot circles */
.waf-order-slot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  margin-top: 1px;
}
.waf-order-slot--core {
  background: rgba(79,156,249,.2);
  color: var(--accent);
  border: 1px solid rgba(79,156,249,.35);
}
.waf-order-slot--optional {
  background: rgba(136,146,164,.1);
  color: var(--muted);
  border: 1px solid var(--border2);
}

/* Divider row between core and optional */
.waf-order-divider {
  display: block !important;
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px dashed var(--border2);
}
.waf-order-optional-label {
  display: block !important;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 0;
}
.waf-order-item--optional {
  opacity: .65;
}
.waf-order-item--optional:hover {
  opacity: 1;
}

/* Bot Fight Mode tip */
.waf-bot-fight-tip {
  margin-top: 12px;
  padding: 9px 12px;
  background: rgba(79,156,249,.06);
  border: 1px solid rgba(79,156,249,.18);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.waf-bot-fight-tip strong {
  color: var(--accent);
}

@media (max-width: 640px) {
  .probe-row { grid-template-columns: 1fr; }
  .probe-stats { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .php-err-row { grid-template-columns: 1fr; }
  .php-err-left { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .ops-grid { grid-template-columns: 1fr; }
  .ops-row,
  .admin-event-row,
  .risk-score-wrap,
  .campaign-row { grid-template-columns: 1fr; }
  .ops-row-side { align-items: flex-start; }
  .campaign-count { justify-items: start; text-align: left; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Campaign auth-signal verdict (Bricks Builder / ambiguous endpoints)
───────────────────────────────────────────────────────────────────────────── */
.campaign-auth-verdict {
  margin-top: .75rem;
  padding: .65rem .85rem;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.auth-verdict-exploit { border-color: rgba(239,154,154,.4); background: rgba(239,154,154,.06); }
.auth-verdict-safe    { border-color: rgba(56,217,169,.35); background: rgba(56,217,169,.05);  }
.auth-verdict-mixed   { border-color: rgba(255,183,77,.35); background: rgba(255,183,77,.05);  }

.auth-verdict-label {
  font-weight: 600;
  font-size: 13px;
}
.auth-verdict-counts {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
}
.auth-count-safe    { color: var(--allow); }
.auth-count-exploit { color: var(--block); }
.auth-count-unknown { color: var(--muted); }

.auth-signals {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.auth-signal {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.auth-signal-safe    { background: rgba(56,217,169,.12);  color: var(--allow);     }
.auth-signal-exploit { background: rgba(239,154,154,.12); color: var(--block);     }

.auth-verdict-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Referrer panel
───────────────────────────────────────────────────────────────────────────── */
.ref-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .5rem;
}
.ref-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ref-row:last-child { border-bottom: none; }
.ref-host {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.ref-host > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.ref-paths { font-size: 11px; color: var(--muted); }
.ref-bar-wrap {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.ref-bar {
  height: 100%;
  background: var(--accent2);
  border-radius: 3px;
  transition: width .3s;
}
.ref-count {
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.ref-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  align-self: flex-start;
}
.ref-ads    { background: rgba(79,156,249,.15); color: var(--accent); }
.ref-social { background: rgba(240,98,146,.15); color: #f06292; }

@media (max-width: 600px) {
  .ref-host { flex: 0 0 140px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Campaign enrichment (Tier 2) — CVE chips, IP reputation, threat intel
───────────────────────────────────────────────────────────────────────────── */
.campaign-enrichment {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: .5rem; margin-top: .5rem;
}
.cve-slot       { display: flex; flex-wrap: wrap; gap: 4px; }
.cve-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600;
  text-decoration: none; font-family: var(--font-mono); white-space: nowrap;
  transition: opacity .15s;
}
.cve-chip:hover { opacity: .8; }
.cve-critical { background: rgba(239,154,154,.2); color: var(--block);     border: 1px solid rgba(239,154,154,.4); }
.cve-high     { background: rgba(255,183,77,.15);  color: var(--challenge); border: 1px solid rgba(255,183,77,.3); }
.cve-medium   { background: rgba(79,156,249,.1);   color: var(--accent);   border: 1px solid rgba(79,156,249,.2); }
.cve-low,
.cve-info     { background: var(--surface2);       color: var(--muted);    border: 1px solid var(--border2); }
.cve-score    { opacity: .7; font-size: 10px; }

/* IP reputation badges + on-demand check button */
.ip-rep        { font-size: 10px; padding: 1px 7px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.ip-rep-danger { background: rgba(239,154,154,.2); color: var(--block); }
.ip-rep-warn   { background: rgba(255,183,77,.15);  color: var(--challenge); }
.ip-rep-clean  { background: rgba(56,217,169,.1);   color: var(--allow); }
.ip-rep-btn {
  font-size: 10px; padding: 1px 7px; border-radius: 8px; font-weight: 600;
  border: 1px solid var(--border2); background: transparent; color: var(--muted);
  cursor: pointer; white-space: nowrap; line-height: 1.6;
  transition: border-color .15s, color .15s;
}
.ip-rep-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ip-rep-btn:disabled { opacity: .5; cursor: default; }

/* Threat intel snippets (Tier 3) */
.threat-intel-slot { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.threat-intel-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 2px;
}
.threat-intel-result {
  display: block; padding: .35rem .6rem;
  background: var(--surface2); border-radius: 5px;
  text-decoration: none; border: 1px solid var(--border2);
}
.threat-intel-result:hover { border-color: var(--accent); }
.ti-title   { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.ti-snippet { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Pattern feedback (Tier 4) — vote buttons + submit pattern
───────────────────────────────────────────────────────────────────────────── */
.feedback-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding-top: .6rem; margin-top: .6rem;
  border-top: 1px solid var(--border);
}
.feedback-label { font-size: 12px; color: var(--muted); }
.vote-btn {
  padding: 3px 11px; font-size: 12px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--surface2); color: var(--text);
  transition: background .12s, border-color .12s, color .12s;
}
.vote-confirm:hover { background: rgba(56,217,169,.15); border-color: var(--allow); color: var(--allow); }
.vote-fp:hover      { background: rgba(239,154,154,.15); border-color: var(--block); color: var(--block); }
.vote-btn:disabled  { opacity: .5; cursor: not-allowed; }
.vote-status        { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.submit-pattern-btn {
  display: block; width: calc(100% - 2rem); margin: 1rem 1rem 0;
  padding: 7px 16px; font-size: 13px;
  border: 1px dashed var(--border2); border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
  text-align: center; transition: border-color .12s, color .12s;
}
.submit-pattern-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .feedback-bar    { flex-direction: column; align-items: flex-start; }
  .campaign-enrichment { flex-direction: column; }
}
