/* Nexei v285 - correcoes finais carregadas apos o pacote legado v255. */
/* v285 - modal de busca isolado, sem blur e acima de todo o conteúdo */
#nexeiSearchBackdropV285[hidden],
#nexeiMobileBackdropV285[hidden]{display:none!important;}
#nexeiSearchBackdropV285{
  position:fixed!important;
  inset:0!important;
  z-index:499000!important;
  display:block!important;
  background:rgba(15,23,42,.34)!important;
  filter:none!important;
  -webkit-filter:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html.nexei-search-v285-open,
body.nexei-search-v285-open{overflow:hidden!important;}
html.nexei-search-v285-open::before,
body.nexei-search-v285-open::before{content:none!important;display:none!important;}
body.nexei-search-v285-open > *:not(#nexeiSearchBackdropV285),
html.nexei-search-v285-open *{
  filter:none!important;
  -webkit-filter:none!important;
}
#topPeriodBox.nexei-v285-search-panel[hidden],
#topAdvancedBox.nexei-v285-search-panel[hidden]{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
#topPeriodBox.nexei-v285-search-panel:not([hidden]),
#topAdvancedBox.nexei-v285-search-panel:not([hidden]){
  position:fixed!important;
  left:50%!important;
  top:50%!important;
  right:auto!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  z-index:500000!important;
  margin:0!important;
  background:#fff!important;
  color:#0f172a!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  border:1px solid #d7e3f4!important;
  border-radius:22px!important;
  box-shadow:0 30px 90px rgba(15,23,42,.28)!important;
  padding:18px!important;
  max-height:min(82vh,760px)!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  filter:none!important;
  -webkit-filter:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
#topPeriodBox.nexei-v285-search-panel:not([hidden]){
  width:min(440px,calc(100vw - 32px))!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
}
#topAdvancedBox.nexei-v285-search-panel:not([hidden]){
  width:min(820px,calc(100vw - 32px))!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
}
#topPeriodBox.nexei-v285-search-panel *,
#topAdvancedBox.nexei-v285-search-panel *{
  filter:none!important;
  -webkit-filter:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  opacity:1!important;
  text-shadow:none!important;
}
.nexei-v285-modal-title{
  grid-column:1/-1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0 0 6px!important;
  color:#0f172a!important;
  font-size:17px!important;
  font-weight:900!important;
}
.nexei-v285-modal-close{
  position:static!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  padding:0!important;
  border:1px solid #d7e3f4!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  color:#0f172a!important;
  font-size:24px!important;
  line-height:1!important;
  box-shadow:none!important;
}
#topPeriodBox.nexei-v285-search-panel input,
#topPeriodBox.nexei-v285-search-panel select,
#topAdvancedBox.nexei-v285-search-panel input,
#topAdvancedBox.nexei-v285-search-panel select,
#topAdvancedBox.nexei-v285-search-panel summary{
  background:#fff!important;
  color:#0f172a!important;
  border-color:#cbd5e1!important;
}

/* v285 - cabeçalho responsivo sem sobreposição */
.topbar{min-width:0!important;}
.top-actions{min-width:0!important;}
#topSearchForm{min-width:0!important;}
#topSearchForm > input[name="q"]{min-width:0!important;}
.top-filter-btn,.bell{flex:0 0 auto!important;}

/* v285 - menu mobile com um único controlador e fundo clicável real */
#nexeiMobileBackdropV285{
  position:fixed!important;
  inset:0!important;
  z-index:409000!important;
  display:block!important;
  background:rgba(15,23,42,.42)!important;
  filter:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.nexei-mobile-toggle-v285{display:none!important;}

@media(max-width:900px){
  body:not(.page-login) .main,
  body.page-view .main,
  body.nexei-view-mode .main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
    padding:74px 14px 24px!important;
    overflow-x:hidden!important;
  }
  .topbar{
    height:auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:stretch!important;
    justify-content:stretch!important;
    gap:12px!important;
    margin:0 0 16px!important;
  }
  .topbar h1{
    margin:0!important;
    font-size:22px!important;
    line-height:1.25!important;
  }
  .top-actions{
    position:static!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px!important;
    align-items:center!important;
    gap:8px!important;
  }
  #topSearchForm{
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 42px 42px!important;
    align-items:center!important;
    gap:6px!important;
  }
  #topSearchForm > input[name="q"]{
    width:100%!important;
    min-width:0!important;
    height:44px!important;
    padding:10px 14px!important;
    border-radius:16px!important;
  }
  .top-filter-btn,
  .top-actions .bell{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    padding:0!important;
    border-radius:13px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .top-actions .bell{width:44px!important;min-width:44px!important;height:44px!important;}
  .hero,.hero.compact{
    margin-top:0!important;
    padding:24px 22px!important;
    border-radius:24px!important;
  }
  .hero h2,.hero.compact h2{font-size:28px!important;line-height:1.12!important;}

  .nexei-mobile-toggle-v285{
    display:inline-flex!important;
    position:fixed!important;
    left:14px!important;
    top:14px!important;
    width:46px!important;
    height:46px!important;
    min-width:46px!important;
    min-height:46px!important;
    z-index:420000!important;
    padding:0!important;
    border:1px solid #d5e2f3!important;
    border-radius:14px!important;
    background:#fff!important;
    color:#0f2a55!important;
    align-items:center!important;
    justify-content:center!important;
    box-shadow:0 12px 30px rgba(15,23,42,.18)!important;
    font-size:0!important;
    line-height:1!important;
    touch-action:manipulation!important;
  }
  .nexei-mobile-toggle-v285::before{
    content:'☰'!important;
    font-size:24px!important;
    line-height:1!important;
    font-weight:900!important;
    color:#0f2a55!important;
  }
  body.nexei-mobile-open-v285 .nexei-mobile-toggle-v285::before{
    content:'×'!important;
    font-size:31px!important;
  }
  body:not(.page-login) .sidebar,
  body.page-view .sidebar,
  body.nexei-view-mode .sidebar{
    position:fixed!important;
    left:0!important;
    top:0!important;
    bottom:0!important;
    width:min(320px,86vw)!important;
    min-width:0!important;
    max-width:86vw!important;
    height:100dvh!important;
    z-index:410000!important;
    transform:translate3d(-112%,0,0)!important;
    transition:transform .22s ease!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding:76px 18px 18px!important;
    display:flex!important;
    flex-direction:column!important;
  }
  body.nexei-mobile-open-v285:not(.page-login) .sidebar,
  body.page-view.nexei-mobile-open-v285 .sidebar,
  body.nexei-view-mode.nexei-mobile-open-v285 .sidebar,
  .sidebar.nexei-mobile-open-v285{
    transform:translate3d(0,0,0)!important;
  }
  body.page-view .sidebar .brand,
  body.nexei-view-mode .sidebar .brand,
  body:not(.page-login) .sidebar .brand{
    justify-content:flex-start!important;
    gap:12px!important;
    margin-bottom:28px!important;
  }
  body.page-view .sidebar .brand div:not(.brand-mark),
  body.nexei-view-mode .sidebar .brand div:not(.brand-mark),
  body.page-view .sidebar .nav-text,
  body.nexei-view-mode .sidebar .nav-text,
  body.page-view .sidebar .user-card,
  body.nexei-view-mode .sidebar .user-card{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }
  body.page-view .sidebar nav,
  body.nexei-view-mode .sidebar nav,
  body:not(.page-login) .sidebar nav{
    display:grid!important;
    width:100%!important;
    gap:8px!important;
  }
  body.page-view .sidebar nav a,
  body.nexei-view-mode .sidebar nav a,
  body:not(.page-login) .sidebar nav a{
    width:100%!important;
    height:auto!important;
    min-height:44px!important;
    margin:0!important;
    padding:12px 14px!important;
    justify-content:flex-start!important;
    gap:10px!important;
  }
  body.page-view .sidebar .user-card,
  body.nexei-view-mode .sidebar .user-card,
  body:not(.page-login) .sidebar .user-card{
    position:static!important;
    width:100%!important;
    max-height:none!important;
    margin-top:auto!important;
  }
  #topAdvancedBox.nexei-v285-search-panel:not([hidden]){
    width:calc(100vw - 24px)!important;
    grid-template-columns:1fr!important;
    padding:16px!important;
    max-height:86dvh!important;
  }
  #topPeriodBox.nexei-v285-search-panel:not([hidden]){
    width:calc(100vw - 24px)!important;
    padding:16px!important;
    max-height:86dvh!important;
  }
}

@media(max-width:420px){
  body:not(.page-login) .main,
  body.page-view .main,
  body.nexei-view-mode .main{padding-left:12px!important;padding-right:12px!important;}
  .top-actions{grid-template-columns:minmax(0,1fr) 42px!important;gap:6px!important;}
  #topSearchForm{grid-template-columns:minmax(0,1fr) 40px 40px!important;gap:5px!important;}
  .top-filter-btn{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;}
  .top-actions .bell{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;}
}

/* v285.1 - formulário de busca em portal para centralização real no viewport */
#topSearchForm.nexei-search-form-portal-v285{
  position:static!important;
  display:block!important;
  width:0!important;
  min-width:0!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:visible!important;
}
#nexeiSearchInlineV285{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  min-width:0!important;
}
#nexeiSearchInlineV285 > input[name="q"]{
  min-width:260px!important;
  height:42px!important;
  border-radius:999px!important;
}
@media(max-width:900px){
  #nexeiSearchInlineV285{
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 42px 42px!important;
    align-items:center!important;
    gap:6px!important;
  }
  #nexeiSearchInlineV285 > input[name="q"]{
    width:100%!important;
    min-width:0!important;
    height:44px!important;
    padding:10px 14px!important;
    border-radius:16px!important;
  }
}
@media(max-width:420px){
  #nexeiSearchInlineV285{grid-template-columns:minmax(0,1fr) 40px 40px!important;gap:5px!important;}
}

/* v285.2 - neutraliza backdrops pseudo-elementos de patches legados dentro dos paineis */
#topPeriodBox.nexei-v285-search-panel::before,
#topPeriodBox.nexei-v285-search-panel::after,
#topAdvancedBox.nexei-v285-search-panel::before,
#topAdvancedBox.nexei-v285-search-panel::after{
  content:none!important;
  display:none!important;
}
#topPeriodBox.nexei-v285-search-panel:not([hidden]),
#topAdvancedBox.nexei-v285-search-panel:not([hidden]){
  overflow-x:hidden!important;
  overflow-y:auto!important;
}

/* v285.3 - garante que os paineis fiquem acima do backdrop inclusive nos seletores legados mais especificos */
body #topPeriodBox.top-search-popover.nexei-v285-search-panel:not([hidden]),
body #topAdvancedBox.top-search-popover.advanced.nexei-v285-search-panel:not([hidden]){
  z-index:500000!important;
}
