/* Menu lateral do agente: faixa fina de icones que expande ao passar o mouse (ou focar) por cima do conteudo. */
:root { --agm-w: 64px; --agm-wx: 252px; }
html.agm-on body { padding-left: var(--agm-w); }
html.agm-on #ajudaBtn, html.agm-on #btnHelp { display: none !important; }   /* "Ajuda" agora fica no menu */

.agm { --bg: #08111f; --linha: #16314f; --texto: #e6f1fb; --mudo: #8aa4bd; --azul: #38bdf8; --verde: #4ade80; --ouro: #facc15;
  position: fixed; inset: 0 auto 0 0; width: var(--agm-w); z-index: 1000; font: 14px/1.4 Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--texto); background: linear-gradient(180deg, #0b172a, #08111f 70%); border-right: 1px solid var(--linha);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease; }
.agm:hover, .agm:focus-within, .agm.aberto { width: var(--agm-wx); box-shadow: 12px 0 40px rgba(0, 0, 0, .55); }
.agm * { box-sizing: border-box; }
.agm a, .agm button { font: inherit; color: inherit; }

/* marca */
.agm-marca { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 14px; text-decoration: none; flex-shrink: 0; border-bottom: 1px solid var(--linha); }
.agm-marca .logo { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9 60%, #6366f1); box-shadow: 0 0 18px rgba(56, 189, 248, .35); transition: transform .3s ease, box-shadow .3s ease; }
.agm-marca:hover .logo { transform: rotate(-6deg) scale(1.06); box-shadow: 0 0 26px rgba(56, 189, 248, .6); }
.agm-marca .nome { font-weight: 800; letter-spacing: .5px; white-space: nowrap; line-height: 1.1; }
.agm-marca .nome small { display: block; font-weight: 500; font-size: 11px; color: var(--mudo); letter-spacing: 0; }

/* lista */
.agm-lista { list-style: none; margin: 0; padding: 10px 8px; display: grid; gap: 4px; flex: 1; overflow-y: auto; overflow-x: hidden; align-content: start; }
.agm-lista::-webkit-scrollbar { width: 0; }
.agm-item, .agm-grupo > button { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; height: 44px; padding: 0 12px; border: 0; background: transparent;
  border-radius: 12px; cursor: pointer; text-decoration: none; text-align: left; color: var(--mudo); white-space: nowrap; overflow: hidden;
  transition: background .2s ease, color .2s ease; }
.agm-item svg, .agm-grupo > button svg.ic { width: 22px; height: 22px; flex-shrink: 0; transition: transform .25s cubic-bezier(.2, .8, .2, 1), filter .25s ease; }
.agm-rot { flex: 1; opacity: 0; transform: translateX(-8px); transition: opacity .2s ease, transform .25s ease; }
.agm:hover .agm-rot, .agm:focus-within .agm-rot, .agm.aberto .agm-rot { opacity: 1; transform: none; transition-delay: .06s; }
.agm-item:hover, .agm-grupo > button:hover { background: rgba(56, 189, 248, .10); color: var(--texto); }
.agm-item:hover svg, .agm-grupo > button:hover svg.ic { transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 0 6px rgba(56, 189, 248, .7)); color: var(--azul); }
.agm-item:focus-visible, .agm-grupo > button:focus-visible, .agm-user:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
/* item da pagina atual: barra indicadora animada */
.agm-item.atual, .agm-grupo.atual > button { color: var(--azul); background: rgba(56, 189, 248, .12); }
.agm-item.atual::before, .agm-grupo.atual > button::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--azul);
  box-shadow: 0 0 10px var(--azul); animation: agm-barra .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes agm-barra { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* grupos que abrem ao clicar */
.agm-grupo { display: grid; }
.agm-grupo > button .seta { width: 16px; height: 16px; flex-shrink: 0; opacity: 0; transition: transform .25s ease, opacity .2s ease; }
.agm:hover .agm-grupo > button .seta, .agm:focus-within .agm-grupo > button .seta, .agm.aberto .agm-grupo > button .seta { opacity: .8; }
.agm-grupo.aberto > button .seta { transform: rotate(90deg); }
.agm-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1); }
.agm-grupo.aberto .agm-sub { grid-template-rows: 1fr; }
.agm-sub > ul { list-style: none; margin: 0; padding: 0 0 0 20px; overflow: hidden; display: grid; gap: 2px; min-height: 0; }
.agm-sub .agm-item { height: 38px; padding-left: 16px; }
.agm-sub .agm-item svg { width: 18px; height: 18px; }
/* com o menu fechado, os subitens nao aparecem (so o icone do grupo) */
.agm:not(:hover):not(:focus-within):not(.aberto) .agm-sub { grid-template-rows: 0fr; }

/* rodape: ajuda + usuario */
.agm-rodape { padding: 8px; border-top: 1px solid var(--linha); display: grid; gap: 4px; flex-shrink: 0; }
.agm-user { display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; transition: background .2s ease; }
.agm-user:hover { background: rgba(56, 189, 248, .10); }
.agm-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; color: #05101f;
  background: linear-gradient(135deg, #38bdf8, #4ade80); transition: transform .25s ease, box-shadow .25s ease; }
.agm-user:hover .agm-avatar { transform: scale(1.08); box-shadow: 0 0 14px rgba(74, 222, 128, .5); }
.agm-avatar.fora { background: #1b2a41; color: var(--mudo); }
.agm-user .quem { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agm-user .quem b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.agm-user .quem small { color: var(--mudo); font-size: 11px; }

/* balao do usuario (login / sair) */
.agm-pop { position: fixed; left: calc(var(--agm-w) + 10px); bottom: 12px; width: 290px; max-width: calc(100vw - 90px); z-index: 1001; padding: 14px; border-radius: 14px;
  background: #0b1626; border: 1px solid var(--linha, #16314f); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); color: #e6f1fb; font: 14px/1.4 Inter, "Segoe UI", system-ui, sans-serif;
  animation: agm-pop .22s cubic-bezier(.2, .8, .2, 1); }
.agm-pop[hidden] { display: none; }
@keyframes agm-pop { from { opacity: 0; transform: translateX(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.agm-pop #loginBox { position: static !important; display: grid !important; gap: 10px; font-size: 13px; right: auto !important; top: auto !important; }
.agm-pop .agp-nome { font-weight: 700; font-size: 15px; }
.agm-pop .agp-mail { color: #8aa4bd; font-size: 12px; word-break: break-all; }
.agm-pop .agp-nivel { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(56, 189, 248, .14); color: #38bdf8; }
.agm-pop .agp-nivel.owner { background: rgba(250, 204, 21, .14); color: #facc15; }
.agm-pop .agp-nivel.gestor { background: rgba(74, 222, 128, .14); color: #4ade80; }
.agm-pop .login-sair { background: transparent; color: #8aa4bd; border: 1px solid #16314f; border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; transition: color .2s, border-color .2s, background .2s; }
.agm-pop .login-sair:hover { color: #f87171; border-color: #5b2230; background: rgba(248, 113, 113, .08); }
.agm-pop .login-msg { color: #f87171; }
.agm-pop .agp-dica { color: #8aa4bd; font-size: 12px; }

/* celular: botao no canto que abre a gaveta */
.agm-burger { display: none; }
@media (max-width: 700px) {
  html.agm-on body { padding-left: 0; }
  html.agm-on header, html.agm-on .assistant-header { padding-left: 62px !important; }
  .agm { width: var(--agm-wx); transform: translateX(-100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: none; }
  .agm.aberto { transform: none; box-shadow: 12px 0 40px rgba(0, 0, 0, .6); }
  .agm .agm-rot { opacity: 1; transform: none; }
  .agm .agm-grupo > button .seta { opacity: .8; }
  .agm-burger { display: grid; place-items: center; position: fixed; top: 8px; left: 10px; z-index: 999; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #16314f;
    background: #0b172a; color: #e6f1fb; cursor: pointer; }
  .agm-burger svg { width: 22px; height: 22px; }
  .agm-fundo { position: fixed; inset: 0; z-index: 998; background: rgba(0, 0, 0, .55); }
  .agm-fundo[hidden] { display: none; }
  .agm-pop { left: 12px; right: 12px; bottom: 76px; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agm, .agm *, .agm-pop { transition: none !important; animation: none !important; }
}

/* porta: sem login, nada da pagina aparece */
.agm-porta { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; background: #060d18; color: #e6f1fb; font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; }
.agm-porta[hidden] { display: none; }
.agm-porta-card { text-align: center; max-width: 360px; display: grid; gap: 10px; justify-items: center; }
.agm-porta-logo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #38bdf8, #6366f1); box-shadow: 0 0 30px rgba(56, 189, 248, .35); }
.agm-porta-logo svg { width: 28px; height: 28px; stroke: #fff; }
.agm-porta h2 { margin: 6px 0 0; font-size: 20px; }
.agm-porta p { margin: 0; color: #8aa4bd; }
.agm-porta button { margin-top: 8px; padding: 10px 20px; border-radius: 12px; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: #05101f; background: linear-gradient(135deg, #38bdf8, #4ade80); }
.agm-porta button:hover { filter: brightness(1.08); }
html.agm-trancado, html.agm-trancado body { overflow: hidden; }
@media (max-width: 700px) { .agm-porta { z-index: 997; } }
.agm-porta a.agm-porta-btn { margin-top: 8px; padding: 10px 20px; border-radius: 12px; font-weight: 700; text-decoration: none; color: #05101f; background: linear-gradient(135deg, #38bdf8, #4ade80); }
