/* IGEPPS-SUBPATH: seletores de rotas aceitam o basename compilado.
 * =============================================================
 * LOGIN REDESIGN — Variante 2 (Split com painel de marca)
 *
 * Aplicado a TODAS as rotas de autenticação do LibreChat:
 *   /login  /register  /forgot-password  /reset-password  /verify
 *
 * Escopado por `body.igepps-auth-page` (classe adicionada pelo JS).
 * Quando o usuário loga e sai dessas rotas, o JS remove a classe e o
 * app autenticado fica intacto — nenhuma regra abaixo sobrevive.
 *
 * Estratégia de layout:
 *   - Painel esquerdo: <aside> com `position: fixed` em metade da tela.
 *     Não depende do flex-direction do wrapper raiz nem é tocado pela
 *     reconciliação do React (que ignora elementos fora do seu tree).
 *   - Wrapper raiz do AuthLayout ganha `padding-left: 50vw` pra liberar
 *     espaço do painel fixo. O <main> centraliza o form no espaço restante.
 *   - Painel esquerdo sempre dark (identidade da marca). Painel direito
 *     respeita o tema do usuário (LibreChat usa <html class="dark">).
 * ============================================================= */

body.igepps-auth-page {
  --igepps-brand-bg: #000000;
  --igepps-yellow: #f5d52e;
  --igepps-yellow-soft: rgba(245, 213, 46, 0.12);
  --igepps-green: #16704a;
  --igepps-green-hover: #135d3e;
  --igepps-divider: rgba(245, 213, 46, 0.18);

  /* Painel direito — DARK */
  --igepps-bg: #0c0d10;
  --igepps-input-bg: #1a1c20;
  --igepps-input-border: #2a2d33;
  --igepps-text-primary: #f4f4f5;
  --igepps-text-secondary: #9ca0a8;
  --igepps-text-muted: #6b6f78;

  overflow-x: hidden;
}

html:has(body.igepps-auth-page) {
  overflow-x: hidden;
}

/* Painel direito — LIGHT (quando o LibreChat não tem class="dark" no <html>) */
html:not(.dark) body.igepps-auth-page {
  --igepps-bg: #f5f5f4;
  --igepps-input-bg: #ffffff;
  --igepps-input-border: #e5e5e5;
  --igepps-text-primary: #18181b;
  --igepps-text-secondary: #52525b;
  --igepps-text-muted: #71717a;
}

body.igepps-auth-page {
  background: var(--igepps-bg) !important;
}

/* ── Wrapper raiz do AuthLayout — empurra pra direita ─────────── */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col {
  background: var(--igepps-bg) !important;
  padding-left: 50vw;
  min-height: 100vh;
}

/* ── Painel esquerdo (overlay fixo) ───────────────────────────── */
.igepps-login-brand-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 50vw;
  height: 100vh;
  background: var(--igepps-brand-bg);
  background-image:
    radial-gradient(circle at 18% 22%, rgba(245, 213, 46, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 75% 78%, rgba(245, 213, 46, 0.05) 0%, transparent 50%);
  padding: 56px 64px;
  /* Grid 3 linhas iguais nas extremidades: o `1fr auto 1fr` faz com que o
   * hero (no meio, auto) fique EXATAMENTE no centro vertical do painel —
   * independente do tamanho do logo. Logo ancora no topo (align-self: start)
   * e footer no rodapé (align-self: end) das suas rows 1fr. */
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  overflow: hidden;
  color: #f4f4f5;
  border-right: 1px solid var(--igepps-divider);
  z-index: 10;
}

/* Grafo de constelação no fundo — SVG inline com pontos e linhas amarelas
 * em baixa opacidade. Reproduz o espírito "rede conectada" da marca Allcance. */
.igepps-login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 1100' preserveAspectRatio='xMidYMid slice'><g stroke='%23f5d52e' stroke-width='0.7' fill='none' opacity='0.5'><path d='M120 180 L260 260 L380 180 L500 320'/><path d='M380 180 L460 90'/><path d='M120 180 L80 320'/><path d='M260 260 L240 420'/><path d='M500 320 L640 420'/><path d='M640 420 L720 580'/><path d='M240 420 L380 540 L500 480'/><path d='M380 540 L320 720'/><path d='M500 480 L580 720'/><path d='M320 720 L460 820'/><path d='M580 720 L460 820'/><path d='M460 820 L540 940'/><path d='M180 880 L320 720'/><path d='M180 880 L60 760'/><path d='M720 580 L820 760'/><path d='M820 760 L760 980'/><path d='M540 940 L760 980'/></g><g fill='%23f5d52e' opacity='0.75'><circle cx='120' cy='180' r='2.6'/><circle cx='260' cy='260' r='2.3'/><circle cx='380' cy='180' r='2.6'/><circle cx='500' cy='320' r='2.5'/><circle cx='460' cy='90' r='2.1'/><circle cx='80' cy='320' r='2.1'/><circle cx='240' cy='420' r='2.5'/><circle cx='640' cy='420' r='2.7'/><circle cx='720' cy='580' r='2.1'/><circle cx='380' cy='540' r='2.5'/><circle cx='500' cy='480' r='2.3'/><circle cx='320' cy='720' r='2.5'/><circle cx='580' cy='720' r='2.5'/><circle cx='460' cy='820' r='2.7'/><circle cx='540' cy='940' r='2.1'/><circle cx='180' cy='880' r='2.3'/><circle cx='60' cy='760' r='2.1'/><circle cx='820' cy='760' r='2.5'/><circle cx='760' cy='980' r='2.3'/></g></svg>");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.igepps-login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.igepps-login-brand-panel__top {
  align-self: start;
}

.igepps-login-brand-panel__top img {
  display: block;
  height: 120px;
  width: auto;
  max-width: 100%;
}

.igepps-login-brand-panel__hero {
  max-width: 540px;
  /* O hero ocupa a row central (auto) do grid `1fr auto 1fr` — fica
   * naturalmente no centro vertical do painel. */
}

.igepps-login-brand-panel__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--igepps-yellow);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.igepps-login-brand-panel__headline {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.08;
  color: #f4f4f5;
  margin: 0 0 28px 0;
  letter-spacing: -0.01em;
}

.igepps-login-brand-panel__headline em {
  color: var(--igepps-yellow);
  font-style: normal;
}

.igepps-login-brand-panel__sub {
  font-size: 15.5px;
  line-height: 1.55;
  color: #b8bcc4;
  max-width: 460px;
  margin: 0;
}

.igepps-login-brand-panel__footer {
  align-self: end;
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 13px;
  color: #9ca0a8;
}

.igepps-login-brand-panel__footer a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms;
}

.igepps-login-brand-panel__footer a:hover {
  color: var(--igepps-yellow);
}

.igepps-login-brand-panel__footer .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

/* ── Esconder elementos do AuthLayout original ─────────────────
 * Marcados pelo JS via [data-igepps-hidden]: logo do topo, banner. */
body.igepps-auth-page [data-igepps-hidden] {
  display: none !important;
}

/* ── Painel direito (form-side) ─────────────────────────────── */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > main {
  background: var(--igepps-bg) !important;
  padding: 48px 56px;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

body.igepps-auth-page main > div {
  background: transparent !important;
  width: 100% !important;
  max-width: 440px !important;
  padding: 0 !important;
}

/* Badge "ENTRAR" — inserido pelo JS antes do h1 */
.igepps-login-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--igepps-yellow-soft);
  color: var(--igepps-yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  margin-bottom: 24px;
}

.igepps-login-form-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--igepps-yellow);
  box-shadow: 0 0 8px var(--igepps-yellow);
}

/* No tema claro o badge fica amarelo com texto e ponto pretos. */
html:not(.dark) .igepps-login-form-badge {
  background: var(--igepps-yellow);
  border-color: var(--igepps-yellow);
  color: #000000;
}
html:not(.dark) .igepps-login-form-badge::before {
  background: #000000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

/* H1 do AuthLayout — "Bem-vindo de volta" */
body.igepps-auth-page main h1 {
  text-align: left !important;
  font-size: 40px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.015em !important;
  color: var(--igepps-text-primary) !important;
  margin: 0 0 12px 0 !important;
}

/* Subtítulo — inserido pelo JS depois do h1 */
.igepps-login-form-subtitle {
  font-size: 15px;
  color: var(--igepps-text-secondary);
  margin: 0 0 32px 0;
  line-height: 1.5;
}

/* ── Inputs ─────────────────────────────────────────────────────
 * Estratégia: o JS troca o floating label do LibreChat por placeholder
 * nativo do input (mais simples, sem bugs de sobreposição). O label
 * original é escondido via [data-igepps-hidden]. */
body.igepps-auth-page form input[type="text"],
body.igepps-auth-page form input[type="email"],
body.igepps-auth-page form input[type="password"] {
  background: var(--igepps-input-bg) !important;
  border: 1px solid var(--igepps-input-border) !important;
  color: var(--igepps-text-primary) !important;
  border-radius: 12px !important;
  padding: 0 16px !important;
  font-size: 15px !important;
  height: 56px !important;
  transition: border-color 200ms, box-shadow 200ms;
}

body.igepps-auth-page form input::placeholder {
  color: var(--igepps-text-muted) !important;
  opacity: 1;
}

body.igepps-auth-page form input:focus {
  border-color: var(--igepps-yellow) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--igepps-yellow-soft) !important;
}

/* Botão "olho" pra mostrar/ocultar senha — inserido pelo JS */
.igepps-login-pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--igepps-text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms;
}

.igepps-login-pwd-toggle:hover {
  color: var(--igepps-text-secondary);
}

/* Wrapper que o JS adiciona ao redor do input de senha pra posicionar o olho */
.igepps-login-pwd-wrap {
  position: relative;
}

/* ── Link "Esqueci minha senha" — verde corporativo ────────────
 * O LibreChat já renderiza esse link quando `passwordResetEnabled: true`
 * (SMTP configurado → vira true). Estilizamos. */
body.igepps-auth-page form a[href$="/forgot-password"] {
  display: block !important;
  text-align: right;
  margin-top: 8px;
  font-size: 14px;
  color: var(--igepps-green) !important;
  text-decoration: none !important;
  font-weight: 600;
  padding: 0 !important;
}

body.igepps-auth-page form a[href$="/forgot-password"]:hover {
  text-decoration: underline !important;
}

/* No light mode o verde fica mais escuro pra contraste */
html:not(.dark) body.igepps-auth-page form a[href$="/forgot-password"] {
  color: var(--igepps-green-hover) !important;
}

/* ── Botão "Continuar" — verde escuro corporativo ────────────── */
body.igepps-auth-page form button[type="submit"] {
  background: var(--igepps-green) !important;
  border: none !important;
  border-radius: 12px !important;
  height: 52px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  margin-top: 20px !important;
  color: #ffffff !important;
  transition: background 180ms;
  width: 100% !important;
}

body.igepps-auth-page form button[type="submit"]:hover:not(:disabled) {
  background: var(--igepps-green-hover) !important;
}

body.igepps-auth-page form button[type="submit"]:disabled {
  opacity: 0.6 !important;
}

/* ── Esconde texto "Não tem uma conta? Cadastre-se" do LibreChat ─
 * O IGEPPS opera por convite (`ALLOW_REGISTRATION=false`). */
body.igepps-auth-page main > div > p:has(a[href*="register"]) {
  display: none !important;
}

/* ── Validação prévia do convite (/register) ────────────────────
 * Injetados pelo JS (ensureInviteGuard) enquanto o token é validado e,
 * se inválido, no lugar do formulário. Vide brand/login-redesign.js. */
.igepps-invite-checking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--igepps-text-secondary);
}
.igepps-invite-checking__spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--igepps-input-border);
  border-top-color: var(--igepps-yellow);
  animation: igepps-invite-spin 0.7s linear infinite;
}
@keyframes igepps-invite-spin {
  to { transform: rotate(360deg); }
}

.igepps-invite-expired {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0;
}
.igepps-invite-expired__title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--igepps-text-primary);
}
.igepps-invite-expired__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--igepps-text-secondary);
}
.igepps-invite-expired__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border-radius: 12px;
  background: var(--igepps-green);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 180ms;
}
.igepps-invite-expired__cta:hover {
  background: var(--igepps-green-hover);
}

/* ── Theme toggle do canto inferior ESQUERDO (como no original) ──
 * AuthLayout do LibreChat usa `absolute bottom-0 left-0 md:m-4` — em
 * telas < md fica grudado sem margem, e em mobile o wrapper raiz expande
 * além de 100vh, jogando o botão pra fora do viewport.
 *
 * Forçamos `position: fixed` pra sempre referenciar o viewport, e damos
 * margem consistente em qualquer tamanho. Mantemos a posição ESQUERDA. */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > div.absolute {
  position: fixed !important;
  left: auto !important;
  right: auto !important;
  bottom: 24px !important;
  top: auto !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  z-index: 100;
}

/* O ThemeSelector é só um <button> com ícone Sun/Moon (lucide). Aplicamos
 * o mesmo visual dos inputs pra ficar coerente com o redesign. */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > div.absolute > button {
  background: var(--igepps-input-bg) !important;
  border: 1px solid var(--igepps-input-border) !important;
  border-radius: 999px !important;
  color: var(--igepps-text-secondary) !important;
  padding: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > div.absolute > button:hover {
  border-color: var(--igepps-yellow) !important;
  color: var(--igepps-yellow) !important;
}

/* ── Esconde o Footer original do LibreChat (Privacidade/Termos)
 * Nosso painel esquerdo já mostra esses links. */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > div[role="contentinfo"] {
  display: none !important;
}

/* ── Responsivo: empilha em telas < 1024px ───────────────────────
 * O painel da marca vira um BANNER FIXO no topo (não vai pro fim do
 * fluxo). O <aside> está como filho direto do <body> — em desktop é
 * `position: fixed` à esquerda; em mobile mudamos pra `position: fixed`
 * no topo. O <main> recebe padding-top pra liberar espaço pro banner.
 *
 * Evita scroll horizontal forçando overflow-x: hidden no body. */
@media (max-width: 1023px) {
  body.igepps-auth-page {
    overflow-x: hidden;
  }
  body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col {
    padding-left: 0;
    padding-top: 132px; /* altura do banner: 32 padding + 64 logo + 32 padding + 4 borda */
    min-width: 0;
  }
  .igepps-login-brand-panel {
    /* Banner horizontal no topo. Mantém `position: fixed` pra ficar
     * grudado mesmo no scroll. `left: 0; right: 0` calcula width
     * automaticamente — NÃO usar `width: 100%` junto (some elementos do
     * Chromium tratam `width: 100%` como viewport-width que pode incluir
     * a scrollbar, causando overflow horizontal). */
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 32px 24px;
    border-right: none;
    border-bottom: 1px solid var(--igepps-divider);
    box-sizing: border-box;
    /* O grid `1fr auto 1fr` do desktop não faz sentido aqui (só temos o
     * logo). Volto pra flex column simples. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .igepps-login-brand-panel__hero,
  .igepps-login-brand-panel__footer {
    display: none; /* mantém só o logo no banner */
  }
  .igepps-login-brand-panel__top {
    align-self: center; /* sobrescreve o `align-self: start` do desktop */
    text-align: center;
    width: 100%;
  }
  .igepps-login-brand-panel__top img {
    height: 64px; /* logo menor no banner pra não roubar espaço */
    margin: 0 auto;
  }
  body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > main {
    padding: 24px 24px 48px;
    min-height: calc(100vh - 132px);
  }
  body.igepps-auth-page main > div {
    max-width: 100% !important;
  }
  body.igepps-auth-page main h1 {
    font-size: 30px !important;
  }
}

/* ── Telas bem estreitas (celular pequeno < 480px) ────────────── */
@media (max-width: 479px) {
  body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col {
    padding-top: 116px;
  }
  .igepps-login-brand-panel {
    padding: 26px 16px;
  }
  .igepps-login-brand-panel__top img {
    height: 56px;
  }
  body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > main {
    padding: 20px 18px 84px; /* bottom maior pra não tampar o toggle de tema */
    min-height: calc(100vh - 116px);
  }
  body.igepps-auth-page main h1 {
    font-size: 26px !important;
  }
}

/* ── Toggle de tema (sol/lua) ──────────────────────────────────
 * Esconde o dropdown nativo do AuthLayout (com a opção "Sistema"
 * que confunde) e renderiza o botão único no canto superior direito. */
body.igepps-auth-page > #root > div.relative.flex.min-h-screen.flex-col > div.absolute,
body.igepps-auth-page [data-testid="theme-selector"],
/* VerifyEmail.tsx renderiza seu próprio <div className="absolute bottom-0
 * left-0 m-4"> com ThemeSelector dentro — sem data-testid. Cobre essa
 * variante e qualquer tela que reuse o padrão. */
body.igepps-auth-page div.absolute.bottom-0.left-0 {
  display: none !important;
}
body.igepps-auth-page .igepps-login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f5d52e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
body.igepps-auth-page .igepps-login-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}
body.igepps-auth-page .igepps-login-theme-toggle:active {
  transform: scale(0.96);
}
html:not(.dark) body.igepps-auth-page .igepps-login-theme-toggle {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: #1a1a1a;
}
html:not(.dark) body.igepps-auth-page .igepps-login-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ============================================================
 * Modal de Configurações — ajustes estéticos
 * (escopo GLOBAL — não usa body.igepps-auth-page porque o modal
 * é dentro da área autenticada)
 * ============================================================ */

/* 1. Labels do @librechat/client usam `break-all` no Tailwind, que quebra
 * texto letra-por-letra ao dar zoom. Sobrescreve pra quebrar SOMENTE
 * entre palavras inteiras (sem hifen, sem split no meio). */
label.break-all {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
}

/* 2. Modal de Configurações — altura fixa + largura aumentada (originalmente
 * 680px no v0.8.5, ficou apertado pra abas com widgets compostos como
 * "Taxa de Reprodução de Áudio"). 880px dá folga sem ocupar tela inteira. */
[role="dialog"]:has([aria-label="Settings"]) [class*="md:w-[680px"] {
  width: 880px !important;
  max-width: 95vw !important;
}
[role="dialog"]:has([aria-label="Settings"]) [class*="max-h-[calc"] {
  max-height: 500px !important;
  min-height: 500px !important;
  padding-bottom: 1.5rem !important;
}

/* 3. Rows de "label + botão" — espaço mínimo entre o texto e o botão
 * (sem isso, label longo encosta no botão e parece grudado). */
[role="dialog"]:has([aria-label="Settings"]) [role="tabpanel"] .flex.items-center.justify-between {
  gap: 1.5rem;
}

/* 4. Padroniza largura mínima SÓ dos botões de ação principal das rows
 * do Data Controls (Importar/Gerenciar/Revogar/Excluir). Seletor restrito
 * a filhos DIRETOS do flex container pra não pegar botões internos de
 * widgets compostos (InputNumber up/down, dropdowns, etc). */
[role="dialog"]:has([aria-label="Settings"]) [role="tabpanel"] > div > .flex.items-center.justify-between > button:not([role="switch"]):not([role="tab"]):not([role="combobox"]) {
  min-width: 110px;
  flex-shrink: 0;
}

/* Tabs internas (ex: Simples/Avançado no Speech): cada Tabs.Trigger
 * tem `w-full` no markup original — força flex equal-share pra dois
 * ocuparem 50% cada sem cortar. */
[role="dialog"]:has([aria-label="Settings"]) [role="tabpanel"] [role="tablist"] {
  width: 100% !important;
}
[role="dialog"]:has([aria-label="Settings"]) [role="tabpanel"] [role="tablist"] button[role="tab"] {
  min-width: 0 !important;
  flex: 1 1 0 !important;
}


/* Esconde o ícone "Novo chat" da barra de histórico (ele ainda fica no
 * DOM porque nossos botões grandes/header reaproveitam o click handler
 * dele via orig.click()). Botão duplicado/tooltip indesejado some. */
a[data-testid="new-chat-button"] {
  display: none !important;
}

/* Botão "+ Novo chat" injetado no header (à esquerda do ModelSelector).
 * Sempre visível, independente do estado da sidebar. */
.igepps-header-new-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  margin-right: 8px;
  background: var(--surface-secondary, #f4f4f5);
  color: var(--text-primary, #18181b);
  border: 1px solid var(--border-medium, #e5e5e5);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms;
  white-space: nowrap;
}
.igepps-header-new-chat:hover {
  background: var(--surface-hover, #e5e5e5);
}

/* ============================================================
 * Header do chat — botão "Assistente IGEPPS" não-clicável.
 * Como o IGEPPS tem só um modelSpec, não há nada pra trocar no
 * menu — vira só label informativo (sem cursor pointer, sem hover,
 * sem abrir menu). Se um dia tiver mais modelos, remover este bloco.
 * ============================================================ */
button[aria-label="Selecionar um modelo"],
button[aria-label="Select a model"] {
  pointer-events: none !important;
  cursor: default !important;
}

/* ============================================================
 * Menu do usuário (popover do avatar) — width adapta ao email.
 * Original tem w-[244px] fixo, então e-mails como suporte@allcance...
 * eram truncados com "...". Agora cresce até caber o e-mail mas
 * mantém min-width pros itens não ficarem espremidos.
 * ============================================================ */
.account-settings-popover {
  width: auto !important;
  min-width: 244px !important;
  max-width: min(95vw, 380px) !important;
}

/* O e-mail no topo do menu — não trunca, deixa fluir e o popover
 * adapta largura. Padding consistente nas duas pontas. */
.account-settings-popover > div[role="note"]:first-child {
  white-space: nowrap;
  padding-left: 14px;
  padding-right: 14px;
}

/* ============================================================
 * Esconde o ícone "<" do OpenRouter que aparece junto do label
 * "Assistente IGEPPS" (header do chat) e do "Bem-vindo ao..."
 * (landing). Como não temos um ícone customizado pro modelSpec,
 * o LibreChat cai no fallback chevron-left genérico — confuso.
 * ============================================================ */

/* Header: botão "Assistente IGEPPS" — esconde o div do ícone
 * (filho direto do button antes do <span>). */
button[aria-label="Selecionar um modelo"] > div:first-child,
button[aria-label="Select a model"] > div:first-child {
  display: none !important;
}

/* Landing: ícone redondo grande acima do "Bem-vindo ao Allcance Chat" */
main .relative.size-10:has(> *) {
  display: none !important;
}

/* Itens de conversa na sidebar (lista "Conversas"): MinimalIcon do
 * endpoint aparece antes do título. Sem iconURL configurado o fallback
 * é o bot/chevron — vira ruído visual. data-testid é estável. */
[data-testid="convo-icon"] {
  display: none !important;
}

/* ============================================================
 * Painel de Arquivos da sidebar (SidePanel/Files/PanelTable) — corte da data.
 * A tabela é `table-fixed` com a coluna de data em 25% e a célula com
 * overflow:hidden + texto alinhado à direita. Numa sidebar estreita
 * "27 Mai 2026" não cabe e é cortada PELA ESQUERDA (some "27 " e parte do
 * "M"). Reequilibra as colunas pra data caber. O seletor :has() restringe
 * à tabela de arquivos (única com a célula de data `span.flex.justify-end
 * .text-xs`), sem afetar outras tabelas table-fixed do app.
 * ============================================================ */
table.table-fixed:has(td span.flex.justify-end.text-xs) th:first-child,
table.table-fixed:has(td span.flex.justify-end.text-xs) td:first-child {
  width: 58% !important;
}
table.table-fixed:has(td span.flex.justify-end.text-xs) th:last-child,
table.table-fixed:has(td span.flex.justify-end.text-xs) td:last-child {
  width: 42% !important;
}
