/* Bloco de perguntas */
.pergunta-bloco {
  background: #f8f9fa;
  border: 2px solid #ced4da;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 3px;
  font-size: 13px;
  display: grid;
}

/* Títulos e campos */
.pergunta-bloco label {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

.pergunta-bloco input[type="text"],
.pergunta-bloco select,
.pergunta-bloco textarea {
  padding: 3px 6px !important;
  font-size: 13px !important;
  height: 28px !important;
  line-height: 1.2;
  margin-bottom: 0;
}

.pergunta-bloco textarea {
  height: auto !important;
  resize: vertical;
  min-height: 48px;
}

.pergunta-bloco input[type="text"]::placeholder,
.pergunta-bloco textarea::placeholder {
  font-style: italic;
  color: #999;
}

.pergunta-bloco input:focus,
.pergunta-bloco select:focus,
.pergunta-bloco textarea:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.05rem rgba(13, 110, 253, 0.15);
}

.pergunta-bloco .form-select {
  appearance: auto;
  height: 28px !important;
}

.pergunta-bloco .form-control.mt-1 {
  margin-top: 2px !important;
}

/* Botões */
.btn-responder {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}

.btn-responder.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-responder.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-responder.btn-success {
  background-color: #198754;
  border-color: #198754;
}

.btn-responder.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
}

/* Botões finais */
.add-final-btn,
.revisar-btn {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  line-height: 1;
  cursor: pointer;
}

.add-final-btn {
  border: 1px solid #0d6efd;
  background-color: #f0f7ff;
  color: #0d6efd;
}

.add-final-btn:hover {
  background-color: #d9ebff;
}

/*.revisar-btn {
  color: #333;
  border-color: #999;
}
*/  

.revisar-btn:hover {
  background-color: #f1f1f1;
  color: #111;
  border-color: #666;
}

/* Editor de orçamento */
.orcamento-editor {
  margin-top: 12px;
}
.orcamento-editor td input {
  padding: 3px 6px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  height: 28px;
}
.orcamento-editor td {
  padding: 2px 4px !important;
  vertical-align: middle;
}
.orcamento-editor table {
  font-size: 13px;
}
.orcamento-editor strong {
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

/* Bloco revisado */
.msg.bot.revisado {
  border-left: 4px solid #198754;
  background-color: #f6fff8;
}

/* Bloco de adição inteligente */
.adicionar-inteligente {
  background: #f8f9fa;
  border: 1px dashed #bbb;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 16px;
  display: grid;
}

.adicionar-inteligente label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
}

.adicionar-inteligente .input-group input {
  font-size: 13px;
  padding: 4px 6px;
  height: 30px;
}

.adicionar-inteligente .btn {
  font-size: 13px;
  padding: 4px 8px;
  height: 30px;
}

.adicionar-inteligente .sugestoes {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sugestao-item {
  background: #fff;
  border-left: 4px solid #0d6efd;
  padding: 6px 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sugestao-item:hover {
  background-color: #f1f8ff;
}

.sugestao-item .btn {
  font-size: 12px;
  padding: 2px 8px;
}

/* Mensagens */
.msg {
  margin: 4px 0;
  padding: 10px;
  border-radius: 10px;
  max-width: 75%;
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease-in-out;
}

.msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* Diferenciação */
.user {
  background: #d0ebff;
  margin-left: auto;
}

.bot {
  background: #e9ecef;
  position: relative;
}

/* Tabelas renderizadas */
.bot table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 13px;
}
.bot table, .bot th, .bot td {
  border: 1px solid #ccc;
}
.bot th, .bot td {
  padding: 8px;
  text-align: left;
}
.bot th {
  background-color: #eee;
}

/* Ajustes finos */
.bot p:empty,
.bot br + br,
.markdown-link {
  display: none;
}

.chat-box .bot:not(:last-child) {
  margin-bottom: 8px;
}
.bot > :last-child {
  margin-bottom: 0 !important;
}

/* Título da aba */
.chat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-title input {
  border: none;
  background: transparent;
  font-weight: bold;
  width: 100%;
}
.chat-title input:focus {
  outline: none;
  background: #fff3cd;
}
