/*
 * V1.03.8.68 — camada universal final de paleta.
 * Esta folha é mantida como ÚLTIMO stylesheet do <head> pelo runtime V68,
 * portanto os CSS carregados sob demanda por menu não voltam a pintar verde fixo.
 * Cores semânticas (sucesso/erro/alerta/semáforo) são preservadas.
 */
html[data-sgo-palette] body{
  --sgo-table-surface:var(--sgo-surface);
  --sgo-table-alt:color-mix(in srgb,var(--sgo-surface) 92%,var(--sgo-theme-50));
  --sgo-table-hover:color-mix(in srgb,var(--sgo-surface) 78%,var(--sgo-theme-100));
  --sgo-modal-shadow:0 28px 86px rgba(var(--sgo-accent-rgb),.22);
}

/* OVERLAYS / BACKDROPS */
html[data-sgo-palette] body :is(
  #modalRoot:not(.hidden),
  .modal-overlay,.modal-backdrop,.dialog-overlay,.dialog-backdrop,.report-overlay,
  .fac-modal-backdrop,.r80-modal-back,.status-modal-v166,.alocar-hard-modal-wrap,.alocar-hard-modal-wrap-v2,
  .det-tv-overlay,.det-tratativa-modal-backdrop,.storage-modal-backdrop,.system-modal,.pims-field-modal-overlay,.allocation-modal-overlay,.equipment-modal-overlay,.treatment-modal-overlay,.os-table-modal-overlay,
  [class$="-modal-backdrop"],[class$="-modal-overlay"],[class*=" modal-backdrop"],[class*=" modal-overlay"]
){
  background:color-mix(in srgb,var(--sgo-theme-950) 62%,transparent)!important;
  -webkit-backdrop-filter:blur(12px) saturate(.92)!important;
  backdrop-filter:blur(12px) saturate(.92)!important;
}
html[data-sgo-palette] body dialog::backdrop{
  background:color-mix(in srgb,var(--sgo-theme-950) 62%,transparent)!important;
  -webkit-backdrop-filter:blur(12px) saturate(.92)!important;
  backdrop-filter:blur(12px) saturate(.92)!important;
}

/* SUPERFÍCIES DE MODAL: modalRoot, menus, diálogos nativos e famílias históricas. */
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(
  .modal-card,.modal-content,.modal-panel,.dialog-card,.dialog-shell,.report-modal-shell,
  [role="dialog"],
  [class*="modal-card"],[class*="modal-shell"],[class*="modal-content"],[class*="modal-panel"]
),
html[data-sgo-palette] body :is(
  .fac-modal,.fac-result-modal,.monit-dialog-shell,.status-modal-card-v166,.r80-modal,
  .alocar-hard-modal,.alocar-hard-modal-v2,.det-tv-shell,.det-modal-premium,.det-modal-setorizado,
  .det-modal-hub,.det-modal-pane,.det-order-types-modal,.det-oficina-modal-p16,.det-oficina-modal-v111,
  .det-oficina-modal-v113,.det-tratativa-modal-card,.storage-modal,.storage-modal-v2,.storage-modal-p25,
  .report-modal-shell,.report-shell,.report-view
){
  background:var(--sgo-surface)!important;
  color:var(--sgo-ink)!important;
  border-color:color-mix(in srgb,var(--sgo-line) 88%,var(--sgo-theme-100))!important;
  box-shadow:var(--sgo-modal-shadow)!important;
}

/* CABEÇALHOS DE MODAIS */
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(
  .modal-header,.modal-head,.modal-top,.dialog-header,.report-modal-header,
  [class*="modal-header"],[class*="modal-head"],[class*="modal-top"]
),
html[data-sgo-palette] body :is(
  .fac-modal>header,.monit-dialog-head,.status-modal-head-v166,.r80-head,
  .alocar-hard-modal>header,.alocar-hard-modal-v2>header,.det-tv-header,.det-tratativa-modal-head,
  .report-header,.report-hero
){
  background:linear-gradient(118deg,var(--sgo-theme-950),var(--sgo-theme-900) 60%,var(--sgo-theme-700))!important;
  color:#fff!important;
  border-color:rgba(var(--sgo-accent-rgb),.28)!important;
}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(
  .modal-header,.modal-head,.modal-top,.dialog-header,.report-modal-header,
  [class*="modal-header"],[class*="modal-head"],[class*="modal-top"]
) :is(h1,h2,h3,h4,strong,b),
html[data-sgo-palette] body :is(.fac-modal>header,.monit-dialog-head,.status-modal-head-v166,.r80-head,.det-tv-header,.det-tratativa-modal-head,.report-header,.report-hero) :is(h1,h2,h3,h4,strong,b){color:#fff!important}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(
  .modal-header,.modal-head,.modal-top,.dialog-header,.report-modal-header,
  [class*="modal-header"],[class*="modal-head"],[class*="modal-top"]
) :is(p,small,span,label),
html[data-sgo-palette] body :is(.fac-modal>header,.monit-dialog-head,.status-modal-head-v166,.r80-head,.det-tv-header,.det-tratativa-modal-head,.report-header,.report-hero) :is(p,small,span,label){color:rgba(255,255,255,.82)!important}

/* CORPOS / RODAPÉS / PAINÉIS INTERNOS */
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(
  .modal-body,.modal-footer,.modal-actions,.dialog-body,.dialog-footer,.filter-panel,.filters,.toolbar-line,
  .table-shell,.table-wrap,.table-wrapper,[class*="modal-body"],[class*="modal-footer"],[class*="modal-actions"]
){
  color:var(--sgo-ink)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(.modal-body,.dialog-body,.table-shell,.table-wrap,.table-wrapper,[class*="modal-body"]){background:var(--sgo-surface)!important}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(.modal-footer,.modal-actions,.dialog-footer,.filter-panel,.filters,.toolbar-line,[class*="modal-footer"],[class*="modal-actions"]){background:var(--sgo-soft)!important}

/* CAMPOS / FILTROS */
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog,.report-view,.report-shell,.fac-modal,.monit-dialog-shell,.status-modal-card-v166,.r80-modal,.det-tv-shell) :is(
  input,select,textarea,.ms-filter-button,.multi-select-trigger
):not([type="color"]){
  background:var(--sgo-surface)!important;
  color:var(--sgo-ink)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog,.report-view,.report-shell) :is(input,select,textarea):not([type="color"]):focus,
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog,.report-view,.report-shell) :is(.ms-filter.open .ms-filter-button,.multi-select-shell.open .multi-select-trigger){
  border-color:var(--sgo-theme-700)!important;
  box-shadow:0 0 0 3px rgba(var(--sgo-accent-rgb),.13)!important;
}
html[data-sgo-palette] body :is(.multi-select-popover,.ms-filter-panel,.select-popover,.dropdown-menu){
  background:color-mix(in srgb,var(--sgo-surface) 97%,var(--sgo-theme-50))!important;
  color:var(--sgo-ink)!important;
  border-color:var(--sgo-line)!important;
  box-shadow:0 18px 48px rgba(var(--sgo-accent-rgb),.18)!important;
}
html[data-sgo-palette] body :is(.multi-select-option,.ms-filter-option,.dropdown-item){color:var(--sgo-ink)!important;border-color:var(--sgo-line)!important}
html[data-sgo-palette] body :is(.multi-select-option,.ms-filter-option,.dropdown-item):hover{background:var(--sgo-theme-50)!important;border-color:var(--sgo-theme-700)!important}
html[data-sgo-palette] body :is(.multi-select-option.selected,.multi-select-option.is-selected,.ms-filter-option.selected,.ms-filter-option.is-selected){background:var(--sgo-theme-100)!important;color:var(--sgo-theme-900)!important;border-color:var(--sgo-theme-700)!important}

/* TABELAS: a estrutura inteira acompanha a paleta. */
html[data-sgo-palette] body table{
  background:var(--sgo-surface)!important;
  color:var(--sgo-ink)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body table thead,
html[data-sgo-palette] body table thead tr,
html[data-sgo-palette] body table thead th{
  background:linear-gradient(180deg,var(--sgo-theme-900),var(--sgo-theme-950))!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.16)!important;
}
/* Não sobrepõe células explicitamente semânticas. */
html[data-sgo-palette] body table tbody tr:not(.is-critical):not(.is-good):not(.card-status-blue-v125):not(.card-status-danger-v125):not(.card-status-ok-v125):not(.card-status-purple-v125):not(.card-status-warning-v125):not(.mobile-report-danger-v13):not(.mobile-report-info-v13):not(.mobile-report-ok-v13):not(.mobile-report-warning-v13):not(.sgo-status-danger-v846):not(.sgo-status-ok-v846):not(.sgo-status-warning-v846) td:not(.ok):not(.bad):not(.warn):not(.excelente):not(.disp-ok):not(.disp-bad):not(.disp-warn):not(.disp-excelente):not(.red):not(.green):not(.orange):not(.yellow):not(.blue):not(.gray):not([data-status]):not([data-semaforo]){
  background:var(--sgo-table-surface)!important;
  color:var(--sgo-ink)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body table tbody tr:nth-child(even):not(.is-critical):not(.is-good):not(.card-status-blue-v125):not(.card-status-danger-v125):not(.card-status-ok-v125):not(.card-status-purple-v125):not(.card-status-warning-v125):not(.mobile-report-danger-v13):not(.mobile-report-info-v13):not(.mobile-report-ok-v13):not(.mobile-report-warning-v13):not(.sgo-status-danger-v846):not(.sgo-status-ok-v846):not(.sgo-status-warning-v846) td:not(.ok):not(.bad):not(.warn):not(.excelente):not(.disp-ok):not(.disp-bad):not(.disp-warn):not(.disp-excelente):not(.red):not(.green):not(.orange):not(.yellow):not(.blue):not(.gray):not([data-status]):not([data-semaforo]){background:var(--sgo-table-alt)!important}
html[data-sgo-palette] body table tbody tr:hover:not(.is-critical):not(.is-good):not(.card-status-blue-v125):not(.card-status-danger-v125):not(.card-status-ok-v125):not(.card-status-purple-v125):not(.card-status-warning-v125):not(.mobile-report-danger-v13):not(.mobile-report-info-v13):not(.mobile-report-ok-v13):not(.mobile-report-warning-v13):not(.sgo-status-danger-v846):not(.sgo-status-ok-v846):not(.sgo-status-warning-v846) td:not(.ok):not(.bad):not(.warn):not(.excelente):not(.disp-ok):not(.disp-bad):not(.disp-warn):not(.disp-excelente):not(.red):not(.green):not(.orange):not(.yellow):not(.blue):not(.gray):not([data-status]):not([data-semaforo]){background:var(--sgo-table-hover)!important}
html[data-sgo-palette] body table tfoot,
html[data-sgo-palette] body table tfoot td,
html[data-sgo-palette] body table tfoot th{
  background:color-mix(in srgb,var(--sgo-soft) 84%,var(--sgo-theme-50))!important;
  color:var(--sgo-theme-900)!important;
  border-color:var(--sgo-line)!important;
}

/* PAGINAÇÃO / BOTÕES ESTRUTURAIS */
html[data-sgo-palette] body :is(.pagination,.table-pagination,.modal-pager) button:not(.danger){background:var(--sgo-surface)!important;color:var(--sgo-theme-900)!important;border-color:var(--sgo-line)!important}
html[data-sgo-palette] body :is(.pagination,.table-pagination,.modal-pager) button:not(:disabled):not(.danger):hover,
html[data-sgo-palette] body :is(.pagination,.table-pagination) button.active{background:var(--sgo-theme-50)!important;color:var(--sgo-theme-900)!important;border-color:var(--sgo-theme-700)!important}
html[data-sgo-palette] body :is(#modalRoot,#menuHost,dialog) :is(.btn.primary,.button-primary,.primary-button):not(.danger),
html[data-sgo-palette] body :is(.report-print-btn,.report-copy-btn,.alocar-hard-close,.det-tv-close){background:linear-gradient(135deg,var(--sgo-theme-900),var(--sgo-theme-700))!important;color:#fff!important;border-color:var(--sgo-theme-800)!important}

/* MODAIS DE STORAGE E PAINÉIS HISTÓRICOS QUE TINHAM BRANCO/VERDE FIXO. */
html[data-sgo-palette] body :is(
  .fac-modal-body,.fac-modal-edit,.fac-detail,.monit-dialog-body,.monit-detail-card,.monit-timeline-item,
  .status-modal-body-v166,.status-modal-foot-v166,.r80-body,.r80-panel,.r80-table,
  .det-modal-hub-intro,.det-modal-pane-head,.storage-modal,.storage-modal-v2,.storage-modal-p25,
  .storage-modal-summary>div,.storage-modal-summary-v2>div,
  .compact-modal-table-shell,.consultas-report-table-shell,.disp-detail-table-shell,.disp-table-shell,
  .fac-table-shell,.gos-table-shell,.mat-consulta-table-wrap,.mat-table-panel,.materiais-table-shell,
  .monit-audit-table-wrap,.rel-paradas-table-shell,.status-table-shell-v166,.storage-table-wrap-p25,
  .usuarios-table-wrap
){border-color:var(--sgo-line)!important;color:var(--sgo-ink)!important}
html[data-sgo-palette] body :is(.fac-detail,.monit-detail-card,.storage-modal-summary>div,.storage-modal-summary-v2>div,.compact-modal-table-shell,.consultas-report-table-shell,.disp-detail-table-shell,.disp-table-shell,.fac-table-shell,.gos-table-shell,.mat-consulta-table-wrap,.mat-table-panel,.materiais-table-shell,.monit-audit-table-wrap,.rel-paradas-table-shell,.status-table-shell-v166,.storage-table-wrap-p25,.usuarios-table-wrap){background:var(--sgo-surface)!important}
html[data-sgo-palette] body :is(.fac-modal-body,.monit-dialog-body,.status-modal-body-v166,.status-modal-foot-v166,.r80-body,.r80-panel,.det-modal-hub-intro,.det-modal-pane-head,.storage-modal,.storage-modal-v2,.storage-modal-p25){background:var(--sgo-soft)!important}

/* ========================================================================
   V1.03.8.69 — AJUSTES PONTUAIS SOLICITADOS
   1) Modo TV estruturalmente coerente com a paleta ativa.
   2) KPIs da Disponibilidade iguais ao padrão visual do relatório.
   Cores de semáforo/status permanecem semânticas.
   ======================================================================== */

/* MODO TV — somente superfícies estruturais seguem a paleta. */
html[data-sgo-palette] body .det-tv-overlay{
  background:color-mix(in srgb,var(--sgo-theme-950) 70%,transparent)!important;
}
html[data-sgo-palette] body .det-tv-shell{
  background:var(--sgo-canvas)!important;
  border-color:color-mix(in srgb,var(--sgo-line) 82%,#fff)!important;
  color:var(--sgo-ink)!important;
  box-shadow:0 26px 80px rgba(var(--sgo-accent-rgb),.22)!important;
}
html[data-sgo-palette] body .det-tv-header{
  background:linear-gradient(118deg,var(--sgo-theme-950),var(--sgo-theme-900) 58%,var(--sgo-theme-700))!important;
}
html[data-sgo-palette] body .det-tv-eyebrow{color:color-mix(in srgb,#fff 76%,var(--sgo-theme-100))!important}
html[data-sgo-palette] body .det-tv-side :is(span,small){color:rgba(255,255,255,.84)!important}
html[data-sgo-palette] body .det-tv-close{
  border:1px solid rgba(255,255,255,.34)!important;
  background:color-mix(in srgb,var(--sgo-theme-800) 72%,#fff 28%)!important;
  color:#fff!important;
}
html[data-sgo-palette] body .det-tv-kpis{
  background:color-mix(in srgb,var(--sgo-soft) 84%,var(--sgo-theme-50))!important;
  border-bottom-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-kpi{
  background:var(--sgo-surface)!important;
  color:var(--sgo-ink)!important;
  box-shadow:0 4px 12px rgba(var(--sgo-accent-rgb),.05)!important;
}
html[data-sgo-palette] body .det-tv-kpi span{
  background:var(--sgo-theme-50)!important;
  color:var(--sgo-theme-900)!important;
}
html[data-sgo-palette] body .det-tv-mural-board,
html[data-sgo-palette] body .det-tv-board{
  background:var(--sgo-canvas)!important;
}
html[data-sgo-palette] body .det-tv-mural-process,
html[data-sgo-palette] body .det-tv-status,
html[data-sgo-palette] body .det-tv-process{
  background:var(--sgo-surface)!important;
  border-color:var(--sgo-line)!important;
  color:var(--sgo-ink)!important;
  box-shadow:0 5px 16px rgba(var(--sgo-accent-rgb),.06)!important;
}
html[data-sgo-palette] body .det-tv-mural-process>header{
  background:linear-gradient(135deg,var(--sgo-theme-900),var(--sgo-theme-700))!important;
  color:#fff!important;
}
html[data-sgo-palette] body .det-tv-mural-process>header span{
  background:var(--sgo-surface)!important;
  color:var(--sgo-theme-900)!important;
}
html[data-sgo-palette] body .det-tv-mural-process>header small{color:rgba(255,255,255,.78)!important}
html[data-sgo-palette] body .det-tv-mural-row{
  background:var(--sgo-surface)!important;
  color:var(--sgo-ink)!important;
  border-bottom-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-mural-row:hover{
  background:var(--sgo-theme-50)!important;
  box-shadow:inset 0 0 0 2px rgba(var(--sgo-accent-rgb),.16)!important;
}
html[data-sgo-palette] body .det-tv-mural-id b,
html[data-sgo-palette] body .det-tv-mural-location b,
html[data-sgo-palette] body .det-tv-mural-os b,
html[data-sgo-palette] body .det-tv-process h4,
html[data-sgo-palette] body .det-tv-fleet b,
html[data-sgo-palette] body .det-tv-empty{
  color:var(--sgo-ink)!important;
}
html[data-sgo-palette] body :is(.det-tv-mural-id small,.det-tv-mural-location small,.det-tv-mural-os small,.det-tv-process h4 span,.det-tv-fleet small){
  color:var(--sgo-muted)!important;
}
html[data-sgo-palette] body .det-tv-status-head{
  background:var(--sgo-soft)!important;
  border-bottom-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-status-head h3{color:var(--sgo-ink)!important}
html[data-sgo-palette] body .det-tv-fleet:not(.red):not(.green):not(.orange):not(.yellow):not(.purple):not(.gray):not(.teal):not(.opportunity):not(.blue){
  background:var(--sgo-surface)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-mural-footer{
  background:var(--sgo-soft)!important;
  color:var(--sgo-ink)!important;
  border-top-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-mural-footer button{
  background:var(--sgo-surface)!important;
  color:var(--sgo-theme-900)!important;
  border-color:var(--sgo-line)!important;
}
html[data-sgo-palette] body .det-tv-mural-footer button:hover{
  background:var(--sgo-theme-50)!important;
  border-color:var(--sgo-theme-700)!important;
}
html[data-sgo-palette] body .det-tv-mural-dots i{background:var(--sgo-line)!important}
html[data-sgo-palette] body .det-tv-mural-dots i.is-active{background:var(--sgo-theme-700)!important}

/* DISPONIBILIDADE — KPIs da tela principal com o mesmo desenho do relatório. */
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo.disp-summary{
  gap:8px!important;
  padding:7px 8px!important;
  border:1px solid var(--sgo-line)!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--sgo-soft) 90%,var(--sgo-theme-50))!important;
  box-shadow:none!important;
}
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card{
  min-height:46px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"label value" "meta value"!important;
  align-items:center!important;
  column-gap:12px!important;
  padding:8px 10px!important;
  border:1px solid var(--sgo-line)!important;
  border-radius:11px!important;
  background:var(--sgo-surface)!important;
  box-shadow:none!important;
}
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card:is(.principal,.operational,.critical,.impact,.ok,.bad){
  border-color:var(--sgo-line)!important;
  background:var(--sgo-surface)!important;
}
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card span{
  color:var(--sgo-muted)!important;
  font-size:9px!important;
  font-weight:950!important;
  letter-spacing:.03em!important;
}
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card strong,
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card:is(.principal,.operational,.critical,.impact,.ok,.bad) strong{
  color:var(--sgo-theme-900)!important;
  font-size:17px!important;
  font-weight:1000!important;
}
html[data-sgo-palette] body[data-current-menu="disponibilidade"] #dispResumo .disp-summary-card small{
  color:var(--sgo-muted)!important;
  font-size:8px!important;
  font-weight:800!important;
}
html[data-sgo-palette] body #btnAlocacaoTv{
  border-color:var(--sgo-theme-700)!important;
  background:var(--sgo-surface)!important;
  color:var(--sgo-theme-900)!important;
}
html[data-sgo-palette] body #btnAlocacaoTv:hover{
  background:var(--sgo-theme-50)!important;
  box-shadow:0 8px 20px rgba(var(--sgo-accent-rgb),.12)!important;
}
html[data-sgo-palette] body .det-tv-status-head span{
  background:var(--sgo-theme-900)!important;
  color:#fff!important;
}
