/* ==========================================================================
   BAIXAFLOW CHAT & ATENDIMENTO INTELIGENTE — ESTILOS MODERNOS & RESPONSIVOS
   ========================================================================== */

/* Notificação Flutuante para Chamar Atenção para o Chat */
.bf-chat-callout {
  position: fixed;
  bottom: 86px;
  right: 24px;
  background: linear-gradient(135deg, rgba(5, 22, 45, 0.98), rgba(2, 10, 24, 0.98));
  border: 1.5px solid #00e5f5;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 245, 0.35);
  border-radius: 16px;
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 99991;
  max-width: 290px;
  backdrop-filter: blur(12px);
  animation: calloutBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.bf-chat-callout.show {
  display: flex !important;
}

.bf-chat-callout:hover {
  transform: translateY(-2px);
  border-color: #2bd576;
}

.bf-chat-callout-avatar {
  font-size: 24px;
  line-height: 1;
  animation: waveHand 2s infinite ease-in-out;
}

.bf-chat-callout-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bf-chat-callout-text strong {
  color: #00e5f5;
  font-size: 12px;
  font-weight: 800;
}

.bf-chat-callout-text span {
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
}

.bf-chat-callout-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #8da4be;
  font-size: 12px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 4px;
  align-self: flex-start;
  transition: all 0.2s ease;
  outline: none !important;
  box-shadow: none !important;
  flex-shrink: 0;
  z-index: 3;
}

.bf-chat-callout-close:hover {
  background: rgba(255, 77, 77, 0.25) !important;
  border-color: #ff4d4d !important;
  color: #ff4d4d !important;
  transform: scale(1.1);
}

.bf-chat-callout-close:focus,
.bf-chat-callout-close:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.5) !important;
}

@keyframes calloutBounce {
  0% { transform: translateY(15px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes waveHand {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(14deg); }
  40%, 80% { transform: rotate(-14deg); }
}

/* Botão Flutuante Discreto e Elegante (Launcher) */
.bf-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99992;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #072346 0%, #030d1d 100%);
  border: 1.5px solid #00e5f5;
  border-radius: 999px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 229, 245, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.bf-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #2bd576;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 35px rgba(43, 213, 118, 0.4);
}

.bf-chat-launcher:active {
  transform: scale(0.96);
}

.bf-chat-launcher-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bf-chat-launcher-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.bf-chat-icon-msg {
  width: 22px;
  height: 22px;
  stroke: #00e5f5;
  display: block;
}

.bf-chat-icon-close {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  display: none;
}

.bf-chat-launcher.active .bf-chat-icon-msg {
  display: none;
}

.bf-chat-launcher.active .bf-chat-icon-close {
  display: block;
}

.bf-chat-status-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2bd576;
  border: 1.5px solid #020814;
  box-shadow: 0 0 8px #2bd576;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.bf-chat-badge {
  background: #ff3355;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 51, 85, 0.8);
  animation: badgeBlink 2s infinite ease-in-out;
}

@keyframes badgeBlink {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); box-shadow: 0 0 16px rgba(255, 51, 85, 1); }
}

.bf-online-tag {
  font-size: 10px;
  font-weight: 800;
  color: #2bd576;
  background: rgba(43, 213, 118, 0.15);
  border: 1px solid rgba(43, 213, 118, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Janela do Chat */
.bf-chat-window {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100dvh - 100px);
  max-height: calc(100vh - 100px);
  background: linear-gradient(135deg, rgba(6, 21, 42, 0.98) 0%, rgba(2, 9, 20, 0.99) 100%);
  border: 1.5px solid rgba(0, 229, 245, 0.45);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 45px rgba(0, 229, 245, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99993;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: openChatWindow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bf-chat-window.open {
  display: flex !important;
}

@keyframes openChatWindow {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Cabeçalho do Chat */
.bf-chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(4, 18, 38, 0.95) 0%, rgba(2, 10, 22, 0.98) 100%);
  border-bottom: 1px solid rgba(0, 229, 245, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bf-chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.bf-chat-header-avatar,
.bf-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 229, 245, 0.2), rgba(8, 126, 255, 0.25));
  border: 1.5px solid #00e5f5;
  color: #00e5f5;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(0, 229, 245, 0.35);
  flex-shrink: 0;
  position: relative;
}

.bf-chat-header-avatar svg,
.bf-chat-avatar svg {
  width: 20px;
  height: 20px;
}

.bf-chat-avatar .online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2bd576;
  border: 1.5px solid #020814;
  box-shadow: 0 0 6px #2bd576;
}

.bf-chat-header-title,
.bf-chat-title-wrap h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bf-chat-header-subtitle,
.bf-chat-title-wrap p {
  margin: 0;
  font-size: 10.5px;
  color: #00e5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bf-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bf-chat-btn-icon {
  background: none;
  border: none;
  color: #8da4be;
  font-size: 18px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bf-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Corpo das Mensagens e Feed do Chat */
.bf-chat-body,
.bf-chat-messages {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 245, 0.4) transparent;
}

.bf-chat-body::-webkit-scrollbar,
.bf-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.bf-chat-body::-webkit-scrollbar-thumb,
.bf-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 245, 0.35);
  border-radius: 6px;
}

/* Balões de Mensagens */
.bf-chat-msg,
.bf-msg-item {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: fadeInMsg 0.25s ease-out;
  box-sizing: border-box;
  margin: 2px 0;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bf-chat-msg.msg-user,
.bf-msg-item.bf-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.bf-chat-msg.msg-bot,
.bf-chat-msg.msg-admin,
.bf-msg-item.bf-msg-bot,
.bf-msg-item.bf-msg-admin {
  align-self: flex-start;
  align-items: flex-start;
}

.bf-chat-msg.msg-system,
.bf-msg-item.bf-msg-system {
  align-self: center;
  max-width: 96%;
  text-align: center;
}

.bf-chat-msg-sender {
  font-size: 10.5px;
  color: #7992ad;
  margin-bottom: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.bf-chat-msg-bubble,
.bf-msg-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  position: relative;
  box-sizing: border-box;
  margin: 0 4px;
}

.bf-msg-text {
  line-height: 1.65;
  letter-spacing: 0.15px;
}

.bf-msg-text strong {
  color: #00e5f5;
  font-weight: 700;
}

.bf-chat-msg.msg-user .bf-chat-msg-bubble,
.bf-msg-item.bf-msg-user .bf-msg-bubble {
  background: linear-gradient(135deg, #00d9e8, #0588f0);
  color: #020b18;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 217, 232, 0.3);
}

.bf-chat-msg.msg-user .bf-msg-text strong,
.bf-msg-item.bf-msg-user .bf-msg-text strong {
  color: #020b18;
  font-weight: 800;
}

.bf-chat-msg.msg-bot .bf-chat-msg-bubble,
.bf-msg-item.bf-msg-bot .bf-msg-bubble {
  background: rgba(6, 24, 48, 0.95);
  border: 1.5px solid rgba(0, 229, 245, 0.35);
  color: #e5f1ff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 229, 245, 0.1);
}

.bf-chat-msg.msg-admin .bf-chat-msg-bubble,
.bf-msg-item.bf-msg-admin .bf-msg-bubble {
  background: rgba(4, 30, 22, 0.95);
  border: 1.5px solid rgba(43, 213, 118, 0.45);
  color: #f0fff6;
  border-bottom-left-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(43, 213, 118, 0.15);
}

.bf-chat-msg.msg-system .bf-chat-msg-bubble,
.bf-msg-item.bf-msg-system .bf-msg-bubble {
  background: rgba(120, 147, 175, 0.14);
  border: 1px dashed rgba(0, 229, 245, 0.4);
  color: #a4cebe;
  font-size: 11.5px;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.bf-chat-msg-time,
.bf-msg-time {
  font-size: 10px;
  color: #6a829e;
  margin-top: 6px;
  text-align: right;
  display: block;
  opacity: 0.85;
}

/* Anexos de Arquivos (Imagem / PDF) */
.bf-chat-file-preview-wrap {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
}

.bf-chat-file-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s ease;
}

.bf-chat-file-img:hover {
  transform: scale(1.02);
}

.bf-chat-file-pdf-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(2, 9, 22, 0.85);
  border: 1px solid rgba(0, 229, 245, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.2s ease;
}

.bf-chat-file-pdf-card:hover {
  background: rgba(0, 229, 245, 0.12);
  border-color: #00e5f5;
}

.bf-chat-pdf-icon {
  font-size: 24px;
}

.bf-chat-pdf-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bf-chat-pdf-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.bf-chat-pdf-size {
  font-size: 10px;
  color: #00e5f5;
}

/* Pílulas de Ações Rápidas do Bot */
.bf-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  background: rgba(3, 13, 28, 0.75);
  border-top: 1px solid rgba(0, 229, 245, 0.15);
}

.bf-quick-btn,
.bf-chat-quick-btn {
  background: rgba(4, 24, 50, 0.85);
  border: 1.5px solid rgba(0, 229, 245, 0.35);
  color: #72e9fc;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bf-quick-btn:hover,
.bf-chat-quick-btn:hover {
  background: rgba(0, 229, 245, 0.22);
  border-color: #00e5f5;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 229, 245, 0.35);
}

.bf-quick-btn:active,
.bf-chat-quick-btn:active {
  transform: scale(0.96);
}

/* Barra de Anexo Selecionado (Prévia antes de enviar) */
.bf-chat-attachment-preview,
.bf-chat-attachment-bar {
  display: none;
  padding: 8px 14px;
  background: rgba(4, 18, 38, 0.95);
  border-top: 1px solid rgba(0, 229, 245, 0.25);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: #a0bedc;
}

.bf-chat-attachment-preview.show,
.bf-chat-attachment-preview.visible,
.bf-chat-attachment-bar.show {
  display: flex !important;
}

.bf-attachment-thumb {
  font-size: 20px;
  line-height: 1;
}

.bf-attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.bf-attachment-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bf-attachment-size {
  color: #00e5f5;
  font-size: 10px;
}

.bf-attachment-remove,
.bf-chat-attachment-remove {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.4);
  color: #ff5252;
  font-size: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  padding: 0;
}

.bf-attachment-remove:hover,
.bf-chat-attachment-remove:hover {
  background: #ff5252;
  color: #ffffff;
}

/* Rodapé / Input do Chat */
.bf-chat-footer,
form.bf-chat-footer,
#bf-chat-form {
  padding: 10px 12px !important;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
  background: rgba(2, 8, 20, 0.98) !important;
  border-top: 1px solid rgba(27, 50, 78, 0.7) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 0 !important;
}

.bf-chat-btn-attach,
.bf-chat-btn-clip {
  background: rgba(0, 229, 245, 0.08) !important;
  border: 1.5px solid rgba(0, 229, 245, 0.35) !important;
  color: #00e5f5 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex: 0 0 40px !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.bf-chat-btn-attach svg,
.bf-chat-btn-clip svg {
  width: 20px !important;
  height: 20px !important;
  stroke: #00e5f5 !important;
  display: block !important;
}

.bf-chat-btn-attach:hover,
.bf-chat-btn-clip:hover {
  background: rgba(0, 229, 245, 0.2) !important;
  border-color: #00e5f5 !important;
  transform: scale(1.05) !important;
}

.bf-chat-input-wrapper {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.bf-chat-input {
  width: 100% !important;
  background: #030d1d !important;
  border: 1.5px solid #1a395f !important;
  border-radius: 20px !important;
  padding: 10px 14px !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  resize: none !important;
  line-height: 1.4 !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 96px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.bf-chat-input::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.bf-chat-input:focus {
  border-color: #00e5f5 !important;
  box-shadow: 0 0 12px rgba(0, 229, 245, 0.3) !important;
}

.bf-chat-btn-send {
  background: linear-gradient(135deg, #00e5f5, #087eff) !important;
  border: none !important;
  color: #020814 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex: 0 0 40px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 14px rgba(0, 229, 245, 0.4) !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.bf-chat-btn-send svg {
  width: 18px !important;
  height: 18px !important;
  stroke: #020814 !important;
  display: block !important;
}

.bf-chat-btn-send:hover {
  filter: brightness(1.15) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 6px 18px rgba(0, 229, 245, 0.6) !important;
}

.bf-chat-btn-send:active {
  transform: scale(0.94) !important;
}

.bf-chat-queue-banner {
  background: linear-gradient(135deg, rgba(255, 171, 0, 0.15), rgba(255, 107, 107, 0.15));
  border: 1px solid #ffab00;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 14px;
  color: #ffd580;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 15px rgba(255, 171, 0, 0.2);
  animation: pulseQueue 2s infinite ease-in-out;
}

.bf-chat-queue-banner.queue-connected {
  background: linear-gradient(135deg, rgba(43, 213, 118, 0.2), rgba(0, 229, 245, 0.2));
  border-color: #2bd576;
  color: #2bd576;
  box-shadow: 0 0 15px rgba(43, 213, 118, 0.3);
  animation: none;
}

@keyframes pulseQueue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.99); }
}
@media (max-width: 768px) {
  .bf-chat-callout {
    bottom: calc(130px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .bf-chat-launcher {
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .bf-chat-window {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: calc(100dvh - 145px);
    height: calc(100vh - 145px);
    border-radius: 16px;
  }

  .bf-chat-footer,
  form.bf-chat-footer,
  #bf-chat-form {
    padding: 8px 10px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
    gap: 6px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }

  .bf-chat-btn-attach,
  .bf-chat-btn-clip,
  .bf-chat-btn-send {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
  }

  .bf-chat-btn-attach svg,
  .bf-chat-btn-clip svg {
    width: 18px !important;
    height: 18px !important;
  }

  .bf-chat-btn-send svg {
    width: 16px !important;
    height: 16px !important;
  }

  .bf-chat-input {
    font-size: 15px !important; /* evita zoom safari mantendo proporção ideal */
    padding: 8px 12px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 19px !important;
    line-height: 1.35 !important;
  }
}

/* ==========================================================================
   PAINEL DE ATENDIMENTO NO ADMINISTRADOR (ABA CHAT AO VIVO)
   ========================================================================== */
.admin-chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: 600px;
  max-height: calc(85vh - 120px);
  background: #040e1e;
  border: 1px solid #1a385f;
  border-radius: 14px;
  overflow: hidden;
}

.admin-chat-sidebar {
  background: rgba(3, 11, 24, 0.95);
  border-right: 1px solid #162c4a;
  display: flex;
  flex-direction: column;
}

.admin-chat-sidebar-header {
  padding: 14px;
  border-bottom: 1px solid #162c4a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chat-search {
  background: #020814;
  border: 1px solid #1c3d64;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12.5px;
  width: 100%;
  box-sizing: border-box;
}

.admin-chat-search:focus {
  border-color: #00e5f5;
  outline: none;
}

.admin-chat-filter-tabs {
  display: flex;
  gap: 6px;
}

.admin-chat-filter-btn {
  background: none;
  border: 1px solid transparent;
  color: #7d96b2;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.admin-chat-filter-btn.active {
  background: rgba(0, 229, 245, 0.12);
  border-color: rgba(0, 229, 245, 0.4);
  color: #00e5f5;
}

.admin-chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-chat-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(22, 44, 74, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.admin-chat-item:hover {
  background: rgba(0, 229, 245, 0.05);
}

.admin-chat-item.active {
  background: rgba(0, 229, 245, 0.12);
  border-left: 3px solid #00e5f5;
}

.admin-chat-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #072242;
  border: 1px solid #00e5f5;
  color: #00e5f5;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.admin-chat-item-meta {
  flex: 1;
  min-width: 0;
}

.admin-chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.admin-chat-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-item-time {
  font-size: 10px;
  color: #6a84a2;
}

.admin-chat-item-last {
  font-size: 11.5px;
  color: #8da5be;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e5f5;
  box-shadow: 0 0 8px #00e5f5;
  flex-shrink: 0;
}

/* Área Principal de Conversa no Painel */
.admin-chat-main {
  display: flex;
  flex-direction: column;
  background: #030d1a;
}

.admin-chat-main-header {
  padding: 14px 18px;
  border-bottom: 1px solid #162c4a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(3, 13, 28, 0.8);
}

.admin-chat-main-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-chat-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
}

.admin-chat-status-pill.status-active {
  background: rgba(43, 213, 118, 0.15);
  border: 1px solid #2bd576;
  color: #2bd576;
}

.admin-chat-status-pill.status-closed {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid #ff5252;
  color: #ff8a80;
}

.admin-chat-thread {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-chat-canned-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  background: rgba(2, 8, 20, 0.6);
  border-top: 1px solid #14283f;
  scrollbar-width: none;
}

.admin-chat-canned-btn {
  background: rgba(0, 229, 245, 0.08);
  border: 1px solid rgba(0, 229, 245, 0.3);
  color: #7be4fc;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-chat-canned-btn:hover {
  background: rgba(0, 229, 245, 0.2);
  border-color: #00e5f5;
  color: #ffffff;
}

.admin-chat-composer {
  padding: 12px 16px;
  background: #020814;
  border-top: 1px solid #162c4a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-chat-composer-input {
  flex: 1;
  background: #041022;
  border: 1px solid #1c3c62;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.admin-chat-composer-input:focus {
  border-color: #00e5f5;
}

@media (max-width: 900px) {
  .admin-chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .admin-chat-sidebar {
    max-height: 220px;
  }
}

