/* EVPL Final Pass PRO.08
   Correção cirúrgica do multiselect + acabamento corporativo. */
:root{
  --evpl-final-navy:#172033;
  --evpl-final-navy-2:#223149;
  --evpl-final-red:#b80f1a;
  --evpl-final-red-2:#d51e29;
  --evpl-final-ink:#172033;
  --evpl-final-muted:#667085;
  --evpl-final-line:#d8e1ed;
  --evpl-final-soft:#f6f8fb;
  --evpl-final-focus:rgba(184,15,26,.12);
  --evpl-final-shadow:0 18px 46px rgba(15,23,42,.16);
  --evpl-final-control-h:38px;
}

body.evpl-pro{
  background:#f4f6fb!important;
  color:var(--evpl-final-ink)!important;
}

/* Botões mais estreitos, com cara de sistema gerencial. */
body.evpl-pro .btns{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
  gap:7px!important;
  width:min(710px,56vw)!important;
}
body.evpl-pro .btns > button,
body.evpl-pro .btns > .btn,
body.evpl-pro .btns > .apply-btn{
  width:auto!important;
  min-width:76px!important;
  max-width:128px!important;
  height:32px!important;
  min-height:32px!important;
  padding:0 12px!important;
  border-radius:10px!important;
  font-size:11px!important;
  font-weight:880!important;
  letter-spacing:.01em!important;
  white-space:nowrap!important;
  box-shadow:0 5px 14px rgba(15,23,42,.075)!important;
}
body.evpl-pro #btnApply{
  min-width:86px!important;
  background:linear-gradient(135deg,var(--evpl-final-red),var(--evpl-final-red-2))!important;
  border-color:var(--evpl-final-red)!important;
}
body.evpl-pro #btnExport,
body.evpl-pro #btnExportCSV,
body.evpl-pro #btnViewMode{min-width:64px!important;}

/* Filtros: aparência limpa, campos proporcionais e sem exageros visuais. */
body.evpl-pro .filters{
  border-color:#e1e7f0!important;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(249,251,255,.98))!important;
  box-shadow:0 12px 30px rgba(15,23,42,.065)!important;
}
body.evpl-pro .filter-group.active{
  grid-template-columns:repeat(auto-fit,minmax(174px,1fr))!important;
  gap:10px!important;
  align-items:end!important;
}
body.evpl-pro .field{position:relative!important;min-width:0!important;}
body.evpl-pro .field.wide{grid-column:span 2!important;min-width:240px!important;}
body.evpl-pro .field > label{
  color:#5f6f87!important;
  font-size:9.7px!important;
  font-weight:920!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
  line-height:1.1!important;
}
body.evpl-pro .field.has-value > label{color:var(--evpl-final-red)!important;}
body.evpl-pro .field.has-value > label::before{
  content:'●'!important;
  margin-right:4px!important;
  color:var(--evpl-final-red-2)!important;
  font-size:8px!important;
  vertical-align:1px!important;
}
body.evpl-pro input[type="search"],
body.evpl-pro input[type="text"],
body.evpl-pro input[type="number"],
body.evpl-pro select,
body.evpl-pro textarea,
body.evpl-pro .ms332-head{
  height:var(--evpl-final-control-h)!important;
  min-height:var(--evpl-final-control-h)!important;
  border:1px solid #d5deea!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#1d2939!important;
  font-size:12px!important;
  font-weight:760!important;
  box-shadow:inset 0 1px 0 rgba(16,24,40,.025)!important;
}
body.evpl-pro input[type="search"]:focus,
body.evpl-pro input[type="text"]:focus,
body.evpl-pro input[type="number"]:focus,
body.evpl-pro select:focus,
body.evpl-pro textarea:focus,
body.evpl-pro .ms332-head:focus{
  border-color:#d85660!important;
  box-shadow:0 0 0 3px var(--evpl-final-focus),0 8px 20px rgba(16,24,40,.055)!important;
}

/* Multiselect blindado: nenhuma regra global de label/field entra aqui. */
body.evpl-pro .field.has-ms332 > select[data-ms332="1"],
body.evpl-pro select[data-ms332="1"]{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-height:1px!important;
  max-height:1px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  opacity:0!important;
  pointer-events:none!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  overflow:hidden!important;
}
body.evpl-pro .ms332{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  position:relative!important;
  isolation:isolate!important;
  color:#1d2939!important;
}
body.evpl-pro .ms332-head{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:5px!important;
  padding:0 28px 0 10px!important;
  overflow:hidden!important;
  cursor:pointer!important;
  user-select:none!important;
  position:relative!important;
}
body.evpl-pro .ms332-head::after{
  content:'▾'!important;
  position:absolute!important;
  right:10px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  color:#667085!important;
  font-size:10px!important;
}
body.evpl-pro .ms332.open .ms332-head::after{content:'▴'!important;color:var(--evpl-final-red)!important;}
body.evpl-pro .ms332-head .placeholder{
  color:#667085!important;
  opacity:1!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}
body.evpl-pro .ms332-chip{
  max-width:86px!important;
  height:22px!important;
  min-height:22px!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  flex:0 1 auto!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  padding:0 7px!important;
  border-radius:999px!important;
  border:1px solid #d3deeb!important;
  background:#eef3f9!important;
  color:#26344d!important;
  font-size:10.2px!important;
  font-weight:850!important;
  line-height:1!important;
}
body.evpl-pro .ms332-chip .x{
  flex:0 0 auto!important;
  color:#7f8da3!important;
  font-size:12px!important;
  line-height:1!important;
}
body.evpl-pro .ms332-summary-chip{background:#fff4df!important;border-color:#ffd79d!important;color:#7a4300!important;}

body.evpl-pro .ms332-menu{
  position:absolute!important;
  top:calc(100% + 6px)!important;
  left:0!important;
  right:auto!important;
  z-index:9000!important;
  display:none!important;
  width:max(100%,310px)!important;
  min-width:0!important;
  max-width:min(390px,calc(100vw - 24px))!important;
  max-height:min(330px,calc(100dvh - 190px))!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  padding:8px!important;
  border:1px solid #cbd6e4!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#1d2939!important;
  box-shadow:var(--evpl-final-shadow)!important;
  text-transform:none!important;
  letter-spacing:0!important;
}
body.evpl-pro .ms332.open .ms332-menu{display:block!important;}
body.evpl-pro .ms332.align-right .ms332-menu{left:auto!important;right:0!important;}
body.evpl-pro .ms332.drop-up .ms332-menu{top:auto!important;bottom:calc(100% + 6px)!important;}
body.evpl-pro .ms332-menu,
body.evpl-pro .ms332-menu *{
  box-sizing:border-box!important;
  text-transform:none!important;
  letter-spacing:0!important;
}

/* Correção principal do print: o ::before do label global NÃO entra nas linhas do dropdown. */
body.evpl-pro .field.has-value .ms332-menu label::before,
body.evpl-pro .field.has-value .ms332-row::before,
body.evpl-pro .ms332-menu label::before,
body.evpl-pro .ms332-row::before{
  content:none!important;
  display:none!important;
  width:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
}
body.evpl-pro .ms332-menu label,
body.evpl-pro .ms332-row,
body.evpl-pro.evpl-refined .ms332-row{
  width:100%!important;
  min-height:31px!important;
  height:31px!important;
  display:grid!important;
  grid-template-columns:18px minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
  margin:1px 0!important;
  padding:0 8px!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#1f2937!important;
  font-size:12px!important;
  font-weight:760!important;
  line-height:1!important;
  text-align:left!important;
  box-shadow:none!important;
  cursor:pointer!important;
  overflow:hidden!important;
}
body.evpl-pro .ms332-row:hover{background:#f3f6fb!important;color:#111827!important;}
body.evpl-pro .ms332-row.is-checked,
body.evpl-pro .ms332-row:has(input:checked){
  background:#fff4df!important;
  color:#111827!important;
  box-shadow:inset 3px 0 0 rgba(184,15,26,.82)!important;
}
body.evpl-pro .ms332-row input[type="checkbox"]{
  grid-column:1!important;
  width:14px!important;
  height:14px!important;
  min-width:14px!important;
  max-width:14px!important;
  min-height:14px!important;
  max-height:14px!important;
  padding:0!important;
  margin:0!important;
  border-radius:4px!important;
  accent-color:var(--evpl-final-red)!important;
  box-shadow:none!important;
  justify-self:center!important;
}
body.evpl-pro .ms332-row span{
  grid-column:2!important;
  min-width:0!important;
  display:block!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  color:inherit!important;
  font:inherit!important;
  line-height:31px!important;
}
body.evpl-pro .ms332-search-wrap,
body.evpl-pro .ms332-toolbar{
  position:sticky!important;
  z-index:3!important;
  background:#fff!important;
}
body.evpl-pro .ms332-search-wrap{top:-8px!important;padding:0 0 7px!important;}
body.evpl-pro .ms332-search{
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  border:1px solid #d9e2ee!important;
  border-radius:10px!important;
  background:#f8fafd!important;
  color:#1d2939!important;
  padding:0 10px!important;
  font-size:12px!important;
  font-weight:720!important;
  box-shadow:none!important;
}
body.evpl-pro .ms332-toolbar{
  top:30px!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  padding:0 0 7px!important;
  margin-bottom:5px!important;
  border-bottom:1px solid #edf1f7!important;
}
body.evpl-pro .ms332-toolbar button{
  height:25px!important;
  min-height:25px!important;
  padding:0 8px!important;
  border:1px solid #d8e1ed!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#475467!important;
  font-size:10px!important;
  font-weight:850!important;
  box-shadow:none!important;
}
body.evpl-pro .ms332-toolbar .ms332-count{
  margin-left:auto!important;
  height:25px!important;
  display:inline-flex!important;
  align-items:center!important;
  padding:0 8px!important;
  border-radius:999px!important;
  background:#f2f5fa!important;
  color:#667085!important;
  font-size:10px!important;
  font-weight:850!important;
  white-space:nowrap!important;
}
body.evpl-pro .ms332-actions{
  position:sticky!important;
  bottom:-8px!important;
  display:flex!important;
  justify-content:flex-end!important;
  gap:6px!important;
  margin:7px -2px -2px!important;
  padding:7px 2px 2px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.9),#fff 48%)!important;
  border-top:1px solid #edf1f7!important;
}
body.evpl-pro .ms332-actions .btn{
  height:28px!important;
  min-height:28px!important;
  padding:0 10px!important;
  border-radius:9px!important;
  font-size:10.5px!important;
  font-weight:880!important;
  box-shadow:none!important;
}
body.evpl-pro .ms332-actions .btn.clear{background:#fff!important;color:#344054!important;border-color:#d5deea!important;}
body.evpl-pro .ms332-actions .btn.apply{background:var(--evpl-final-red)!important;color:#fff!important;border-color:var(--evpl-final-red)!important;}

/* Tabela: leitura mais séria, sem brilho excessivo. */
body.evpl-pro .table-wrap,
body.evpl-pro .cards-wrap{
  border-color:#dfe7f1!important;
  box-shadow:0 13px 34px rgba(15,23,42,.075)!important;
  border-radius:16px!important;
}
body.evpl-pro thead th,
body.evpl-pro th{
  background:linear-gradient(180deg,#1b273b,#111a2a)!important;
  color:#fff!important;
  padding:8px 10px!important;
  font-size:9.7px!important;
  letter-spacing:.045em!important;
}
body.evpl-pro tbody td{
  padding:7px 9px!important;
  border-color:#e9eef5!important;
  color:#1f2937!important;
}
body.evpl-pro tbody tr:hover td{background:#f8fafc!important;color:#111827!important;}
body.evpl-pro tfoot td{background:#f4f7fb!important;color:#111827!important;border-top:1px solid #d7e0ec!important;}

/* Mobile: dropdown vira bandeja inferior organizada. */
@media (max-width:760px){
  body.evpl-pro .btns{width:100%!important;justify-content:stretch!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.evpl-pro .btns > button,
  body.evpl-pro .btns > .btn,
  body.evpl-pro .btns > .apply-btn{max-width:none!important;width:100%!important;min-width:0!important;}
  body.evpl-pro .field.wide{grid-column:1/-1!important;min-width:0!important;}
  body.evpl-pro .ms332-menu{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    top:auto!important;
    bottom:68px!important;
    width:auto!important;
    max-width:none!important;
    max-height:50dvh!important;
    border-radius:16px!important;
  }
}
@media print{
  body.evpl-pro .ms332-menu,
  body.evpl-pro #evplProDrawer,
  body.evpl-pro #evplProDrawerBtn{display:none!important;}
}
