/* EVPL PRO.22 - Layout Premium Compacto e profissional
   Corrige excesso de espaço, filtros altos e barra de gestão invasiva. */
:root{
  --evpl16-bg:#f5f7fb;
  --evpl16-ink:#162033;
  --evpl16-muted:#667085;
  --evpl16-line:#dbe3ef;
  --evpl16-line2:#edf1f7;
  --evpl16-red:#c5121c;
  --evpl16-red2:#ef4444;
  --evpl16-gold:#f6b51c;
  --evpl16-navy:#172033;
  --evpl16-navy2:#101828;
  --evpl16-shadow:0 14px 36px rgba(15,23,42,.08);
  --evpl16-shadow-sm:0 7px 18px rgba(15,23,42,.055);
  --evpl16-used:315px;
}
html,body{background:var(--evpl16-bg)!important;color:var(--evpl16-ink)!important;}
body.evpl-pro.evpl-pro20-ui{overflow:auto!important;}

/* Cabeçalho mais executivo e menos alto */
body.evpl-pro.evpl-pro20-ui .app-header{
  min-height:64px!important;
  padding:10px 16px!important;
  display:grid!important;
  grid-template-columns:minmax(260px,1fr) auto!important;
  gap:14px!important;
  align-items:center!important;
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
  color:var(--evpl16-ink)!important;
  border-bottom:1px solid var(--evpl16-line)!important;
  box-shadow:0 8px 26px rgba(15,23,42,.055)!important;
}
body.evpl-pro.evpl-pro20-ui .app-header .left{gap:10px!important;align-items:center!important;}
body.evpl-pro.evpl-pro20-ui .app-header .logo{width:42px!important;height:42px!important;border-radius:14px!important;box-shadow:0 8px 18px rgba(15,23,42,.10)!important;}
body.evpl-pro.evpl-pro20-ui .app-header .title h1{font-size:18px!important;line-height:1.05!important;letter-spacing:-.03em!important;color:var(--evpl16-ink)!important;margin:0!important;}
body.evpl-pro.evpl-pro20-ui .app-header small,
body.evpl-pro.evpl-pro20-ui .app-header .muted{color:#667085!important;font-size:11px!important;font-weight:750!important;}
body.evpl-pro.evpl-pro20-ui .right.top-meta{display:flex!important;flex-direction:column!important;align-items:flex-end!important;gap:6px!important;border-left:1px solid #e4eaf2!important;padding-left:16px!important;}
body.evpl-pro.evpl-pro20-ui .top-meta small{font-size:10.5px!important;color:#53637a!important;font-weight:850!important;white-space:nowrap!important;}
body.evpl-pro.evpl-pro20-ui .btns{display:flex!important;gap:6px!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:wrap!important;}
body.evpl-pro.evpl-pro20-ui button,
body.evpl-pro.evpl-pro20-ui .btn,
body.evpl-pro.evpl-pro20-ui .apply-btn{
  height:32px!important;min-height:32px!important;min-width:0!important;
  padding:0 12px!important;border-radius:11px!important;
  font-size:11px!important;font-weight:920!important;letter-spacing:-.01em!important;
  box-shadow:none!important;line-height:1!important;white-space:nowrap!important;
}
body.evpl-pro.evpl-pro20-ui .apply-btn{background:linear-gradient(180deg,var(--evpl16-red2),var(--evpl16-red))!important;color:#fff!important;border-color:var(--evpl16-red)!important;}
body.evpl-pro.evpl-pro20-ui .btn:not(.ghost){background:var(--evpl16-navy)!important;color:#fff!important;border-color:var(--evpl16-navy)!important;}
body.evpl-pro.evpl-pro20-ui .btn.ghost{background:#fff!important;color:#26354d!important;border-color:var(--evpl16-line)!important;}
body.evpl-pro.evpl-pro20-ui button:hover,
body.evpl-pro.evpl-pro20-ui .btn:hover,
body.evpl-pro.evpl-pro20-ui .apply-btn:hover{transform:translateY(-1px)!important;box-shadow:0 8px 18px rgba(15,23,42,.12)!important;}

/* Abas compactas */
body.evpl-pro.evpl-pro20-ui .tabs{
  position:relative!important;top:auto!important;z-index:30!important;
  min-height:44px!important;padding:7px 10px!important;gap:6px!important;
  background:linear-gradient(180deg,#172033,#111827)!important;border:0!important;border-radius:0 0 12px 12px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.12)!important;
}
body.evpl-pro.evpl-pro20-ui .tab{
  height:30px!important;min-height:30px!important;border-radius:10px!important;padding:0 12px!important;
  background:rgba(255,255,255,.06)!important;color:#dbeafe!important;border:1px solid rgba(255,255,255,.12)!important;
  font-size:11px!important;font-weight:900!important;
}
body.evpl-pro.evpl-pro20-ui .tab.active{
  background:#fff!important;color:#101828!important;border-color:#fff!important;
  box-shadow:0 8px 18px rgba(0,0,0,.18)!important;
}
body.evpl-pro.evpl-pro20-ui .tab.active::after{
  content:"";position:absolute;left:18px;right:18px;bottom:-7px;height:3px;border-radius:999px;background:linear-gradient(90deg,var(--evpl16-red),var(--evpl16-gold));
}

/* Painel gerencial enxuto */
body.evpl-pro.evpl-pro20-ui #evplProDashboard{
  margin:10px 16px 8px!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;
}
body.evpl-pro.evpl-pro20-ui .pro-card{
  min-height:56px!important;padding:10px 12px!important;border-radius:16px!important;
  background:#fff!important;border:1px solid var(--evpl16-line)!important;box-shadow:var(--evpl16-shadow-sm)!important;overflow:hidden!important;
}
body.evpl-pro.evpl-pro20-ui .pro-card::after{width:42px!important;height:42px!important;right:-16px!important;top:-18px!important;opacity:.16!important;}
body.evpl-pro.evpl-pro20-ui .pro-label{font-size:9.5px!important;letter-spacing:.08em!important;margin-bottom:4px!important;color:#667085!important;}
body.evpl-pro.evpl-pro20-ui .pro-value{font-size:17px!important;line-height:1.05!important;color:#172033!important;}
body.evpl-pro.evpl-pro20-ui .pro-note{font-size:10.5px!important;margin-top:3px!important;color:#667085!important;}

/* Cabeçalho dos filtros */
body.evpl-pro.evpl-pro20-ui #evplProFilterHead{
  margin:8px 16px 0!important;
  min-height:40px!important;padding:6px 8px 6px 12px!important;
  border:1px solid var(--evpl16-line)!important;border-radius:14px 14px 0 0!important;
  background:#fff!important;box-shadow:var(--evpl16-shadow-sm)!important;
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
}
body.evpl-pro.evpl-pro20-ui .pro-filter-title{font-size:12px!important;font-weight:950!important;color:#172033!important;gap:8px!important;min-width:0!important;}
body.evpl-pro.evpl-pro20-ui .pro-filter-title .dot{width:7px!important;height:7px!important;box-shadow:0 0 0 4px rgba(197,18,28,.11)!important;}
body.evpl-pro.evpl-pro20-ui .pro-filter-actions{display:flex!important;gap:6px!important;align-items:center!important;flex-wrap:wrap!important;justify-content:flex-end!important;}
body.evpl-pro.evpl-pro20-ui .pro-filter-count,
body.evpl-pro.evpl-pro20-ui .pro-mini-btn{
  height:28px!important;min-height:28px!important;border-radius:999px!important;padding:0 10px!important;font-size:10.5px!important;font-weight:900!important;
  background:#f8fafc!important;color:#344054!important;border:1px solid var(--evpl16-line)!important;box-shadow:none!important;
}

/* Pager movido para a barra do filtro */
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls{display:flex!important;align-items:center!important;gap:6px!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls .field.tiny{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;width:auto!important;min-width:0!important;margin:0!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls .field.tiny>label{display:none!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls .pager{height:28px!important;display:grid!important;grid-template-columns:28px auto 28px!important;gap:4px!important;align-items:center!important;background:#f8fafc!important;border:1px solid var(--evpl16-line)!important;border-radius:999px!important;padding:2px!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls .pager .btn{height:24px!important;min-height:24px!important;width:24px!important;border-radius:999px!important;padding:0!important;background:#fff!important;color:#172033!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls #pageLabel{min-width:36px!important;text-align:center!important;font-size:10.5px!important;font-weight:950!important;color:#172033!important;}
body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls #pageSize{width:72px!important;height:28px!important;min-height:28px!important;border-radius:999px!important;font-size:10.5px!important;background:#fff!important;}

/* Filtros: sem espaço vazio e sem bloco gigante */
body.evpl-pro.evpl-pro20-ui .filters{
  position:relative!important;top:auto!important;z-index:50!important;
  display:block!important;margin:0 16px 8px!important;padding:10px!important;
  height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
  background:#fff!important;border:1px solid var(--evpl16-line)!important;border-top:0!important;border-radius:0 0 14px 14px!important;
  box-shadow:0 11px 26px rgba(15,23,42,.055)!important;
}
body.evpl-pro.evpl-pro20-ui .filters > .field.tiny{display:none!important;}
body.evpl-pro.evpl-pro20-ui .filter-group{display:none!important;min-height:0!important;margin:0!important;padding:0!important;}
body.evpl-pro.evpl-pro20-ui .filter-group.active{
  display:grid!important;
  grid-template-columns:minmax(230px,1.55fr) repeat(auto-fit,minmax(140px,1fr))!important;
  gap:8px!important;align-items:end!important;
  min-height:0!important;height:auto!important;padding:0!important;margin:0!important;
}
body.evpl-pro.evpl-pro20-ui .filter-group.active::after{display:none!important;content:none!important;}
body.evpl-pro.evpl-pro20-ui .filter-group.active .field{display:flex!important;flex-direction:column!important;gap:4px!important;min-width:0!important;margin:0!important;}
body.evpl-pro.evpl-pro20-ui .filter-group.active .field.wide{grid-column:span 2!important;min-width:220px!important;}
body.evpl-pro.evpl-pro20-ui .filter-group.active .filter-chips{
  grid-column:1 / -1!important;display:flex!important;gap:5px!important;flex-wrap:wrap!important;align-items:center!important;
  min-height:0!important;margin:0!important;padding:0!important;
}
body.evpl-pro.evpl-pro20-ui .filter-chips.chips-empty,
body.evpl-pro.evpl-pro20-ui .filter-chip-empty{display:none!important;}
body.evpl-pro.evpl-pro20-ui .field > label{
  color:#5f6f87!important;font-size:9px!important;font-weight:950!important;letter-spacing:.08em!important;text-transform:uppercase!important;line-height:1!important;margin:0!important;
}
body.evpl-pro.evpl-pro20-ui .field.has-value > label::before{display:none!important;content:none!important;}
body.evpl-pro.evpl-pro20-ui .field.has-value > label{color:var(--evpl16-red)!important;}
body.evpl-pro.evpl-pro20-ui .field input,
body.evpl-pro.evpl-pro20-ui .field select,
body.evpl-pro.evpl-pro20-ui .field .ms332-head{
  height:34px!important;min-height:34px!important;border-radius:11px!important;border:1px solid #d4deeb!important;background:#fff!important;color:#172033!important;
  padding:0 10px!important;font-size:11px!important;font-weight:850!important;box-shadow:none!important;
}
body.evpl-pro.evpl-pro20-ui .field input:focus,
body.evpl-pro.evpl-pro20-ui .field select:focus,
body.evpl-pro.evpl-pro20-ui .field .ms332-head:focus{
  border-color:rgba(197,18,28,.55)!important;box-shadow:0 0 0 3px rgba(197,18,28,.11)!important;
}
body.evpl-pro.evpl-pro20-ui .field.evpl-bf-field label::before{display:none!important;content:none!important;}
body.evpl-pro.evpl-pro20-ui .field.evpl-bf-field select{background:linear-gradient(180deg,#fff,#fffaf4)!important;border-color:#efc99d!important;color:#7c2d12!important;}

/* Multiselect menus mais limpos */
body.evpl-pro.evpl-pro20-ui .ms332{position:relative!important;min-width:0!important;}
body.evpl-pro.evpl-pro20-ui .ms332-chip{height:22px!important;max-width:110px!important;font-size:10px!important;padding:0 6px!important;}
body.evpl-pro.evpl-pro20-ui .ms332-menu{
  z-index:9999!important;min-width:min(320px,86vw)!important;max-height:min(330px,64vh)!important;border-radius:14px!important;
  border:1px solid var(--evpl16-line)!important;box-shadow:0 20px 64px rgba(15,23,42,.20)!important;
}
body.evpl-pro.evpl-pro20-ui .ms332-row{min-height:29px!important;height:29px!important;padding:5px 7px!important;font-size:11px!important;line-height:1!important;}
body.evpl-pro.evpl-pro20-ui .ms332-row input[type="checkbox"]{width:14px!important;height:14px!important;min-height:14px!important;flex:0 0 14px!important;accent-color:var(--evpl16-red)!important;}
body.evpl-pro.evpl-pro20-ui .ms332-actions{padding-top:7px!important;gap:6px!important;}
body.evpl-pro.evpl-pro20-ui .ms332-actions button{height:28px!important;min-height:28px!important;font-size:10.5px!important;}

/* Conteúdo e tabela usando mais tela */
body.evpl-pro.evpl-pro20-ui main{padding:0 16px 54px!important;}
body.evpl-pro.evpl-pro20-ui .empty{margin:8px 0!important;padding:11px 14px!important;border-radius:14px!important;background:#fff!important;border:1px dashed #cbd6e4!important;color:#667085!important;box-shadow:none!important;}
body.evpl-pro.evpl-pro20-ui .kpi-bar{gap:8px!important;margin:0 0 8px!important;padding:0!important;}
body.evpl-pro.evpl-pro20-ui .kpi,
body.evpl-pro.evpl-pro20-ui .kpi-card,
body.evpl-pro.evpl-pro20-ui .kpi-item{padding:9px 10px!important;border-radius:14px!important;box-shadow:var(--evpl16-shadow-sm)!important;}
body.evpl-pro.evpl-pro20-ui .table-wrap,
body.evpl-pro.evpl-pro20-ui .cards-wrap{
  height:calc(100dvh - var(--evpl16-used, 315px))!important;
  min-height:380px!important;max-height:none!important;
  margin:0!important;border-radius:14px!important;border:1px solid var(--evpl16-line)!important;background:#fff!important;
  box-shadow:var(--evpl16-shadow)!important;overflow:auto!important;
}
body.evpl-pro.evpl-pro20-ui table{font-size:11.5px!important;}
body.evpl-pro.evpl-pro20-ui thead th,
body.evpl-pro.evpl-pro20-ui th{padding:7px 9px!important;font-size:9.6px!important;background:linear-gradient(180deg,#1a2639,#111827)!important;color:#fff!important;}
body.evpl-pro.evpl-pro20-ui tbody td{padding:6px 8px!important;font-size:11px!important;border-color:#e8edf5!important;}
body.evpl-pro.evpl-pro20-ui tbody tr:nth-child(odd) td{background:#fbfcfe!important;}
body.evpl-pro.evpl-pro20-ui tbody tr:nth-child(even) td{background:#fff!important;}
body.evpl-pro.evpl-pro20-ui tbody tr:hover td{background:#fff8de!important;}
body.evpl-pro.evpl-pro20-ui tfoot td{padding:7px 8px!important;background:#f7f9fc!important;color:#101828!important;border-top:1px solid var(--evpl16-line)!important;}
body.evpl-pro.evpl-pro20-ui td:nth-child(2){min-width:280px!important;max-width:520px!important;}

/* Gestão PRO discreta, não ocupa a largura toda */
body.evpl-pro.evpl-pro20-ui #evplProDrawerBtn{
  left:auto!important;right:16px!important;bottom:14px!important;width:auto!important;min-width:126px!important;max-width:180px!important;
  height:36px!important;min-height:36px!important;padding:0 14px!important;border-radius:999px!important;
  background:linear-gradient(180deg,#172033,#101828)!important;color:#fff!important;font-size:11px!important;font-weight:950!important;
  box-shadow:0 12px 28px rgba(16,24,40,.24)!important;border:1px solid rgba(255,255,255,.12)!important;
}
body.evpl-pro.evpl-pro20-ui #evplProDrawer{left:auto!important;right:16px!important;bottom:58px!important;width:min(390px,calc(100vw - 32px))!important;border-radius:16px!important;}
body.evpl-pro.evpl-pro20-ui #pagerBottom{right:156px!important;bottom:14px!important;height:36px!important;padding:4px!important;}
body.evpl-pro.evpl-pro20-ui #scrollTop,
body.evpl-pro.evpl-pro20-ui .scroll-top,
body.evpl-pro.evpl-pro20-ui #btnTop{right:16px!important;bottom:58px!important;width:36px!important;height:36px!important;min-height:36px!important;}
body.evpl-pro.evpl-pro20-ui #evplPro14Panel{bottom:58px!important;}

@media(max-width:1280px){
  body.evpl-pro.evpl-pro20-ui #evplProDashboard{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.evpl-pro.evpl-pro20-ui .filter-group.active{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;}
  body.evpl-pro.evpl-pro20-ui .filter-group.active .field.wide{grid-column:1/-1!important;}
}
@media(max-width:760px){
  body.evpl-pro.evpl-pro20-ui .app-header{grid-template-columns:1fr!important;padding:10px!important;}
  body.evpl-pro.evpl-pro20-ui .right.top-meta{align-items:stretch!important;border-left:0!important;padding-left:0!important;}
  body.evpl-pro.evpl-pro20-ui .top-meta small{white-space:normal!important;}
  body.evpl-pro.evpl-pro20-ui .btns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.evpl-pro.evpl-pro20-ui #evplProDashboard{grid-template-columns:1fr!important;margin:8px!important;}
  body.evpl-pro.evpl-pro20-ui #evplProFilterHead{margin:8px 8px 0!important;align-items:flex-start!important;flex-direction:column!important;}
  body.evpl-pro.evpl-pro20-ui .filters{margin:0 8px 8px!important;}
  body.evpl-pro.evpl-pro20-ui .filter-group.active{grid-template-columns:1fr!important;}
  body.evpl-pro.evpl-pro20-ui .filter-group.active .field.wide{grid-column:1/-1!important;min-width:0!important;}
  body.evpl-pro.evpl-pro20-ui main{padding:0 8px 56px!important;}
  body.evpl-pro.evpl-pro20-ui .table-wrap{min-height:360px!important;}
  body.evpl-pro.evpl-pro20-ui #evplPro16PagerControls{width:100%!important;justify-content:space-between!important;}
}
@media print{
  body.evpl-pro.evpl-pro20-ui #evplProDashboard,
  body.evpl-pro.evpl-pro20-ui #evplProFilterHead,
  body.evpl-pro.evpl-pro20-ui .filters,
  body.evpl-pro.evpl-pro20-ui #evplProDrawerBtn,
  body.evpl-pro.evpl-pro20-ui #evplProDrawer{display:none!important;}
  body.evpl-pro.evpl-pro20-ui .table-wrap{height:auto!important;overflow:visible!important;box-shadow:none!important;}
}
