

#agentic { position: relative; }

.ag-e { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: var(--void); }
.ag { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; height: 100%; min-height: 0; padding: 16px; }

.ag-mapa { position: relative; min-height: 520px; border: 1px solid var(--linha); border-radius: var(--r); overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(255, 138, 61, 0.05), transparent 58%), var(--painel); }
.ag-orbitas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ag-orbitas .anel { fill: none; stroke: var(--linha); stroke-dasharray: 2 6; }
.ag-orbitas line.fina { stroke: rgba(255, 255, 255, 0.07); }
.ag-orbitas line.viva { stroke: var(--accent-linha); }
.ag-nos { position: absolute; inset: 0; }
.ag-no { position: absolute; transform: translate(-50%, -50%); width: calc(var(--r) * 2); height: calc(var(--r) * 2); padding: 0; border: 0;
  background: none; display: grid; place-items: center; }
.ag-no > i { width: 100%; height: 100%; border-radius: 50%; background: var(--painel-2); border: 1.5px solid var(--linha-2); transition: transform .15s ease; }
.ag-no:hover > i { transform: scale(1.12); }
.ag-no.sel > i { outline: 2px solid var(--accent); outline-offset: 3px; }
.ag-no-rot { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  gap: 2px; white-space: nowrap; pointer-events: none; }
.ag-no-rot b { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font: 500 12px/16px var(--sans); color: var(--ink); }
.ag-no-rot small { font: 400 11px/14px var(--mono); color: var(--ink-3); }
.ag-no.principal > i { background: var(--accent-fundo); border-color: var(--accent); box-shadow: 0 0 0 6px rgba(255, 138, 61, 0.06); }
.ag-no.principal .ag-no-rot b { font-weight: 600; }
.ag-no.dominio > i { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 14%, var(--painel)); }
.ag-no.dominio.ocupado > i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor) 24%, transparent); }
.ag-no.tarefa > i { border-radius: 3px; }
.ag-no.tarefa .ag-no-rot { display: none; }
.ag-no.tarefa.e-a-trabalhar > i { background: var(--accent); border-color: var(--accent); }
.ag-no.tarefa.e-por-rever > i { background: var(--aviso); border-color: var(--aviso); }
.ag-no.tarefa.e-fila > i { background: transparent; border-style: dashed; }
.ag-no.tarefa.e-feito > i { background: var(--ok-fundo); border-color: var(--ok); }
.ag-no.tarefa.e-parada > i { border-color: var(--erro); }
.ag-no.tarefa.com-agente > i { box-shadow: 0 0 0 3px var(--painel), 0 0 0 5px var(--ok); animation: ag-com-agente 1.8s ease-in-out infinite; }
@keyframes ag-com-agente { 0%, 100% { box-shadow: 0 0 0 3px var(--painel), 0 0 0 5px var(--ok); } 50% { box-shadow: 0 0 0 3px var(--painel), 0 0 0 8px rgba(124, 196, 71, 0.25); } }
.ag-no.agente > i { background: var(--ok); border-color: var(--ok); animation: ag-vivo 1.8s ease-in-out infinite; }
.ag-no.agente .ag-no-rot b { max-width: 120px; font-size: 11px; line-height: 14px; }
.ag-no.agente .ag-no-rot small { font-size: 10px; }
.ag-no.automatismo > i { background: var(--painel-2); }
.ag-no.automatismo.ativo > i { background: var(--accent); border-color: var(--accent); animation: ag-ativo 1.4s ease-in-out infinite; }
.ag-no.automatismo.mal > i { border-color: var(--erro); }
@keyframes ag-vivo { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 196, 71, 0.45); } 50% { box-shadow: 0 0 0 6px rgba(124, 196, 71, 0); } }
@keyframes ag-ativo { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.5); } 50% { box-shadow: 0 0 0 5px rgba(255, 138, 61, 0); } }
@media (prefers-reduced-motion: reduce) { .ag-no > i { animation: none !important; transition: none; } }

.ag-rot { position: absolute; left: 16px; top: 12px; pointer-events: none; }
.ag-olho { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 11px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ag-olho i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.ag-estado { margin: 4px 0 0; font: 400 12px/16px var(--sans); color: var(--ink-3); }
.ag-mapa .ag-barra { position: absolute; right: 12px; top: 12px; }
.ag-legenda { position: absolute; left: 16px; bottom: 12px; right: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font: 400 11px/16px var(--sans); color: var(--ink-3); pointer-events: none; }
.ag-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.ag-legenda i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--linha-2); flex: none; }
.ag-legenda .l-agente { background: var(--ok); border-color: var(--ok); }
.ag-legenda .l-trabalhar { background: var(--accent); border-color: var(--accent); border-radius: 2px; }
.ag-legenda .l-rever { background: var(--aviso); border-color: var(--aviso); border-radius: 2px; }
.ag-legenda .l-fila { border-style: dashed; border-radius: 2px; }
.ag-legenda .l-auto { background: var(--painel-2); }
.ag-erro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 360px; padding: 12px 14px; border: 1px solid var(--erro);
  border-radius: var(--r); background: var(--erro-fundo); color: var(--ink); font-size: 13px; }

.ag-barra { display: flex; align-items: center; gap: 8px; z-index: 3; }
.ag-vistas { display: inline-flex; align-items: center; height: var(--ctl); padding: 2px; border: 1px solid var(--linha-2); border-radius: var(--r); background: var(--painel-2); }
.ag-vistas button { height: 26px; padding: 0 10px; border: 0; border-radius: 3px; background: none; color: var(--ink-2); font: 500 13px/1 var(--sans); }
.ag-vistas button[aria-pressed="true"] { background: var(--accent-fundo); color: var(--accent); }
.ag-estado.erro { color: var(--erro); }
.ag-quadro { position: absolute; inset: 0; z-index: 2; overflow: auto; padding: 64px 16px 16px; background: var(--painel); }
.ag-mapa.em-ideias .ag-legenda { display: none; }
.ag-q-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ag-q-largar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1.5px dashed var(--accent-linha);
  border-radius: var(--r); background: var(--accent-fundo); color: var(--ink-2); font-size: 13px; line-height: 18px; }
.ag-q-largar svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; }
.ag-q-largar b { display: block; color: var(--accent); font-weight: 600; }
.ag-q-largar.ag-q-sobre { border-style: solid; background: rgba(255, 138, 61, 0.22); }
.ag-q-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.ag-q-grupo { min-width: 0; padding: 10px; border: 1px solid var(--linha); border-radius: var(--r); background: var(--painel-2); }
.ag-q-grupo.ag-q-sobre { border-color: var(--cor); box-shadow: inset 0 0 0 1px var(--cor); }
.ag-q-grupo h3 { display: flex; align-items: center; gap: 8px; margin: 2px 2px 8px; font: 600 12px/16px var(--sans); color: var(--ink); }
.ag-q-grupo h3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--cor); flex: none; }
.ag-q-grupo h3 small { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--ink-3); }
.ag-q-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ag-q-grupo li { min-width: 0; }
.ag-q-vazio { margin: 0; padding: 10px 4px; font-size: 12px; color: var(--ink-3); }
.ag-ideia { width: 100%; display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--linha); border-radius: var(--r); background: var(--painel); text-align: left; cursor: grab; }
.ag-ideia:hover { border-color: var(--linha-2); }
.ag-ideia.sel { border-color: var(--accent-linha); box-shadow: inset 0 0 0 1px var(--accent-linha); }
.ag-ideia.a-arrastar { opacity: .45; }
.ag-ideia-tipo { font: 600 10px/12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ag-ideia b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 13px/18px var(--sans); color: var(--ink); }
.ag-ideia-pe { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ag-ideia-pe small { font: 400 11px/1 var(--mono); color: var(--ink-3); }
.ag-pill.m-ideia { color: #A9B4FF; border-color: rgba(169, 180, 255, 0.4); }
.ag-pill.m-por-aprovar, .ag-pill.m-espera { color: var(--aviso); border-color: rgba(226, 190, 82, 0.5); background: var(--aviso-fundo); }
.ag-pill.m-aprovado { color: var(--ink); }
.ag-pill.m-em-curso, .ag-pill.m-a-trabalhar { color: var(--accent); border-color: var(--accent-linha); background: var(--accent-fundo); }
.ag-pill.m-fila { color: var(--ink-2); border-style: dashed; }
.ag-pill.m-por-rever { color: var(--aviso); border-color: rgba(226, 190, 82, 0.5); }
.ag-pill.m-feito { color: var(--ok); border-color: rgba(124, 196, 71, 0.45); background: var(--ok-fundo); }
.ag-pill.m-parada { color: var(--erro); border-color: rgba(240, 100, 91, 0.5); }
.ag-mover { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.ag-mover select { height: var(--ctl); max-width: 210px; padding: 0 8px; border: 1px solid var(--linha-2); border-radius: var(--r); background: var(--painel-2); color: var(--ink); font: 400 13px/1 var(--sans); }

.ag-mapa.compacto .ag-no-rot small, .ag-mapa.compacto .ag-no.conversa .ag-no-rot { display: none; }
.ag-mapa.compacto .ag-no-rot { top: calc(100% + 3px); }
.ag-mapa.compacto .ag-no-rot b { max-width: 84px; font-size: 11px; line-height: 14px; }
.ag-mapa.compacto .ag-rot { right: 128px; }
.ag-mapa.compacto .ag-estado { font-size: 11px; line-height: 15px; }

.ag-painel { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.ag-detalhe, .ag-grupo { border: 1px solid var(--linha); border-radius: var(--r); background: var(--painel); padding: 12px 14px; }
.ag-detalhe header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ag-olho2 { margin: 0; font: 600 11px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ag-detalhe h3 { margin: 2px 0 10px; font: 600 16px/24px var(--sans); }
.ag-detalhe dl { margin: 0; display: grid; gap: 6px; }
.ag-detalhe dl div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; }
.ag-detalhe dt { font-size: 12px; line-height: 18px; color: var(--ink-3); }
.ag-detalhe dd { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink); overflow-wrap: anywhere; }
.ag-detalhe code, .ag-grupo code { font: 400 12px/16px var(--mono); color: var(--ink-2); }
.ag-detalhe .nota { margin: 10px 0 0; }
.ag-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ag-corpo { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linha); font-size: 13px; line-height: 19px; color: var(--ink-2); }
.ag-corpo h4 { margin: 12px 0 4px; font: 600 11px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ag-corpo h4:first-child { margin-top: 0; }
.ag-corpo p { margin: 0 0 6px; }
.ag-corpo ul, .ag-corpo ol { margin: 0 0 6px; padding-left: 18px; }
.ag-corpo li { margin: 2px 0; }
.ag-corpo b { color: var(--ink); font-weight: 600; }
.ag-lig { color: var(--ink); border-bottom: 1px dotted var(--linha-2); }
.icon-x { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 3px; background: none; color: var(--ink-2); }
.icon-x:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.ag-grupo h3 { margin: 0 0 8px; font: 600 12px/16px var(--sans); color: var(--ink-2); }
.ag-grupo .nota { margin: 0; }
.ag-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ag-grupo li { min-width: 0; }
.ag-grupo li button { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid transparent;
  border-radius: var(--r); background: none; text-align: left; }
.ag-grupo li button:hover { background: var(--painel-2); border-color: var(--linha); }
.ag-t-tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 16px; }
.ag-grupo li small { font: 400 11px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.ag-pill { display: inline-flex; align-items: center; flex: none; padding: 3px 7px; border: 1px solid var(--linha-2); border-radius: 999px;
  font: 500 11px/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.ag-pill.e-a-trabalhar { color: var(--accent); border-color: var(--accent-linha); background: var(--accent-fundo); }
.ag-pill.e-por-rever { color: var(--aviso); border-color: rgba(226, 190, 82, 0.5); background: var(--aviso-fundo); }
.ag-pill.e-feito { color: var(--ok); border-color: rgba(124, 196, 71, 0.45); background: var(--ok-fundo); }
.ag-pill.e-parada, .ag-pill.e-invalida { color: var(--erro); border-color: rgba(240, 100, 91, 0.5); background: var(--erro-fundo); }
.ag-pill.agente { color: var(--ok); border-color: rgba(124, 196, 71, 0.45); background: var(--ok-fundo); }
.ag-terr { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-terr td { height: 32px; padding: 0; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.ag-terr tr:last-child td { border-bottom: 0; }
.ag-terr td:last-child { text-align: right; }
.ag-livre { font-size: 12px; color: var(--ink-3); }
.ag-ocupado { padding: 0; border: 0; background: none; font: 500 12px/1 var(--sans); color: var(--accent); }

.ag-tip { position: absolute; z-index: 40; transform: translateX(-50%); width: 340px; max-width: calc(100vw - 32px); padding: 10px 12px;
  border: 1px solid var(--linha-2); border-radius: var(--r); background: #0B0D11; pointer-events: none; }
.ag-tip b { display: block; font: 600 13px/18px var(--sans); overflow-wrap: anywhere; }
.ag-tip small { display: block; font: 400 11px/16px var(--mono); color: var(--ink-3); }
.ag-tip p { margin: 6px 0 0; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.ag-tip-ecra { margin: 8px 0 0; padding: 8px; max-height: 168px; overflow: hidden; border: 1px solid var(--linha); border-radius: 3px; background: var(--void);
  font: 400 11px/15px var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-tip .ag-tip-dica { color: var(--ink-3); font-size: 11px; }

.ag-janelas { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.ag-janela { position: absolute; width: 640px; height: 380px; min-width: 320px; min-height: 200px; max-width: calc(100% - 16px); max-height: calc(100% - 16px);
  display: flex; flex-direction: column; border: 1px solid var(--linha-2); border-radius: var(--r); background: #08090C; pointer-events: auto; resize: both; overflow: hidden; }
.ag-j-cab { height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; border-bottom: 1px solid var(--linha);
  background: var(--painel-2); cursor: move; user-select: none; touch-action: none; }
.ag-j-tit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ag-j-tit b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/1 var(--sans); }
.ag-j-tit small { font: 400 11px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.ag-j-modo { display: inline-flex; align-items: center; flex: none; padding: 3px 7px; border: 1px solid var(--linha-2); border-radius: 999px; font: 500 11px/1 var(--sans); color: var(--ink-2); }
.ag-j-botoes { display: flex; align-items: center; gap: 2px; flex: none; }
.ag-j-botoes button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--ink-2); }
.ag-j-botoes button:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.ag-j-botoes svg, .icon-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-j-corpo { flex: 1; min-height: 0; padding: 4px 0 0 6px; overflow: auto; }
.ag-j-estado { margin: 0; padding: 6px 10px; border-top: 1px solid var(--linha); font-size: 12px; color: var(--aviso); }
.ag-janela.cheia { position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; border: 0; border-radius: 0; resize: none; z-index: 50; }
.ag-janela.cheia .ag-j-cab { cursor: default; }
body.so-janela > .topo, body.so-janela > main { display: none !important; }

@media (max-width: 960px) {
  .ag { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ag-mapa { min-height: 0; aspect-ratio: 1 / 1.1; }
  .ag-mapa.em-ideias { aspect-ratio: auto; min-height: 70vh; }
  .ag-q-topo { flex-wrap: wrap; }
  .ag-q-largar { flex-basis: 100%; }
  .ag-janelas { position: fixed; }
  .ag-janela { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; height: 62vh; max-width: none; resize: none; }
  .ag-legenda { display: none; }
}
