/* dist/css/assistente.css — assistente do painel (chat de canto). */

.ast {
  --ast-raio: 14px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1040; /* abaixo dos modais do Bootstrap (1050+) */
  font-size: calc(14px * var(--aia-text-scale, 1));
}

.ast-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--tblr-primary, #206bc4);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ast-fab:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28); }
.ast-fab:focus-visible { outline: 3px solid var(--tblr-primary-lt, #cfe2ff); outline-offset: 2px; }
.ast-aberto .ast-fab { display: none; }
/* Na aba Config a barra "Salvar alteracoes" fica presa no rodape: o botao sobe. */
body:has(#tab-config.active) .ast { bottom: 84px; }

.ast-painel {
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: var(--ast-raio);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}
.ast-painel[hidden] { display: none; }

.ast-topo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 10px 16px;
  border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
}
.ast-topo > div { flex: 1; min-width: 0; }
.ast-titulo { font-weight: 600; }
.ast-sub { font-size: calc(12px * var(--aia-text-scale, 1)); color: var(--tblr-secondary, #667382); }
.ast-icone {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tblr-secondary, #667382);
  cursor: pointer;
}
.ast-icone:hover { background: var(--tblr-bg-surface-secondary, #f6f8fb); color: inherit; }

.ast-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ast-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ast-msg p { margin: 0 0 6px; }
.ast-msg p:last-child, .ast-msg ul:last-child, .ast-msg ol:last-child { margin-bottom: 0; }
.ast-msg ul, .ast-msg ol { margin: 0 0 6px; padding-left: 18px; }
.ast-eu {
  align-self: flex-end;
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.ast-ia {
  align-self: flex-start;
  background: var(--tblr-bg-surface-secondary, #f1f3f6);
  border-bottom-left-radius: 4px;
}
.ast-erro { background: var(--tblr-danger-lt, #fbebeb); color: var(--tblr-danger, #d63939); }

.ast-digitando { display: flex; gap: 4px; padding: 12px; }
.ast-digitando span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tblr-secondary, #667382);
  animation: ast-pulo 1s infinite ease-in-out;
}
.ast-digitando span:nth-child(2) { animation-delay: 0.15s; }
.ast-digitando span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ast-pulo { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.ast-vazio p { margin: 0 0 10px; color: var(--tblr-secondary, #667382); }
.ast-sugestoes { display: flex; flex-direction: column; gap: 6px; }
.ast-chip {
  text-align: left;
  padding: 7px 10px;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ast-chip:hover { border-color: var(--tblr-primary, #206bc4); color: var(--tblr-primary, #206bc4); }
.ast-chip-destaque {
  border-color: var(--tblr-primary, #206bc4);
  background: var(--tblr-primary-lt, #e8f1fb);
  color: var(--tblr-primary, #206bc4);
  font-weight: 600;
}
.ast-proximas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ast-chip-mini { padding: 5px 9px; font-size: calc(12.5px * var(--aia-text-scale, 1)); border-radius: 14px; }

.ast-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
  border-top: 1px solid var(--tblr-border-color, #e6e7e9);
}
.ast-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  padding: 8px 10px;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.ast-input:focus { outline: none; border-color: var(--tblr-primary, #206bc4); }
.ast-enviar {
  width: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  cursor: pointer;
}
.ast-nota { padding: 0 12px 10px; font-size: calc(11px * var(--aia-text-scale, 1)); color: var(--tblr-secondary, #667382); }

@media (prefers-reduced-motion: reduce) {
  .ast-fab, .ast-digitando span { transition: none; animation: none; }
}
@media print { .ast { display: none; } }
