/* ===== POPOVER WORKFLOW MEDIÇÃO / OC ===== */

/* Classe aplicada pelo JS (list_popover.js) no tip do Bootstrap */
.popover.chr-wf-pop {
  border: 0;
  border-radius: 16px;
  box-shadow:
    0 10px 24px rgba(2, 6, 23, 0.14),
    0 3px 8px rgba(2, 6, 23, 0.10);
  width: 640px;
  max-width: min(640px, 92vw) !important;
  padding: 0;
  background: #ffffff;
  z-index: 10600;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.popover.chr-wf-pop .arrow { display: block !important; }
.popover.chr-wf-pop .popover-body { padding: 0; }

.chr-pop-header {
  padding: 12px 14px 8px 14px;
  border-bottom: 1px solid #eef2f7;
}
.chr-pop-title {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chr-pop-close {
  margin-left: auto;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: #64748b;
}
.chr-pop-close:hover { color: #111827; }

.chr-pop-content {
  padding: 12px 14px 14px 14px;
}

.chr-progress {
  background: #eef2f7;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.chr-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  width: 0%;
  transition: width .3s ease;
}
.chr-progress-info {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
}

.chr-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.chr-steps.chr-steps-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.chr-steps.chr-steps-2col .chr-step,
.chr-steps.chr-steps-2col .chr-step-left,
.chr-steps.chr-steps-2col .chr-step-title {
  min-width: 0;
}

.chr-step {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.chr-step.is-done {
  border-color: #e8f7ef;
  background: #f6fdf8;
}
.chr-step.is-active {
  border-color: #fff3cd;
  background: #fff9e6;
}
.chr-step.is-pending {
  opacity: .85;
}

.chr-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chr-step-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chr-step-ico {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: 0 0 22px;
}
.is-done .chr-step-ico { background: #dcfce7; color: #16a34a; }
.is-active .chr-step-ico { background: #fef3c7; color: #d97706; }
.is-pending .chr-step-ico { background: #f1f5f9; color: #64748b; }

.chr-step-title {
  font-weight: 600;
  color: #111827;
  font-size: 13px;
}

.chr-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.chr-badge.active { background: #f59e0b; color: #fff; }
.chr-badge.wait   { background: #e5e7eb; color: #374151; }

.chr-step-desc {
  margin-top: 6px;
  padding-left: 30px;
  color: #6b7280;
  font-size: 12px;
}
.chr-step-desc .muted {
  color: #94a3b8;
  font-size: 11px;
}

.chr-pop-footer {
  padding: 10px 14px;
  border-top: 1px solid #eef2f7;
}

.chr-popover-container {
  position: relative;
  display: inline-block;
}

/* Bloco de recusa no popover */
.chr-recusa-box {
  margin-top: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 10px;
  padding: 10px 12px;
}
.chr-recusa-title {
  font-weight: 700;
  font-size: 12px;
  color: #b91c1c;
  margin-bottom: 6px;
}
.chr-recusa-body {
  font-size: 11px;
  color: #7f1d1d;
  line-height: 1.5;
}

.chr-note-ico {
  cursor: help;
  margin-left: 6px;
  color: #f39c12;
}
.chr-note-ico:hover {
  opacity: .85;
}

@media (max-width: 640px) {
  .popover.chr-wf-pop { width: 92vw; }
  .chr-steps.chr-steps-2col { grid-template-columns: 1fr; }
}

/* ===== POPOVER AMBIENTE / CONEXÃO (badge CURSOR) ===== */
.popover.chr-conn-pop-tip {
  border: 0;
  border-radius: 12px;
  box-shadow:
    0 10px 24px rgba(2, 6, 23, 0.14),
    0 3px 8px rgba(2, 6, 23, 0.10);
  max-width: min(360px, 92vw) !important;
  padding: 0;
  z-index: 10600;
}

.popover.chr-conn-pop-tip .popover-header {
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  border-radius: 12px 12px 0 0;
  padding: 10px 14px;
}

.popover.chr-conn-pop-tip .popover-body {
  padding: 10px 14px 12px;
}

.chr-conn-pop {
  font-size: 12px;
  color: #111827;
}

.chr-conn-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.chr-conn-row:last-of-type {
  border-bottom: 0;
}

.chr-conn-k {
  color: #64748b;
  flex: 0 0 auto;
}

.chr-conn-v {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.chr-conn-hint {
  margin-top: 8px;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
}

.chr-popover-ambiente {
  cursor: pointer;
  user-select: none;
}

.chr-popover-ambiente:hover {
  filter: brightness(0.95);
}
