/*
 * V1.03.8.42 — paleta integral nos relatórios, filtros com acabamento seguro
 * e tipografia revisada do Alarmes Monit.
 *
 * Importante: os contêineres abaixo recebem apenas fundos em camadas. Não há
 * transform, pseudo-elemento ou overflow oculto; os painéis dos filtros
 * múltiplos continuam livres para ultrapassar o cartão sem serem recortados.
 */

/* Acabamento visual aprovado na Alocação, replicado sem mudar a lógica. */
html[data-sgo-palette] body[data-current-menu] #menuHost :is(
  .consultas-filters,
  .det-filters,
  .disp-filters,
  .gos-filter-panel,
  .fac-filter-panel,
  .fac-dashboard-filter,
  .mat-filter-panel,
  .usuarios-search,
  .monit-dashboard-filters,
  .monit-history-tools,
  .monit-audit-filters,
  .monit-queue-tools
){
  position:relative!important;
  border-color:color-mix(in srgb,var(--sgo-theme-700) 18%,var(--sgo-line))!important;
  background:
    radial-gradient(circle at 64% -28%,rgba(var(--sgo-accent-rgb),.12),transparent 31%),
    radial-gradient(circle at 93% 118%,rgba(var(--sgo-accent-rgb),.10),transparent 27%),
    repeating-linear-gradient(90deg,rgba(var(--sgo-accent-rgb),.035) 0 1px,transparent 1px 44px),
    repeating-linear-gradient(0deg,rgba(var(--sgo-accent-rgb),.03) 0 1px,transparent 1px 44px),
    linear-gradient(180deg,var(--sgo-surface),color-mix(in srgb,var(--sgo-theme-50) 54%,var(--sgo-surface)))!important;
  box-shadow:0 12px 30px rgba(var(--sgo-accent-rgb),.10)!important;
}

html[data-sgo-palette] body[data-current-menu] #menuHost :is(
  .consultas-filters,
  .det-filters,
  .disp-filters,
  .gos-filter-panel,
  .fac-filter-panel,
  .mat-filter-panel,
  .materiais-filters
){
  overflow:visible!important;
  isolation:auto!important;
}

html[data-sgo-palette] body[data-current-menu] #menuHost :is(
  .consultas-filters,
  .det-filters,
  .disp-filters,
  .gos-filter-panel,
  .fac-filter-panel,
  .mat-filter-panel,
  .materiais-filters
):has(.ms-filter.open){
  z-index:9000!important;
}

html[data-sgo-palette] body[data-current-menu] #menuHost :is(
  .consultas-filters,
  .det-filters,
  .disp-filters,
  .gos-filter-panel,
  .fac-filter-panel,
  .mat-filter-panel,
  .materiais-filters
) .ms-filter.open{
  position:relative!important;
  z-index:9100!important;
}

html[data-sgo-palette] body[data-current-menu] #menuHost :is(
  .consultas-filters,
  .det-filters,
  .disp-filters,
  .gos-filter-panel,
  .fac-filter-panel,
  .mat-filter-panel,
  .materiais-filters
) .ms-filter-panel{
  z-index:9200!important;
  border-color:var(--sgo-line)!important;
  box-shadow:0 24px 58px rgba(var(--sgo-accent-rgb),.24)!important;
}

/* Cabeçalhos estruturais acompanham a identidade; cores de status não mudam. */
html[data-sgo-palette] body[data-current-menu="consultas-gerais"] #menuHost #tabelaConsultas thead th,
html[data-sgo-palette] body[data-current-menu="consultas-gerais"] #menuHost table.consultas-table thead th,
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #menuHost table.matrix thead th,
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #menuHost .disp-table-shell table thead th,
html[data-sgo-palette] body[data-current-menu="materiais"] #menuHost .materiais-table thead th,
html[data-sgo-palette] body[data-current-menu="materiais"] #menuHost .mat-table thead th{
  background:linear-gradient(112deg,var(--sgo-theme-950),var(--sgo-theme-800))!important;
  border-color:color-mix(in srgb,var(--sgo-theme-700) 72%,#000)!important;
  color:#fff!important;
}

/* Modais de relatório. O bloco dinâmico em relatorios.js repete estas regras
 * no fim da cascata; estas seleções também cobrem relatórios de módulos. */
html[data-sgo-palette] body #modalRoot .report-modal-shell .report-modal-header{
  background:linear-gradient(112deg,var(--sgo-theme-950),var(--sgo-theme-900) 58%,var(--sgo-theme-700))!important;
  border-color:rgba(var(--sgo-accent-rgb),.28)!important;
  color:#fff!important;
}
html[data-sgo-palette] body #modalRoot .report-modal-shell .report-copy-btn{
  background:var(--sgo-theme-700)!important;
  border-color:var(--sgo-theme-700)!important;
  color:#fff!important;
}
html[data-sgo-palette] body #modalRoot .report-view :is(.report-head h2,.report-section>h3){
  color:var(--sgo-theme-900)!important;
}
html[data-sgo-palette] body #modalRoot .report-view .report-head{
  border-color:var(--sgo-theme-800)!important;
}
html[data-sgo-palette] body #modalRoot .report-view table thead th,
html[data-sgo-palette] body #modalRoot .report-view .rel-aloc-front-title,
html[data-sgo-palette] body #modalRoot .report-view .rel-aloc-type-name,
html[data-sgo-palette] body #modalRoot .report-view .disp-report-hero-p251{
  background:linear-gradient(112deg,var(--sgo-theme-950),var(--sgo-theme-800))!important;
  color:#fff!important;
}

/* Modo Print manual no próprio navegador: mesma paleta do usuário. */
html[data-sgo-palette] body .report-capture-overlay-r91{
  background:var(--sgo-canvas)!important;
  color:var(--sgo-ink)!important;
}
html[data-sgo-palette] body .report-capture-toolbar-r91{
  background:linear-gradient(112deg,var(--sgo-theme-950),var(--sgo-theme-900) 58%,var(--sgo-theme-700))!important;
  box-shadow:0 5px 18px rgba(var(--sgo-accent-rgb),.24)!important;
}
html[data-sgo-palette] body .report-capture-toolbar-r91 small{
  color:color-mix(in srgb,#fff 78%,var(--sgo-theme-100))!important;
}
html[data-sgo-palette] body .report-capture-actions-r91 button,
html[data-sgo-palette] body .report-capture-restore-r91{
  color:var(--sgo-theme-900)!important;
  border-color:color-mix(in srgb,var(--sgo-theme-100) 58%,#fff)!important;
}
html[data-sgo-palette] body .report-capture-content-r91 .report-head{
  border-color:var(--sgo-theme-800)!important;
}
html[data-sgo-palette] body .report-capture-content-r91 :is(.report-head h2,.report-section h3){
  color:var(--sgo-theme-900)!important;
}
html[data-sgo-palette] body .report-capture-content-r91 table thead th,
html[data-sgo-palette] body .report-capture-content-r91 .rel-aloc-front-title,
html[data-sgo-palette] body .report-capture-content-r91 .rel-aloc-type-name,
html[data-sgo-palette] body .report-capture-content-r91 .disp-report-hero-p251{
  background:linear-gradient(112deg,var(--sgo-theme-950),var(--sgo-theme-800))!important;
  color:#fff!important;
}

/* Alarmes Monit: tipografia corporativa legível e contraste correto no hero. */
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-page,
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-page :is(button,input,select,textarea){
  font-family:"Segoe UI Variable Text","Segoe UI",Aptos,Arial,sans-serif!important;
  font-synthesis:none!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-page{
  font-weight:500!important;
  letter-spacing:0!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-page :is(h1,h2,h3,h4,strong,b,.monit-tab,.monit-btn,.monit-queue-chip){
  font-weight:700!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-hero h1{
  color:#fff!important;
  font-size:30px!important;
  font-weight:750!important;
  letter-spacing:-.025em!important;
  text-shadow:0 2px 10px rgba(0,0,0,.18)!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-hero .monit-eyebrow{
  color:color-mix(in srgb,#fff 72%,var(--sgo-theme-100))!important;
  font-weight:700!important;
  letter-spacing:.12em!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-hero p{
  color:rgba(255,255,255,.82)!important;
  font-size:11px!important;
  font-weight:500!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost .monit-title-icon{
  background:rgba(255,255,255,.10)!important;
  border:1px solid rgba(255,255,255,.16)!important;
  color:#fff!important;
}
html[data-sgo-palette] body[data-current-menu="alarmes-monit"] #menuHost :is(.monit-toolbar-card,.monit-panel,.monit-card){
  color:var(--sgo-ink)!important;
}

@media(max-width:780px){
  html[data-sgo-palette] body[data-current-menu] #menuHost :is(
    .consultas-filters,.det-filters,.disp-filters,.gos-filter-panel,.fac-filter-panel,.mat-filter-panel,.materiais-filters
  ) .ms-filter-panel{
    position:fixed!important;
    z-index:20000!important;
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    width:auto!important;
    max-width:none!important;
    max-height:min(68dvh,560px)!important;
  }
}

@media(prefers-reduced-motion:reduce){
  html[data-sgo-palette] body[data-current-menu] #menuHost :is(
    .consultas-filters,.det-filters,.disp-filters,.gos-filter-panel,.fac-filter-panel,.mat-filter-panel
  ){
    background:linear-gradient(180deg,var(--sgo-surface),var(--sgo-theme-50))!important;
  }
}
