/* Assistente Financeiro (Assistente IA > conversa) — js/assistant-chat.js. Cores da marca; verde/vermelho só como semáforo. */
#aiChatPanel .ai-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#aiChatPanel .ai-options { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 14px; }
#aiChatPanel .ai-options label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--gp-muted, #64748B); }
#aiChatPanel .ai-options select { min-width: 190px; }
#aiChatPanel .ai-options .ai-check { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; padding-bottom: 8px; }

#aiChatPanel .ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { #aiChatPanel .ai-layout { grid-template-columns: minmax(0, 1fr); } }

#aiChatPanel .ai-messages { display: flex; flex-direction: column; gap: 12px; min-height: 280px; max-height: 58vh; overflow-y: auto; padding: 14px; border: 1px solid var(--gp-border, #DCE6F0); border-radius: var(--gp-radius, 12px); background: var(--gp-background, #F4F8FC); }
#aiChatPanel .ai-msg { display: flex; }
#aiChatPanel .ai-user { justify-content: flex-end; }
#aiChatPanel .ai-bubble { max-width: 92%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: var(--gp-surface, #fff); border: 1px solid var(--gp-border, #DCE6F0); color: var(--gp-text, #102A43); overflow-wrap: anywhere; }
#aiChatPanel .ai-user .ai-bubble { background: var(--gp-navy, #08243B); border-color: var(--gp-navy, #08243B); color: #fff; }
#aiChatPanel .ai-bubble p { margin: 0 0 8px; }
#aiChatPanel .ai-bubble p:last-child { margin-bottom: 0; }
#aiChatPanel .ai-bubble ul, #aiChatPanel .ai-bubble ol { margin: 0 0 8px; padding-left: 20px; }
#aiChatPanel .ai-bubble li { margin-bottom: 3px; }
#aiChatPanel .ai-bubble h4 { margin: 8px 0 4px; font-size: 14px; }
#aiChatPanel .ai-bubble code { padding: 1px 5px; border-radius: 4px; background: #eef2f7; font-size: 12.5px; }
#aiChatPanel .ai-error { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
#aiChatPanel .ai-table-wrap { overflow-x: auto; margin: 4px 0 8px; }
#aiChatPanel .ai-table { min-width: 0; width: auto; border-collapse: collapse; font-size: 13px; }
#aiChatPanel .ai-table th, #aiChatPanel .ai-table td { padding: 5px 10px; border-bottom: 1px solid var(--gp-border, #DCE6F0); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
#aiChatPanel .ai-table th { background: #f4f7fa; font-weight: 800; }
#aiChatPanel .ai-actions { display: flex; gap: 14px; margin-top: 8px; }
#aiChatPanel .ai-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--gp-muted, #64748B); cursor: pointer; text-decoration: underline; }
#aiChatPanel .ai-link:hover { color: var(--gp-navy, #08243B); }
#aiChatPanel .ai-data { margin: 8px 0 0; max-height: 260px; overflow: auto; padding: 10px; border-radius: 8px; background: #0b1b2b; color: #cfe3f5; font-size: 11.5px; line-height: 1.4; }
#aiChatPanel .ai-data.hidden { display: none; }

#aiChatPanel .ai-empty { margin: auto; max-width: 440px; text-align: center; color: var(--gp-muted, #64748B); display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 24px 8px; }
#aiChatPanel .ai-empty .material-icons-round { font-size: 34px; color: var(--gp-gold, #DDB52F); }
#aiChatPanel .ai-empty strong { color: var(--gp-text, #102A43); font-size: 16px; }
#aiChatPanel .ai-empty p { margin: 0; font-size: 13px; }

#aiChatPanel .ai-typing { color: var(--gp-muted, #64748B); display: flex; align-items: center; gap: 4px; }
#aiChatPanel .ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gp-gold, #DDB52F); animation: ai-dot 1.1s infinite ease-in-out; }
#aiChatPanel .ai-typing span:nth-child(2) { animation-delay: .15s; }
#aiChatPanel .ai-typing span:nth-child(3) { animation-delay: .3s; margin-right: 6px; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #aiChatPanel .ai-typing span { animation: none; } }

#aiChatPanel .ai-form { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
#aiChatPanel .ai-form textarea { flex: 1; resize: vertical; min-height: 48px; }
#aiChatPanel .ai-foot { margin: 8px 0 0; font-size: 11.5px; color: var(--gp-muted, #64748B); }
#aiChatPanel .ai-foot #aiChatQuota { font-weight: 800; color: var(--gp-navy, #08243B); margin-right: 6px; }

#aiChatPanel .ai-suggest-col h3 { margin: 0 0 8px; font-size: 14px; }
#aiChatPanel .ai-group { border: 1px solid var(--gp-border, #DCE6F0); border-radius: 10px; margin-bottom: 8px; background: var(--gp-surface, #fff); }
#aiChatPanel .ai-group summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 800; color: var(--gp-navy, #08243B); display: flex; justify-content: space-between; gap: 8px; }
#aiChatPanel .ai-group summary small { font-weight: 700; color: var(--gp-muted, #64748B); }
#aiChatPanel .ai-q-list { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 8px; }
#aiChatPanel .ai-q { text-align: left; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; background: #f4f7fa; font: inherit; font-size: 12.5px; line-height: 1.35; color: var(--gp-text, #102A43); cursor: pointer; }
#aiChatPanel .ai-q:hover { border-color: var(--gp-gold, #DDB52F); background: #fff8e8; }
#aiChatPanel .ai-q:focus-visible { outline: 2px solid var(--gp-gold, #DDB52F); outline-offset: 1px; }
#aiChatPanel .ai-options .ai-check input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; }
