/* Agent chat + findings panel (Bloc 4) */
.agent-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.agent-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.agent-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border, #dee2e6);
  border-radius: 20px;
  background: var(--card-bg, #fff);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.agent-btn.active {
  background: var(--accent, #00e676);
  color: #000;
  border-color: var(--accent, #00e676);
  font-weight: 700;
}

.agent-context { margin-bottom: 0.75rem; }
.agent-context select { width: 100%; max-width: 420px; }

.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-muted, #f8f9fa);
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border, #dee2e6);
}

.agent-welcome { text-align: center; color: var(--muted, #6c757d); padding: 2rem 1rem; }
.agent-welcome span { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

.agent-message { margin-bottom: 1rem; display: flex; }
.agent-message-user { justify-content: flex-end; }
.agent-message-agent, .agent-message-error { justify-content: flex-start; }

.message-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.agent-message-user .message-bubble {
  background: var(--accent, #00e676);
  color: #000;
}

.agent-message-agent .message-bubble {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #dee2e6);
  white-space: pre-wrap;
}

.agent-message-error .message-bubble {
  background: #f8d7da;
  color: #842029;
}

.typing { display: flex; gap: 4px; align-items: center; padding: 1rem; }
.typing span {
  width: 8px; height: 8px;
  background: #adb5bd;
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

.agent-input-zone { border-top: 1px solid var(--border, #dee2e6); padding-top: 0.75rem; }
.agent-suggestions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.agent-suggestions button {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-muted, #e9ecef);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.agent-suggestions button:hover { filter: brightness(0.95); }

.agent-input-row { display: flex; gap: 0.5rem; }
.agent-input-row textarea { flex: 1; resize: none; border-radius: 8px; }
.agent-tools-used { margin-top: 0.5rem; font-size: 11px; color: var(--muted, #6c757d); }

/* Findings panel enrichi */
.findings-panel-b4 .finding-item {
  animation: findingSlideIn 0.3s ease;
  border-left: 3px solid var(--border, #dee2e6);
}
.findings-panel-b4 .finding-inconnu { border-left-color: #6c757d; }
.findings-panel-b4 .finding-ambiguité { border-left-color: #ffc107; }
.findings-panel-b4 .finding-action_requise { border-left-color: #dc3545; }
.findings-panel-b4 .finding-info { border-left-color: #0dcaf0; }

@keyframes findingSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

#modal-reponse-finding {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}
#modal-reponse-finding .modal-content {
  background: var(--card-bg, #fff);
  padding: 1.5rem;
  border-radius: 8px;
  width: 440px;
  max-width: 95vw;
  border: 1px solid var(--border, #dee2e6);
}
#modal-reponse-finding textarea { width: 100%; margin: 0.75rem 0; min-height: 80px; }
.modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
