/*
  Histórico de Atendimento - estilos dedicados
  Premium Design System v2.0
*/

.historico-box {
  border: 1px solid rgba(152, 177, 182, 0.3); /* Brand Secondary com opacidade */
  border-radius: var(--radius-premium);
  padding: 1.5rem;
  background: #ffffff;
  box-shadow: var(--shadow-ui);
}

.header-historico {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(13, 63, 78, 0.1);
}

.header-historico h5 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--brand-primary);
  font-size: 1.1rem;
}

.header-actions .btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Melhor legibilidade do botão "Novo Atendimento" */
.header-historico .header-actions .btn.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 6px rgba(13, 63, 78, 0.2);
  transition: all 0.3s ease;
}

.header-historico .header-actions .btn.btn-primary:hover,
.header-historico .header-actions .btn.btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(13, 63, 78, 0.25);
}

.header-historico .header-actions .btn.btn-primary.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

.header-historico .header-actions .btn.btn-primary i {
  margin-right: 6px;
}

.hist-item {
  position: relative;
  border: 1px solid rgba(152, 177, 182, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--brand-bg-soft);
  transition: all 0.2s ease;
}

.hist-item:hover {
  background: #ffffff;
  box-shadow: var(--shadow-ui);
  border-color: rgba(13, 63, 78, 0.1);
}

/* Indicador lateral removido conforme solicitado */

.accent {
  padding-left: 0;
  flex: 1;
  background: transparent;
}

.hist-title {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-primary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.hist-desc {
  color: var(--gray-600); /* Usando var do bootstrap ou fallback */
  margin-top: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.badges {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.8em;
  border-radius: 6px; /* Less pill, more modern rect */
  color: var(--brand-primary); /* Texto escuro para legibilidade padrão */
  background: rgba(0,0,0,0.05); /* Fundo padrão sutil */
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 0;
}

.hist-meta {
  margin-top: 0.75rem;
  color: var(--brand-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.timestamp {
  margin-left: auto;
  color: var(--brand-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  font-weight: 500;
}

/* Cores por Canal - Adaptado para Paleta Premium */
.badge-channel.whatsapp { background: #25D366; color: #fff; } /* Brand exception */
.badge-channel.presencial { background: var(--brand-primary); color: #fff; }
.badge-channel.email { background: var(--brand-secondary); color: var(--brand-primary); }
.badge-channel.telefone { background: var(--brand-support); color: var(--brand-primary); }
.badge-channel.outros { background: #6c757d; color: #fff; }
.badge-channel.inst { background: #0d3f4e; color: #fff; } /* Instituição: destaca antes das demais */

/* Cores por Status - Premium Palette */
.badge-status.andamento {
  background: var(--brand-secondary);
  color: var(--brand-primary);
}

.badge-status.concluido {
  background: var(--brand-primary); /* Azul Petróleo Elegante */
  color: #fff;
}

.badge-status.pendente {
  background: var(--brand-accent); /* Amarelo Creme */
  color: var(--brand-primary); /* Texto escuro para contraste */
  border: 1px solid rgba(13, 63, 78, 0.1);
}

.badge-status.atrasado {
  background: #e74c3c; /* Alert Red - Mantendo semântica */
  color: #fff;
}

.badge-status.cancelado {
  background: #95a5a6;
  color: #fff;
}

.badge-status.default {
  background: var(--gray-400);
}


/* Conversa inline abaixo do formulário de respostas */
.conversation-scroll {
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid rgba(13, 63, 78, 0.1);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: #ffffff;
}

@media (max-width: 991.98px) {
  .conversation-scroll { max-height: 50vh; }
}
@media (max-width: 575.98px) {
  .conversation-scroll { max-height: 58vh; }
}

/* Hover sutil em linhas de tabela */
.conversation-scroll table.table-hover tbody tr:hover {
  background-color: var(--brand-bg-soft);
}
