/* AUTOPOSTE RC11.3.4
   Mantém a sidebar original de cada tela.
   Padroniza APENAS o seletor de contas com o comportamento correto
   já existente em Agendar Post e Agendamento em Massa. */

/* A lateral e seus ancestrais não podem cortar o dropdown. */
html body .sidebar,
html body .app-sidebar,
html body aside.sidebar,
html body aside[class*="sidebar"],
html body nav[class*="sidebar"],
html body [class*="sidebar-shell"],
html body [class*="sidebar-container"],
html body [class*="sidebar-inner"],
html body [class*="sidebar-content"] {
  overflow: visible !important;
}

/* Mantém os trilhos internos invisíveis sem alterar largura ou layout. */
html body .sidebar,
html body .app-sidebar,
html body aside[class*="sidebar"],
html body nav[class*="sidebar"],
html body [class*="sidebar-inner"],
html body [class*="sidebar-content"],
html body [class*="sidebar-scroll"] {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html body .sidebar::-webkit-scrollbar,
html body .app-sidebar::-webkit-scrollbar,
html body aside[class*="sidebar"]::-webkit-scrollbar,
html body nav[class*="sidebar"]::-webkit-scrollbar,
html body [class*="sidebar-inner"]::-webkit-scrollbar,
html body [class*="sidebar-content"]::-webkit-scrollbar,
html body [class*="sidebar-scroll"]::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* O bloco da conta ativa continua no tamanho original. */
html body .account-switcher,
html body .profile-switcher,
html body .account-selector,
html body [class*="account-switch"],
html body [class*="profile-switch"],
html body [class*="active-account"],
html body [class*="active-profile"] {
  position: relative !important;
  overflow: visible !important;
}

/*
 * Mesmo comportamento visual de Agendar Post / Agendamento em Massa:
 * o menu sai da largura da sidebar e abre por cima do conteúdo.
 */
html body .account-dropdown,
html body .profile-dropdown,
html body .accounts-dropdown,
html body .switch-account-menu,
html body [class*="account-dropdown"],
html body [class*="profile-dropdown"],
html body [class*="switcher-dropdown"],
html body [class*="switch-account-menu"],
html body [class*="accounts-menu"] {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  width: 332px !important;
  min-width: 332px !important;
  max-width: min(332px, calc(100vw - 32px)) !important;
  max-height: min(520px, calc(100vh - 170px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  z-index: 2147483000 !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html body .account-dropdown::-webkit-scrollbar,
html body .profile-dropdown::-webkit-scrollbar,
html body .accounts-dropdown::-webkit-scrollbar,
html body .switch-account-menu::-webkit-scrollbar,
html body [class*="account-dropdown"]::-webkit-scrollbar,
html body [class*="profile-dropdown"]::-webkit-scrollbar,
html body [class*="switcher-dropdown"]::-webkit-scrollbar,
html body [class*="switch-account-menu"]::-webkit-scrollbar,
html body [class*="accounts-menu"]::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Nenhum elemento auxiliar deve desenhar aquela faixa branca. */
html body .sidebar-resizer,
html body [class*="sidebar-resizer"],
html body [class*="resize-handle"],
html body [class*="scroll-track"],
html body [class*="scrollbar-track"] {
  display: none !important;
}

/* Garante que o dropdown fique acima do conteúdo e de cards. */
html body .sidebar,
html body .app-sidebar,
html body aside[class*="sidebar"],
html body nav[class*="sidebar"] {
  z-index: 10000 !important;
}

@media (max-width: 520px) {
  html body .account-dropdown,
  html body .profile-dropdown,
  html body .accounts-dropdown,
  html body .switch-account-menu,
  html body [class*="account-dropdown"],
  html body [class*="profile-dropdown"],
  html body [class*="switcher-dropdown"],
  html body [class*="switch-account-menu"],
  html body [class*="accounts-menu"] {
    width: calc(100vw - 32px) !important;
    min-width: 0 !important;
  }
}
