/* Inteligência Artificial (Beta) — análise do ambiente + chat */
.ai-beta { display: inline-block; vertical-align: middle; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; color: #fff; background: linear-gradient(90deg, #7c3aed, #2563eb); margin-left: 6px; }
.ai-orb { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, #7c3aed, #2563eb 60%, #06b6d4); box-shadow: 0 6px 18px -6px #7c3aed88; }
.ai-orb svg { width: 22px; height: 22px; }
.ai-orb.sm { width: 40px; height: 40px; border-radius: 12px; } .ai-orb.sm svg { width: 19px; height: 19px; }
.ai-orb.big { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 10px; } .ai-orb.big svg { width: 30px; height: 30px; }
.ai-orb.pulse { animation: ai-pulse 1.6s ease-in-out infinite; }
@keyframes ai-pulse { 50% { transform: scale(1.08); box-shadow: 0 10px 30px -6px #7c3aedcc; } }
.ai-intro { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 14px; }
.ai-intro p { margin: 4px 0 0; font-size: 13px; }
.ai-eng { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: hsl(var(--muted-fg)); padding: 4px 9px; border: 1px solid hsl(var(--border)); border-radius: 99px; white-space: nowrap; }
.ai-eng svg { width: 13px; height: 13px; }
.ai-eng.off { color: hsl(var(--danger)); border-color: hsl(var(--danger) / .4); }
.ai-ov-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ai-k { padding: 14px 18px; }
.ai-k small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-fg)); font-weight: 700; }
.ai-k b { font-size: 26px; font-weight: 800; }
.ai-k b span { font-size: 14px; color: hsl(var(--muted-fg)); margin-left: 4px; font-weight: 600; }
.ai-k b.ok { color: hsl(var(--success)); } .ai-k b.warn { color: hsl(38 92% 42%); } .ai-k b.crit { color: hsl(var(--danger)); }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ai-cc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; transition: transform .15s; }
.ai-cc:hover { transform: translateY(-2px); }
.ai-cc small { display: block; font-size: 11.5px; color: hsl(var(--muted-fg)); line-height: 1.35; margin-top: 2px; }
.ai-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.ai-go { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #7c3aed; white-space: nowrap; }
.dark .ai-go { color: #a78bfa; }
.ai-go svg { width: 14px; height: 14px; }

.ai-ring .bg { fill: none; stroke: hsl(var(--muted)); stroke-width: 9; }
.ai-ring .fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray .6s; }
.ai-ring.ok .fg { stroke: hsl(var(--success)); } .ai-ring.warn .fg { stroke: hsl(var(--warning)); } .ai-ring.crit .fg { stroke: hsl(var(--danger)); }
.ai-ring text { font-weight: 800; font-size: 30px; fill: hsl(var(--fg)); }
.ai-cc .ai-ring text { font-size: 17px; }
.ai-cc .ai-ring .bg, .ai-cc .ai-ring .fg { stroke-width: 6; }

.ai-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.ai-ht { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ai-src { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: hsl(var(--muted)); color: hsl(var(--fg)); border: 1px solid transparent; }
.ai-chip svg { width: 12px; height: 12px; color: #7c3aed; }
.dark .ai-chip svg { color: #a78bfa; }
.ai-chip b { color: hsl(var(--muted-fg)); }
.ai-chip.err { background: hsl(var(--danger) / .1); color: hsl(var(--danger)); }
.ai-chip.ghost { background: none; border-color: hsl(var(--border)); color: hsl(var(--muted-fg)); cursor: pointer; }
.ai-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 520px; }
.ai-act select { max-width: 230px; }
.ai-act select { font: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--card)); color: hsl(var(--fg)); }
.ai-act .btn.primary { background: linear-gradient(90deg, #7c3aed, #2563eb); border: 0; color: #fff; }

#ai-root { container-type: inline-size; }
.ai-head > .grow, .ai-sum > .grow, .ai-intro > .grow, .ai-cc > .grow { flex: 1; min-width: 0; }
.ai-ring { flex-shrink: 0; }
.ai-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
@container (max-width: 1080px) { .ai-main { grid-template-columns: 1fr; } .ai-chat { position: static; height: 620px; } }
.ai-rep { display: grid; gap: 14px; min-width: 0; }
.ai-empty { padding: 44px 24px; text-align: center; }
.ai-empty h3 { margin: 4px 0 6px; }
.ai-empty p { max-width: 520px; margin: 0 auto 14px; font-size: 13px; }
.ai-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ai-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 99px; background: hsl(var(--muted)); opacity: .35; animation: ai-step 1.2s ease forwards; }
.ai-steps svg { width: 13px; height: 13px; }
@keyframes ai-step { to { opacity: 1; background: hsl(262 83% 58% / .12); } }

.ai-sum { display: flex; gap: 20px; align-items: center; padding: 18px 22px; }
.ai-lbl { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-fg)); font-weight: 700; }
.ai-sum h2 { margin: 2px 0 6px; font-size: 19px; }
.ai-sum p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; }
.ai-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ai-area { padding: 12px 14px; }
.ai-area-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ai-area-h svg { width: 15px; height: 15px; color: hsl(var(--muted-fg)); }
.ai-area-h span { margin-left: auto; font-weight: 800; font-size: 18px; }
.ai-area.ok .ai-area-h span { color: hsl(var(--success)); } .ai-area.warn .ai-area-h span { color: hsl(38 92% 42%); } .ai-area.crit .ai-area-h span { color: hsl(var(--danger)); }
.ai-bar { height: 6px; border-radius: 99px; background: hsl(var(--muted)); margin: 8px 0 6px; overflow: hidden; }
.ai-bar i { display: block; height: 100%; border-radius: 99px; }
.ai-area.ok .ai-bar i { background: hsl(var(--success)); } .ai-area.warn .ai-bar i { background: hsl(var(--warning)); } .ai-area.crit .ai-bar i { background: hsl(var(--danger)); }
.ai-area small { font-size: 12px; color: hsl(var(--muted-fg)); }
.ai-risk { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid hsl(var(--border)); font-size: 13px; }
.ai-sev { flex-shrink: 0; width: 56px; text-align: center; font-size: 11px; font-weight: 800; padding: 3px 0; border-radius: 6px; background: hsl(var(--muted)); height: fit-content; }
.ai-risk.crit .ai-sev { background: hsl(var(--danger) / .13); color: hsl(var(--danger)); }
.ai-risk.warn .ai-sev { background: hsl(var(--warning) / .18); color: hsl(38 92% 36%); }
.ai-risk.low .ai-sev { background: hsl(var(--info) / .12); color: hsl(var(--info)); }
.ai-ev, .ai-do { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; margin-top: 4px; color: hsl(var(--muted-fg)); }
.ai-do { color: hsl(var(--fg)); }
.ai-ev svg, .ai-do svg { width: 13px; height: 13px; margin-top: 2px; flex-shrink: 0; }
.ai-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.ai-rec { display: flex; gap: 10px; padding: 11px 16px; border-top: 1px solid hsl(var(--border)); font-size: 13px; }
.ai-rec p { margin: 2px 0 0; font-size: 12.5px; color: hsl(var(--muted-fg)); }
.ai-tag { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; height: fit-content; white-space: nowrap; background: hsl(var(--muted)); }
.ai-tag svg { width: 12px; height: 12px; }
.ai-tag.t-rapida { background: hsl(var(--success) / .13); color: hsl(var(--success)); }
.ai-tag.t-projeto { background: hsl(217 91% 60% / .13); color: hsl(217 91% 50%); }
.ai-tag.t-comercial { background: hsl(262 83% 58% / .13); color: hsl(262 83% 55%); }
.ai-tag.t-gap { background: hsl(var(--warning) / .16); color: hsl(38 92% 36%); }
.ai-disc { font-size: 11.5px; display: flex; gap: 6px; align-items: center; margin: 0; }
.ai-disc svg { width: 13px; height: 13px; }

.ai-chat { position: sticky; top: 12px; display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 520px; overflow: hidden; }
.ai-ch { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid hsl(var(--border)); }
.ai-ch b { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.ai-ch b svg { width: 16px; height: 16px; color: #7c3aed; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-hello { text-align: center; color: hsl(var(--muted-fg)); font-size: 13px; padding: 20px 10px 0; }
.ai-hello svg { width: 30px; height: 30px; color: #7c3aed; }
.ai-m { display: flex; gap: 8px; align-items: flex-start; }
.ai-m.me { justify-content: flex-end; }
.ai-m.me .ai-b { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.ai-av { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; color: #fff; background: linear-gradient(135deg, #7c3aed, #2563eb); }
.ai-av svg { width: 14px; height: 14px; }
.ai-m.err .ai-av { background: hsl(var(--danger)); }
.ai-b { max-width: 88%; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: hsl(var(--muted)); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-b.md p { margin: 0 0 6px; } .ai-b.md ul, .ai-b.md ol { margin: 4px 0 6px; padding-left: 18px; } .ai-b.md li { margin: 2px 0; }
.ai-b.md > :last-child { margin-bottom: 0; }
.ai-b small { display: block; font-size: 10.5px; color: hsl(var(--muted-fg)); margin-top: 6px; }
.ai-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--muted-fg)); animation: ai-dot 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 50% { opacity: .25; transform: translateY(-3px); } }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-sugs button { font: inherit; font-size: 12px; text-align: left; padding: 6px 10px; border-radius: 10px; border: 1px solid hsl(262 83% 58% / .3); background: hsl(262 83% 58% / .06); color: hsl(var(--fg)); cursor: pointer; }
.ai-sugs button:hover { background: hsl(262 83% 58% / .14); }
.ai-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); align-items: flex-end; }
.ai-in textarea { flex: 1; resize: none; font: inherit; font-size: 13px; padding: 9px 11px; border-radius: 10px; border: 1px solid hsl(var(--border)); background: hsl(var(--input-bg)); color: hsl(var(--fg)); outline: none; }
.ai-in textarea:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px #7c3aed22; }
.ai-in .btn.primary { background: linear-gradient(135deg, #7c3aed, #2563eb); border: 0; height: 40px; }

@container (max-width: 760px) { .ai-two, .ai-ov-kpis { grid-template-columns: 1fr; } }

/* excluir análises */
.ai-dlist { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; margin-top: 6px; }
.ai-dl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: 10px; cursor: pointer; font-size: 13px; }
.ai-dl.all { border: 0; padding: 4px 10px; }
.ai-dl.dis { opacity: .5; cursor: not-allowed; }
.ai-dl .grow { flex: 1; min-width: 0; }
.ai-dl small { display: block; font-size: 11.5px; color: hsl(var(--muted-fg)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-dn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; background: hsl(var(--muted)); }
.ai-dn.ok { background: hsl(var(--success) / .13); color: hsl(var(--success)); } .ai-dn.warn { background: hsl(var(--warning) / .18); color: hsl(38 92% 36%); } .ai-dn.crit { background: hsl(var(--danger) / .13); color: hsl(var(--danger)); }
.ai-per { display: inline-flex; align-items: center; gap: 6px; color: hsl(var(--muted-fg)); }
.ai-per svg { width: 15px; height: 15px; }
.ai-per select { width: auto; }
/* análises de chamados e inventário */
.ai-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; }
.ai-f { display: flex; flex-direction: column; gap: 5px; min-width: 200px; }
.ai-f label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-fg)); }
.ai-f select { width: auto; min-width: 200px; }
.ai-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 38px; padding: 3px 6px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--input-bg)); max-width: 520px; }
.ai-tags input, .ai-tags select { border: 0; background: transparent; box-shadow: none !important; padding: 5px 4px; width: 200px; min-width: 120px; }
.ai-tag2 { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 99px; background: hsl(262 83% 58% / .12); color: hsl(262 83% 50%); font-size: 12px; font-weight: 600; }
.dark .ai-tag2 { color: #c4b5fd; }
.ai-tag2 button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 1px; }
.ai-tag2 svg { width: 12px; height: 12px; }
.ai-go2 { background: linear-gradient(90deg, #7c3aed, #2563eb) !important; border: 0 !important; color: #fff !important; height: 38px; }
.ai-ins .ai-main { grid-template-columns: minmax(0, 1fr) 300px; }
.ai-hist { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow-y: auto; }
.ai-hi { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid hsl(var(--border)); cursor: pointer; font-size: 13px; }
.ai-hi:hover { background: hsl(var(--muted) / .6); }
.ai-hi.on { background: hsl(262 83% 58% / .08); box-shadow: inset 3px 0 0 #7c3aed; }
.ai-hi .grow { flex: 1; min-width: 0; }
.ai-hi small { display: block; font-size: 11.5px; color: hsl(var(--muted-fg)); }
.ai-sum2 { padding: 18px 22px; }
.ai-sum2 h2 { margin: 2px 0 6px; font-size: 19px; }
.ai-sum2 p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; }
.ai-dest { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ai-dest .card { padding: 14px 16px; }
.ai-dest small { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-fg)); font-weight: 700; }
.ai-dest b { display: block; font-size: 24px; font-weight: 800; margin: 2px 0; }
.ai-dest span { font-size: 12px; color: hsl(var(--muted-fg)); }
.ai-b2 { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.ai-b2 .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-b2 .tr { height: 7px; border-radius: 99px; background: hsl(var(--muted)); overflow: hidden; }
.ai-b2 .tr i { display: block; height: 100%; border-radius: 99px; }
.ai-b2 b { min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.ai-days { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.ai-dcol { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.ai-dcol i { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.ai-dcol i.a, .ai-leg i.a { background: #7c3aed; } .ai-dcol i.s, .ai-leg i.s { background: hsl(var(--success)); }
.ai-leg { display: flex; gap: 14px; padding: 0 16px 12px; font-size: 12px; color: hsl(var(--muted-fg)); }
.ai-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.ai-warn { color: hsl(38 92% 40%); font-weight: 700; }
.ai-old { display: flex; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid hsl(var(--border)); color: inherit; text-decoration: none; font-size: 13px; }
.ai-old:hover { background: hsl(var(--muted) / .6); }
.ai-old .grow { flex: 1; min-width: 0; }
.ai-old small { display: block; font-size: 11.5px; color: hsl(var(--muted-fg)); }
@container (max-width: 1080px) { .ai-ins .ai-main { grid-template-columns: 1fr; } .ai-hist { position: static; } }
