/* ── Horos Intelligence Panel — Fase 6 ────────────────────────────────────── */
/* Prefixo .hi- (Horos Intelligence)                                           */
/* Todas as cores via CSS variables — sem hardcode do tema                     */

/* ── Seção no RightPanel ──────────────────────────────────────────────────── */

.hi-panel {
  border-top: 1px solid var(--border);
  padding: 0;
}

.hi-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  cursor: pointer;
  user-select: none;
}

.hi-panel-head:hover {
  background: var(--bg-hover, rgba(255,255,255,0.04));
}

.hi-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--fg-4);
}

.hi-panel-title-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.hi-panel-title-dot.idle      { background: var(--fg-4); opacity: 0.4; }
.hi-panel-title-dot.processing { background: #1F93FF; animation: hi-pulse 1.2s ease-in-out infinite; }
.hi-panel-title-dot.pending   { background: #1F93FF; }
.hi-panel-title-dot.active    { background: #34d399; }

@keyframes hi-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.hi-panel-chevron {
  transition: transform 0.15s;
  color: var(--fg-4);
  flex-shrink: 0;
}

.hi-panel-chevron.open { transform: rotate(180deg); }

/* ── Conteúdo do painel ───────────────────────────────────────────────────── */

.hi-panel-body {
  padding: 0 16px 14px;
}

/* ── Badge de qualificação ───────────────────────────────────────────────── */

.hi-qual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.hi-qual-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid;
}

.hi-intent-bar-wrap {
  flex: 1;
  min-width: 0;
}

.hi-intent-bar-label {
  font-size: 9.5px;
  color: var(--fg-4);
  margin-bottom: 3px;
}

.hi-intent-bar-track {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.hi-intent-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ── Pills de sinais e objeções ─────────────────────────────────────────── */

.hi-pills-section {
  margin-bottom: 8px;
}

.hi-pills-label {
  font-size: 9.5px;
  color: var(--fg-4);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hi-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hi-signal-pill {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(31,147,255,0.10);
  color: #1F93FF;
  border: 1px solid rgba(31,147,255,0.22);
}

.hi-obj-pill {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(245,181,68,0.10);
  color: #f5b544;
  border: 1px solid rgba(245,181,68,0.22);
}

/* ── Próxima melhor ação ─────────────────────────────────────────────────── */

.hi-nba-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.hi-nba-action {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}

.hi-nba-reason {
  font-size: 10.5px;
  color: var(--fg-3);
  line-height: 1.4;
}

/* ── Caixa de sugestão ───────────────────────────────────────────────────── */

.hi-suggestion-wrap {
  margin-top: 8px;
}

.hi-suggestion-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.hi-suggestion-status-label {
  font-size: 10.5px;
  font-weight: 600;
}

.hi-suggestion-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  position: relative;
}

.hi-suggestion-box.pending { border-left-color: #1F93FF; }
.hi-suggestion-box.stale   { border-left-color: #f5b544; }
.hi-suggestion-box.done    { border-left-color: #34d399; opacity: 0.7; }
.hi-suggestion-box.rejected{ border-left-color: var(--border); opacity: 0.5; }
.hi-suggestion-box.expired { border-left-color: var(--border); opacity: 0.45; }
.hi-suggestion-box.edited  { border-left-color: #a78bfa; opacity: 0.7; }

.hi-suggestion-text {
  font-size: 12.5px;
  color: var(--fg);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.hi-suggestion-meta {
  font-size: 10px;
  color: var(--fg-4);
  margin-top: 6px;
}

/* ── Ações ───────────────────────────────────────────────────────────────── */

.hi-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hi-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.hi-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hi-btn-approve {
  background: #1F93FF;
  color: #fff;
  flex: 1;
}

.hi-btn-approve:hover:not(:disabled) { background: #1a82e6; }

.hi-btn-edit {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--border);
}

.hi-btn-edit:hover:not(:disabled) { background: var(--bg-4, var(--bg-3)); }

.hi-btn-reject {
  background: transparent;
  color: var(--fg-4);
  border: 1px solid var(--border);
}

.hi-btn-reject:hover:not(:disabled) { color: var(--fg-2); }

.hi-btn-takeover {
  background: transparent;
  color: var(--fg-3);
  border: 1px solid var(--border);
  font-size: 11.5px;
  padding: 5px 10px;
}

.hi-btn-takeover:hover:not(:disabled) { color: var(--fg); }

.hi-btn-resume {
  background: rgba(31,147,255,0.12);
  color: #1F93FF;
  border: 1px solid rgba(31,147,255,0.22);
  font-size: 11.5px;
  padding: 5px 10px;
}

.hi-btn-resume:hover:not(:disabled) { background: rgba(31,147,255,0.18); }

/* ── Edit inline ─────────────────────────────────────────────────────────── */

.hi-edit-area {
  width: 100%;
  min-height: 80px;
  background: var(--bg-1);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--fg);
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: 1.5;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 7px;
}

.hi-edit-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31,147,255,0.12);
}

/* ── Banners ─────────────────────────────────────────────────────────────── */

.hi-stale-banner {
  background: rgba(245,181,68,0.08);
  border: 1px solid rgba(245,181,68,0.22);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: #f5b544;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hi-stale-banner-msg {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.4;
}

.hi-human-banner {
  background: rgba(31,147,255,0.06);
  border: 1px solid rgba(31,147,255,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hi-human-banner-title {
  font-size: 12px;
  font-weight: 600;
  color: #1F93FF;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hi-human-banner-desc {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.4;
}

/* ── Processing ──────────────────────────────────────────────────────────── */

.hi-processing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--fg-3);
}

.hi-processing-dots {
  display: flex;
  gap: 3px;
}

.hi-processing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1F93FF;
  animation: hi-dot 1.2s ease-in-out infinite;
}

.hi-processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.hi-processing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes hi-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-2px); }
}

/* ── Error ───────────────────────────────────────────────────────────────── */

.hi-error-msg {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.22);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11.5px;
  color: #ef4444;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.hi-empty {
  padding: 12px 0;
  font-size: 11.5px;
  color: var(--fg-4);
  line-height: 1.5;
  text-align: center;
}

/* ── Suggestion Bar (acima do input) ─────────────────────────────────────── */

.hi-sugg-bar {
  display: flex;
  align-items: flex-start;   /* texto pode ter várias linhas: ícone/rótulo/botões ficam no topo */
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 44px;
}

.hi-sugg-bar.processing {
  background: rgba(31,147,255,0.04);
}

.hi-sugg-bar.stale {
  background: rgba(245,181,68,0.05);
  border-top-color: rgba(245,181,68,0.18);
}

.hi-sugg-bar.human {
  background: rgba(31,147,255,0.05);
  border-top-color: rgba(31,147,255,0.15);
}

.hi-sugg-bar-icon {
  flex-shrink: 0;
  color: var(--accent);
}

.hi-sugg-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-3);
  flex-shrink: 0;
  white-space: nowrap;
}

.hi-sugg-bar-icon,
.hi-sugg-bar-label { padding-top: 5px; }

/* Sugestão sempre completa: quebra linhas e respeita 
; rolagem só em textos muito longos */
.hi-sugg-bar-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 40vh;
  overflow-y: auto;
  padding-top: 3px;
  font-style: italic;
}

.hi-sugg-bar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.hi-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  background: transparent;
  color: var(--fg-3);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.hi-bar-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hi-bar-btn.approve {
  background: #1F93FF;
  color: #fff;
  border-color: #1F93FF;
}

.hi-bar-btn.approve:hover:not(:disabled) { background: #1a82e6; }
.hi-bar-btn:not(.approve):hover:not(:disabled) { background: var(--bg-3); color: var(--fg); }

/* ── Spinner inline ──────────────────────────────────────────────────────── */

.hi-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: hi-spin 0.7s linear infinite;
}

@keyframes hi-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Separador ───────────────────────────────────────────────────────────── */

.hi-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* ── Takeover footer ─────────────────────────────────────────────────────── */

.hi-takeover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.hi-takeover-hint {
  font-size: 10.5px;
  color: var(--fg-4);
  line-height: 1.3;
}
.hi-panel-title horos-mascot { margin: -5px 0 -4px; }
