/* Fabi widget global (Sprint 43.2). Auto-contido, tema próprio (gradient roxo→cyan). */
#fabi-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9990; }

.fabi-trigger {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border: none; border-radius: 999px; color: #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,.35); transition: all .3s;
}
.fabi-trigger:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124,58,237,.45); }
.fabi-trigger-icon { width: 36px; height: 36px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.fabi-trigger-pulse { position: absolute; top: 12px; left: 14px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); animation: fabi-pulse 2s infinite; pointer-events: none; }
@keyframes fabi-pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.fabi-trigger-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; padding-right: 4px; }
.fabi-trigger-label span { font-size: 11px; opacity: .85; text-transform: uppercase; }
.fabi-trigger-label strong { font-size: 16px; font-weight: 600; }

.fabi-panel { width: 420px; height: 600px; max-height: 80vh; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; animation: fabi-up .25s ease-out; }
@keyframes fabi-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) { .fabi-panel { width: calc(100vw - 32px); height: calc(100vh - 80px); } .fabi-trigger-label { display: none; } }

.fabi-panel-header { padding: 16px 20px; background: linear-gradient(135deg, #7c3aed, #06b6d4); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.fabi-brand { display: flex; align-items: center; gap: 12px; }
.fabi-avatar { width: 40px; height: 40px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.fabi-name { font-size: 16px; font-weight: 600; }
.fabi-sub { font-size: 11px; opacity: .85; }
.fabi-actions { display: flex; gap: 4px; }
.fabi-icon { width: 32px; height: 32px; background: rgba(255,255,255,.15); border: none; border-radius: 8px; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fabi-icon:hover { background: rgba(255,255,255,.28); }

.fabi-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: .5px solid rgba(0,0,0,.08); }
.fabi-sug { padding: 5px 12px; background: #f3f4f6; border: .5px solid transparent; border-radius: 999px; font-size: 11px; color: #4b5563; cursor: pointer; }
.fabi-sug:hover { background: #ede9fe; border-color: #7c3aed; color: #4c1d95; }

.fabi-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #fafafa; }
.fabi-empty { text-align: center; padding: 40px 20px; color: #6b7280; }
.fabi-empty i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }

.fabi-msg-u { display: flex; justify-content: flex-end; }
.fabi-msg-u > div { max-width: 80%; padding: 10px 14px; background: #7c3aed; color: #fff; border-radius: 12px 12px 4px 12px; font-size: 13px; }
.fabi-msg-b { display: flex; gap: 10px; }
.fabi-av, .fabi-av-err { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.fabi-av { background: linear-gradient(135deg, #7c3aed, #06b6d4); }
.fabi-av-err { background: #ef4444; }
.fabi-msg-c { flex: 1; min-width: 0; }
.fabi-bubble { padding: 10px 14px; background: #fff; border: .5px solid #eef0f2; border-radius: 12px 12px 12px 4px; font-size: 13px; line-height: 1.5; color: #1f2937; }
.fabi-err { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.fabi-meta { display: flex; gap: 8px; font-size: 11px; color: #9ca3af; margin-top: 4px; }

.fabi-kpi { font-size: 28px; font-weight: 600; color: #7c3aed; text-align: center; padding: 12px 0; }
.fabi-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fabi-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.fabi-bar-l { width: 70px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fabi-bar-t { flex: 1; height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.fabi-bar-f { height: 100%; background: linear-gradient(90deg, #7c3aed, #06b6d4); transition: width .4s; }
.fabi-bar-v { width: 40px; text-align: right; font-weight: 500; color: #1f2937; }

.fabi-load { display: flex; gap: 4px; }
.fabi-load span { width: 8px; height: 8px; background: #7c3aed; border-radius: 50%; animation: fabi-b 1.4s ease-in-out infinite both; }
.fabi-load span:nth-child(2) { animation-delay: .16s; }
.fabi-load span:nth-child(3) { animation-delay: .32s; }
@keyframes fabi-b { 0%,80%,100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.fabi-input { display: flex; gap: 8px; padding: 12px 16px; border-top: .5px solid rgba(0,0,0,.08); background: #fff; }
.fabi-input input { flex: 1; padding: 10px 14px; border: .5px solid #e5e7eb; border-radius: 10px; font-size: 13px; outline: none; background: #fff; color: #1f2937; }
.fabi-input input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.fabi-input button { width: 40px; height: 40px; background: linear-gradient(135deg, #7c3aed, #06b6d4); border: none; border-radius: 10px; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
