
.cadastro-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cadastro-filters select{padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;min-width:150px}
.cadastro-grid td,.cadastro-grid th{vertical-align:middle}
.cadastro-grid .mono{font-family:Consolas,monospace;font-size:12px}
.cadastro-grid .nowrap{white-space:nowrap}
.modalbox.wide{width:min(980px,100%)}
.lookup-wrap{display:flex;align-items:stretch;gap:6px}.lookup-wrap input{flex:1;min-width:0}.lookup-btn{width:42px;min-width:42px;border:1px solid var(--line);background:#fff;border-radius:9px;color:var(--navy);font-size:20px;font-weight:800;cursor:pointer}.lookup-btn:hover{background:var(--pale)}

/* Padrão dos grids de cadastro */
.cadastro-card{display:flex;flex-direction:column;min-height:0}
.cadastro-toolbar{
  position:sticky;
  top:72px;
  z-index:12;
  background:#fff;
}
.cadastro-tablewrap{
  overflow-x:auto;
  overflow-y:visible;
  position:relative;
}
.cadastro-grid thead th{
  
  
  z-index:10;
  background:#fafbfc;
  box-shadow:0 1px 0 var(--line);
}
.cadastro-pager{
  position:relative;
  z-index:11;
  background:#fff;
  gap:14px;
}
.cadastro-pager,.pager-left,.pager-right{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.pager-left,.pager-right{gap:10px;flex-wrap:wrap}
.pager-left label{display:flex;align-items:center;gap:7px}
.pager-left select{
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.pager-btn{padding:7px 10px}
.pager-btn:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){
  .cadastro-toolbar{top:72px}
  .cadastro-pager{align-items:flex-start;flex-direction:column}
}

/* O grid mantém visualmente 10 linhas mesmo quando não há registros. */
.cadastro-grid tbody tr{height:44px}
.cadastro-grid tbody tr.cad-placeholder td{
  height:44px;
  color:transparent;
  pointer-events:none;
  background:#fff;
}
.cadastro-grid tbody tr.cad-placeholder:last-child td{
  border-bottom:0;
}

/* Cabeçalho do grid: sempre imediatamente acima da primeira linha. */
.cadastro-grid thead{
  display:table-header-group;
}
.cadastro-grid thead th{
  position:relative !important;
  top:auto !important;
  background:#dbe7f3 !important;
  color:#17324d !important;
  font-weight:700 !important;
  border-top:1px solid #c2d2e2 !important;
  border-bottom:1px solid #aebfd0 !important;
  height:42px;
  vertical-align:middle;
}
.cadastro-grid tbody tr{
  height:44px;
}

/* Correção definitiva do fluxo visual do cadastro */
.cadastro-toolbar{
  position:relative !important;
  top:auto !important;
  z-index:2 !important;
  background:#fff !important;
}
.cadastro-tablewrap{
  position:relative !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
}
.cadastro-grid{
  margin-top:0 !important;
}
.cadastro-grid thead{
  display:table-header-group !important;
}
.cadastro-grid thead th{
  position:static !important;
  top:auto !important;
  background:#c8d9ea !important;
  color:#17324d !important;
  font-weight:700 !important;
  height:42px !important;
  vertical-align:middle !important;
  border-top:1px solid #afc3d7 !important;
  border-bottom:1px solid #96aec5 !important;
}

/* Navegação: resposta visual imediata enquanto os dados são carregados */
.cadastro-loading{
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
  padding:24px;
}
.cad-loading-line{
  height:4px;
  width:100%;
  border-radius:4px;
  background:linear-gradient(90deg,#dbe7f3 0%,#0d3a63 50%,#dbe7f3 100%);
  background-size:200% 100%;
  animation:mmxLoading 1s linear infinite;
}
.cad-loading-text{font-size:13px;color:#61758a}
@keyframes mmxLoading{from{background-position:100% 0}to{background-position:-100% 0}}

/* Botão de consulta CNPJ/CEP */
.lookup-btn{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:16px !important;
}

.cad-loading-line,.cad-loading-text,.cadastro-loading{display:none!important}


/* Padrão MMX OS: todos os cabeçalhos dos grids na mesma cor */
.tablewrap table thead th,
.cadastro-grid thead th{
  background:#062d55 !important;
  color:#ffffff !important;
  border-top:1px solid #062d55 !important;
  border-bottom:1px solid #062d55 !important;
  font-weight:800 !important;
}
.wrapcell{white-space:normal!important;min-width:220px;line-height:1.35}
.module-tabs{display:flex;gap:4px;padding:12px 18px 0;background:#fff;border-bottom:1px solid var(--line)}
.module-tabs button{border:0;background:transparent;padding:10px 14px;font-weight:800;color:var(--muted);border-bottom:3px solid transparent}
.module-tabs button.active{color:var(--navy);border-bottom-color:var(--navy)}
.form-section{margin:18px 0 12px;padding-top:14px;border-top:1px solid var(--line);font-size:12px;font-weight:900;color:var(--navy)}
.supplier-form .field textarea{min-height:85px}


/* MMX OS - grade com cabecalho fixo ao exibir 20/50/100 registros */
.tablewrap.mmx-scroll-grid,
.cadastro-tablewrap.mmx-scroll-grid{
  max-height:560px !important;
  overflow-y:auto !important;
  overflow-x:auto !important;
  scrollbar-gutter:stable;
}
.tablewrap.mmx-scroll-grid table thead th,
.cadastro-tablewrap.mmx-scroll-grid .cadastro-grid thead th{
  position:sticky !important;
  top:0 !important;
  z-index:30 !important;
  background:#062d55 !important;
  color:#fff !important;
  box-shadow:0 1px 0 #062d55;
}
.tablewrap.mmx-scroll-grid::-webkit-scrollbar,
.cadastro-tablewrap.mmx-scroll-grid::-webkit-scrollbar{width:12px;height:12px}
.tablewrap.mmx-scroll-grid::-webkit-scrollbar-thumb,
.cadastro-tablewrap.mmx-scroll-grid::-webkit-scrollbar-thumb{background:#a8b7c6;border-radius:8px;border:3px solid #f5f7f9}
.tablewrap.mmx-scroll-grid::-webkit-scrollbar-track,
.cadastro-tablewrap.mmx-scroll-grid::-webkit-scrollbar-track{background:#f5f7f9}

/* Mensagens proprias do MMX OS */
.mmx-dialog-text{font-size:14px;line-height:1.55;color:#33485d;white-space:pre-line}
.mmx-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.mmx-dialog-warning{padding:12px 14px;border-radius:9px;background:#fff6f6;color:#9d2020;border:1px solid #f3c9c9;margin-top:12px}
