/* ===== CHAT IA XBot ===== */
.chat-ia-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #6366f1), #8b5cf6);
    color: #fff; font-size: 26px; border: none; cursor: pointer;
    box-shadow: 0 8px 28px rgba(99,102,241,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: all .3s cubic-bezier(.16,1,.3,1);
}
.chat-ia-fab:hover { transform: scale(1.12) rotate(-6deg); }
.chat-ia-panel {
    position: fixed; bottom: 100px; right: 24px;
    width: 400px; max-width: calc(100vw - 32px);
    height: 600px; max-height: calc(100vh - 140px);
    background: #fff; border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    display: flex; flex-direction: column; overflow: hidden;
    z-index: 9999; border: 1px solid #e5e8f0;
}
.chat-ia-header {
    background: linear-gradient(135deg, var(--primary, #6366f1), #8b5cf6);
    color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.chat-ia-header-avatar { width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.chat-ia-header-info { flex: 1; }
.chat-ia-header-nome { font-weight: 800; font-size: 15px; }
.chat-ia-header-status { font-size: 11.5px; opacity: .85; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.chat-ia-header-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.chat-ia-header-actions button { background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.chat-ia-header-actions button:hover { background: rgba(255,255,255,.3); }
.chat-ia-body {
    flex: 1; overflow-y: auto; padding: 18px; background: #f4f6fb;
    display: flex; flex-direction: column; gap: 12px;
}
.chat-ia-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; word-wrap: break-word; }
.chat-ia-msg.user { align-self: flex-end; background: var(--primary, #6366f1); color: #fff; border-bottom-right-radius: 4px; }
.chat-ia-msg.assistant { align-self: flex-start; background: #fff; color: #0a0f1e; border: 1px solid #e5e8f0; border-bottom-left-radius: 4px; }
.chat-ia-msg.assistant strong { color: var(--primary, #6366f1); font-weight: 700; }
.chat-ia-msg.assistant code { background: #f1f5f9; padding: 1px 5px; border-radius: 5px; font-family: monospace; font-size: 12px; }
.chat-ia-msg.typing { align-self: flex-start; background: #fff; border: 1px solid #e5e8f0; padding: 12px 18px; border-radius: 16px; border-bottom-left-radius: 4px; }
.chat-ia-msg.typing span { display: inline-block; width: 8px; height: 8px; background: #94a3b8; border-radius: 50%; margin: 0 3px; animation: typingBounce 1.4s infinite; }
.chat-ia-msg.typing span:nth-child(2) { animation-delay: .2s; }
.chat-ia-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
.chat-ia-sugestoes { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-top: 1px solid #e5e8f0; }
.chat-ia-sugestao { background: #eef2ff; color: var(--primary, #6366f1); border: 1px solid #e5e8f0; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; }
.chat-ia-sugestao:hover { background: #e0e7ff; }
.chat-ia-input-wrap { padding: 12px 14px; background: #fff; border-top: 1px solid #e5e8f0; display: flex; gap: 8px; }
.chat-ia-input { flex: 1; padding: 12px 16px; border-radius: 14px; border: 1.5px solid #d0d4e0; background: #f4f6fb; color: #0a0f1e; font-size: 13.5px; font-family: inherit; resize: none; max-height: 100px; min-height: 44px; }
.chat-ia-input:focus { outline: none; border-color: var(--primary, #6366f1); }
.chat-ia-send { width: 44px; height: 44px; border-radius: 14px; border: none; background: var(--primary, #6366f1); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-ia-send:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 500px) {
    .chat-ia-panel { width: calc(100vw - 16px); right: 8px; bottom: 84px; height: calc(100vh - 120px); }
    .chat-ia-fab { bottom: 16px; right: 16px; width: 56px; height: 56px; }
}