/* PWPLADUR v1466 — Entidades > Subempreiteiros
   Tabs EM OBRA / LISTA integradas no renderizador principal + sticky opaco. */
#content-root.pw-subempreiteiros-v1466{
  --sub-entidade-sticky-h:92px;
  overflow:visible!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-sticky{
  position:sticky!important;
  top:0!important;
  z-index:8200!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:0 0 7px!important;
  background:#F6F7F7!important;
  background-color:#F6F7F7!important;
  isolation:isolate!important;
  box-shadow:0 7px 10px -10px rgba(15,23,42,.42)!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-sticky::before{
  content:""!important;
  position:absolute!important;
  inset:-34px -2px 0!important;
  z-index:-1!important;
  background:#F6F7F7!important;
  pointer-events:none!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar{
  position:relative!important;
  z-index:3!important;
  margin:0 0 7px!important;
  padding:0!important;
  background:#F6F7F7!important;
  background-color:#F6F7F7!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tabs{
  position:relative!important;
  z-index:3!important;
  display:flex!important;
  align-items:flex-end!important;
  gap:3px!important;
  min-height:39px!important;
  margin:0!important;
  padding:0!important;
  border-bottom:1px solid #CBD5E1!important;
  background:#F6F7F7!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tab{
  appearance:none!important;
  border:0!important;
  border-bottom:3px solid transparent!important;
  background:transparent!important;
  color:#64748B!important;
  min-height:39px!important;
  padding:9px 16px 8px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  font:inherit!important;
  font-size:12px!important;
  font-weight:900!important;
  letter-spacing:.02em!important;
  cursor:pointer!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tab:hover{
  color:#0F172A!important;
  background:rgba(255,255,255,.75)!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tab.active{
  color:var(--accent,#F59E0B)!important;
  border-bottom-color:var(--accent,#F59E0B)!important;
  background:#FFF!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tab-count{
  min-width:22px!important;
  height:20px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#E2E8F0!important;
  color:#475569!important;
  font-size:10.5px!important;
  font-weight:900!important;
  line-height:1!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-tab.active .sub-entidade-tab-count{
  background:#FFF7ED!important;
  color:#C2410C!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-card{
  margin-top:0!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head{
  position:sticky!important;
  top:var(--sub-entidade-sticky-h)!important;
  z-index:8100!important;
  background:#F8FAFC!important;
  background-color:#F8FAFC!important;
  box-shadow:0 1px 0 #CBD5E1,0 5px 8px rgba(15,23,42,.11)!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head::before{
  content:""!important;
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:-8px!important;
  height:9px!important;
  background:#F8FAFC!important;
  z-index:10!important;
  pointer-events:none!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head-cell{
  background:#F8FAFC!important;
  background-color:#F8FAFC!important;
}

/* Modo telemóvel */
.pw-mob-sub-tabs1466{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:0!important;
  margin:8px 0 10px!important;
  border-bottom:1px solid #CBD5E1!important;
}
.pw-mob-sub-tabs1466 button{
  appearance:none!important;
  border:0!important;
  border-bottom:3px solid transparent!important;
  background:transparent!important;
  color:#64748B!important;
  padding:10px 8px 8px!important;
  font-size:12px!important;
  font-weight:900!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
}
.pw-mob-sub-tabs1466 button.active{
  color:var(--accent,#F59E0B)!important;
  border-bottom-color:var(--accent,#F59E0B)!important;
  background:#FFF!important;
}
.pw-mob-sub-tabs1466 button b{
  min-width:21px!important;
  height:20px!important;
  padding:0 5px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:999px!important;
  background:#E2E8F0!important;
  color:#475569!important;
  font-size:10px!important;
}
.pw-mob-sub-filter1466{margin:0 0 10px!important;}
.pw-mob-sub-filter1466[hidden]{display:none!important;}
.pw-mob-sub-filter1466 select{
  width:100%!important;
  min-height:42px!important;
  padding:8px 10px!important;
  border:1px solid #CBD5E1!important;
  border-radius:6px!important;
  background:#FFF!important;
  color:#334155!important;
  font-size:13px!important;
}


/* v1466 — máscara integral da zona superior e prevenção visual de tabs antigas. */
#content-root.pw-subempreiteiros-v1466 .sub-entidade-sticky{
  box-shadow:0 -30px 0 #F6F7F7,0 7px 10px -10px rgba(15,23,42,.42)!important;
}
#content-root.pw-subempreiteiros-v1466 #sub-entidade-tabs-main{
  display:flex!important;
}
#content-root.pw-subempreiteiros-v1466 [data-pw-sub-tabs-legacy="1"]{
  display:none!important;
}

/* PWPLADUR 1549 — Subempreiteiros: primeira coluna fixa no scroll horizontal.
   Aplica-se à grelha comum dos tabs EM OBRA e LISTA, sem alterar larguras. */
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head-cell:first-child{
  position:sticky!important;
  left:0!important;
  z-index:24!important;
  background:#F8FAFC!important;
  background-color:#F8FAFC!important;
  box-shadow:2px 0 5px rgba(15,23,42,.10)!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-row .pw-grid-cell:first-child{
  position:sticky!important;
  left:0!important;
  z-index:8!important;
  background:#FFF!important;
  background-color:#FFF!important;
  box-shadow:2px 0 5px rgba(15,23,42,.08)!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-row:hover .pw-grid-cell:first-child{
  background:#FAFBFC!important;
  background-color:#FAFBFC!important;
}


/* PWPLADUR 1550 — Subempreiteiros: manter também o título da primeira coluna fixo.
   O cabeçalho genérico tinha overflow:hidden + transform, o que recortava o sticky
   horizontal da célula "Empresa". Esta exceção é apenas da grelha de Subempreiteiros. */
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head{
  overflow:visible!important;
  transform:none!important;
}
#content-root.pw-subempreiteiros-v1466 .pw-grid-subempreiteiros .pw-grid-head > .pw-grid-head-cell:first-child{
  position:sticky!important;
  left:0!important;
  inset-inline-start:0!important;
  z-index:8201!important;
  background:#F8FAFC!important;
  background-color:#F8FAFC!important;
  box-shadow:2px 0 5px rgba(15,23,42,.10)!important;
}


/* PWPLADUR 1551 — Subempreiteiros: todo o bloco acima da linha dos títulos
   das colunas permanece fixo também no scroll horizontal. O bloco inclui
   pesquisa/filtros/botão Novo e os tabs EM OBRA / LISTA. Mantém-se sticky
   verticalmente como antes; esta regra apenas acrescenta a ancoragem horizontal. */
#content-root.pw-subempreiteiros-v1466 > .sub-entidade-sticky{
  left:0!important;
  inset-inline-start:0!important;
  right:auto!important;
  z-index:8300!important;
}

/* PWPLADUR 1552 — Subempreiteiros: máscaras laterais opacas.
   O content-root mantém padding horizontal (28px desktop / 18px tablet / 10px mobile).
   Como a grelha é mais larga e desliza horizontalmente, esse padding podia deixar
   ver fragmentos das colunas em movimento nas duas laterais. As máscaras acompanham
   o bloco sticky e cobrem apenas essas faixas laterais, sem alterar larguras, scroll
   ou posição das colunas. */
#content-root.pw-subempreiteiros-v1466{
  --pw-sub-side-mask:28px;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::before,
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::after{
  content:""!important;
  position:absolute!important;
  top:0!important;
  width:var(--pw-sub-side-mask)!important;
  height:100dvh!important;
  background:#F6F7F7!important;
  background-color:#F6F7F7!important;
  z-index:8400!important;
  pointer-events:none!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::before{
  left:calc(-1 * var(--pw-sub-side-mask))!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::after{
  right:calc(-1 * var(--pw-sub-side-mask))!important;
}
@media (max-width:1200px){
  #content-root.pw-subempreiteiros-v1466{--pw-sub-side-mask:18px;}
}
@media (max-width:700px){
  #content-root.pw-subempreiteiros-v1466{--pw-sub-side-mask:10px;}
}


/* PWPLADUR 1553 — Subempreiteiros: fecho integral das fugas laterais/topo.
   A 1552 cobria o padding lateral, mas no lado direito ainda restava a faixa
   ocupada pela calha/scrollbar do content-root e, acima do toolbar, as máscaras
   começavam alguns píxeis demasiado abaixo. Nesta revisão as máscaras começam
   antes do topo do bloco sticky e a direita inclui a margem residual do scrollport.
   Alteração limitada à grelha de Subempreiteiros. */
#content-root.pw-subempreiteiros-v1466{
  --pw-sub-mask-top-extra:42px;
  --pw-sub-mask-right-extra:16px;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::before,
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::after{
  top:calc(-1 * var(--pw-sub-mask-top-extra))!important;
  height:calc(100dvh + var(--pw-sub-mask-top-extra))!important;
}
#content-root.pw-subempreiteiros-v1466 .sub-entidade-toolbar::after{
  width:calc(var(--pw-sub-side-mask) + var(--pw-sub-mask-right-extra))!important;
  right:calc(-1 * (var(--pw-sub-side-mask) + var(--pw-sub-mask-right-extra)))!important;
}
/* Reforço dos cantos superiores: o fundo do bloco sticky prolonga-se até às
   mesmas margens das máscaras, evitando qualquer vislumbre de colunas no topo. */
#content-root.pw-subempreiteiros-v1466 .sub-entidade-sticky::before{
  left:calc(-1 * var(--pw-sub-side-mask))!important;
  right:calc(-1 * (var(--pw-sub-side-mask) + var(--pw-sub-mask-right-extra)))!important;
  top:calc(-1 * var(--pw-sub-mask-top-extra))!important;
  bottom:0!important;
  background:#F6F7F7!important;
  background-color:#F6F7F7!important;
}
