/* Seller Ecom - Mercado Livre — Gerenciamento de Ads (migracao 019). Mesmo padrao visual da tela Desempenho (azul #10243e,
   bordas #365573, destaque dourado #d6a52b). Tudo sob #ml-ads / #mlaProductPicker (nao afeta outras telas). */
#ml-ads h1{margin:0 0 18px}
/* cabecalho (16/10): titulo a esquerda; filtro global no canto superior direito e, logo abaixo, (16/10: sem botao extra)
   (mesmo arranjo do "+ Novo produto" em Produtos e do "Configuracoes" da Central) */
#ml-ads > .mla-head{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"titulo filtro";align-items:start;column-gap:20px;row-gap:10px;margin:0 0 18px}
#ml-ads > .mla-head > h1{grid-area:titulo;margin:0}
#ml-ads > .mla-head > .sefg-head-slot{grid-area:filtro}
@media(max-width:720px){
  #ml-ads > .mla-head{grid-template-columns:minmax(0,1fr);grid-template-areas:"titulo" "filtro"}
  #ml-ads > .mla-head > .sefg-head-slot{margin:0!important}
}
#ml-ads .mla-toolbar{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;align-items:end;margin-bottom:14px}
#ml-ads .mla-toolbar label{display:block;color:#a9b8cc;font-size:11px;font-weight:800;text-transform:uppercase;margin:0 0 7px 2px}
#ml-ads .mla-toolbar select{width:100%;height:46px;box-sizing:border-box;border-radius:12px;background:#10243e;border:1px solid #365573;color:#fff;padding:0 12px;font-size:14px;font-weight:600;outline:none}
#ml-ads .mla-toolbar select:hover,#ml-ads .mla-toolbar select:focus{border-color:#d6a52b}
#ml-ads .mla-product-toggle{width:100%;height:46px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:10px;border-radius:12px;background:#10243e;border:1px solid #365573;color:#fff;padding:0 14px;font-size:14px;font-weight:600;cursor:pointer;text-align:left}
#ml-ads .mla-product-toggle span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ml-ads .mla-product-toggle:hover,#ml-ads .mla-product-toggle:focus-visible{border-color:#d6a52b;outline:none}
#ml-ads .mla-product-toggle.mla-has-selection{border-color:#d6a52b;color:#f0cc69}
#mlaProductPicker .mla-product-picker-info{display:flex;justify-content:space-between;gap:10px;color:#aebdd1;font-size:12px;font-weight:700}
#mlaProductPicker #mlaProductPickerCount{color:#f0cc69}
/* parametros por conta */
#ml-ads .mla-params{background:#0d1f36;border:1px solid #2e435b;border-radius:14px;margin:0 0 16px;padding:0}
#ml-ads .mla-params summary{cursor:pointer;list-style:none;padding:12px 16px;display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;color:#d8e2ee;font-weight:800;font-size:13px}
#ml-ads .mla-params summary::-webkit-details-marker{display:none}
#ml-ads .mla-params summary::before{content:'▸';color:#d6a52b}
#ml-ads .mla-params[open] summary::before{content:'▾'}
#ml-ads .mla-params summary span{color:#9eacbd;font-weight:600;font-size:12px}
#ml-ads .mla-params-body{padding:0 16px 14px}
#ml-ads .mla-params-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px}
#ml-ads .mla-params-grid label{display:block;color:#a9b8cc;font-size:11px;font-weight:800;text-transform:uppercase;margin:0 0 6px 2px}
#ml-ads .mla-params-grid small{display:block;color:#8291a5;font-size:11px;margin-top:5px;line-height:1.35}
#ml-ads .mla-params-grid input{width:100%;height:42px;box-sizing:border-box;border-radius:10px;background:#10243e;border:1px solid #365573;color:#fff;padding:0 12px;font-size:14px;font-weight:700}
#ml-ads .mla-params-grid input:disabled{opacity:.7;cursor:not-allowed}
#ml-ads .mla-params-grid input.mla-invalid{border-color:#ff7373}
#ml-ads .mla-params-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
#ml-ads .mla-params-actions button{height:38px;border-radius:10px;border:1px solid #3b5068;background:#10243e;color:#d8e2ee;padding:0 16px;font-weight:800;cursor:pointer}
#ml-ads .mla-params-actions button.primary{background:linear-gradient(135deg,#e8c66a,#c9972b);color:#101827;border-color:#c9972b}
#ml-ads .mla-params-actions span{color:#9eacbd;font-size:12px}
#ml-ads #mlaParamsMsg{color:#f0cc69}
/* cards */
#ml-ads .mla-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 0 14px}
#ml-ads .mla-kpi{background:#10243e;border:1px solid #2e435b;border-radius:14px;padding:14px 16px;min-width:0}
#ml-ads .mla-kpi span{display:block;color:#aebed1;font-size:11px;font-weight:700;text-transform:uppercase}
#ml-ads .mla-kpi strong{display:block;color:#fff;font-size:21px;margin-top:6px}
#ml-ads .mla-kpi small{display:block;color:#8f9db0;font-size:11px;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* classificacao */
#ml-ads .mla-c-loss{color:#ff8a8a;background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.35)}
#ml-ads .mla-c-low{color:#ffd166;background:rgba(234,179,8,.12);border-color:rgba(234,179,8,.38)}
#ml-ads .mla-c-ok{color:#5fd49b;background:rgba(34,197,94,.10);border-color:rgba(34,197,94,.30)}
#ml-ads .mla-badge{display:inline-block;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:900;border:1px solid transparent;white-space:nowrap}
/* tabela */
#ml-ads .mla-section .section-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 14px}
#ml-ads .mla-hint{color:#9eacbd;font-size:11px}
/* 14/10: a tabela cabe na largura da tela (sem barra de rolagem horizontal da pagina); colunas em %, numeros podem quebrar
   linha. Abaixo de 1100 px a rolagem fica so dentro do quadro da tabela. */
#ml-ads,#ml-ads .mla-section{max-width:100%;min-width:0}
#ml-ads .mla-table-wrap{overflow-x:auto;max-width:100%}
#ml-ads .mla-table{width:100%;table-layout:fixed;min-width:0}
#ml-ads .mla-table th{font-size:11px;white-space:normal;line-height:1.25;padding-left:6px;padding-right:6px}
#ml-ads .mla-table td{padding-left:6px;padding-right:6px}
/* 16/10: 11 colunas (Produto | Situacao | Receita | Qtd | Investimento | ACOS | ROAS | ACOS de equilibrio | Margem pos Ads | Impressoes | Status) */
#ml-ads .mla-table th:nth-child(1){width:22%}#ml-ads .mla-table th:nth-child(2){width:14%}
#ml-ads .mla-table th:nth-child(n+3){width:7.6%}#ml-ads .mla-table th:nth-child(5),#ml-ads .mla-table th:nth-child(6){width:6%}
#ml-ads .mla-table td{font-size:12px;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}
#ml-ads .mla-table td b{white-space:normal}
@media(max-width:1100px){#ml-ads .mla-table{min-width:1180px}}
#ml-ads .mla-table th[data-mla-sort]{cursor:pointer}
#ml-ads .mla-table th.mla-sorted{color:#f0cc69}
#ml-ads .mla-table td{vertical-align:top}
#ml-ads .mla-table td small{display:block;font-size:10px;color:#94a2b4;margin-top:3px;white-space:normal;overflow-wrap:anywhere}
#ml-ads .mla-product{display:flex;align-items:center;gap:9px;min-width:0}
#ml-ads .mla-product img{width:44px;height:44px;border-radius:7px;object-fit:contain;background:#fff;flex:none}
#ml-ads .mla-sub{padding-left:30px}
#ml-ads .mla-sub img{width:32px;height:32px}
#ml-ads .mla-noimg{width:44px;height:44px;flex:none;display:inline-flex;align-items:center;justify-content:center;color:#5d6f86}
#ml-ads .mla-product-info{min-width:0}
#ml-ads .mla-product-name{font-weight:800;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ml-ads .mla-product-name a{color:#fff;text-decoration:none}#ml-ads .mla-product-name a:hover{text-decoration:underline}
#ml-ads .mla-product-meta{font-size:10px;color:#94a2b4;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ml-ads .mla-toggle{flex:none;width:24px;height:24px;border-radius:6px;border:1px solid #3b5068;background:#10243e;color:#f0cc69;cursor:pointer;font-size:12px;line-height:1;padding:0}
#ml-ads tr.mla-open>td{background:rgba(214,165,43,.05)}
#ml-ads tr.mla-item>td{background:rgba(9,27,48,.65);font-size:12px}
#ml-ads .mla-neg{color:#ff7373!important}
#ml-ads .mla-warn{color:#f5c16c!important}
#ml-ads .mla-muted{color:#8291a5;font-size:12px}
#ml-ads .mla-st{font-weight:800;font-size:12px}
#ml-ads .mla-st-ativo{color:#5fd49b}#ml-ads .mla-st-pausado{color:#f5c16c}#ml-ads .mla-st-sem_anuncio{color:#8f9caf}#ml-ads .mla-st-em_espera{color:#f5c16c}#ml-ads .mla-st-sem_campanha{color:#8fb3d9}
#ml-ads .mla-empty{text-align:center!important;color:#93a1b3!important;padding:34px!important}
#ml-ads .mla-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 4px 2px;color:#9eacbd;font-size:12px}
#ml-ads .mla-pagination{display:flex;align-items:center;gap:9px}
#ml-ads .mla-pagination button{height:34px;border:1px solid #3b5068;background:#10243e;color:#d8e2ee;border-radius:8px;padding:0 12px;cursor:pointer}
#ml-ads .mla-pagination button:disabled{opacity:.4;cursor:default}
@media(max-width:1200px){#ml-ads .mla-toolbar{grid-template-columns:repeat(3,1fr)}#ml-ads .mla-params-grid{grid-template-columns:1fr 1fr}}
@media(max-width:640px){#ml-ads .mla-toolbar{grid-template-columns:1fr 1fr}#ml-ads .mla-toolbar .mla-products-field{grid-column:1/-1}#ml-ads .mla-kpis{grid-template-columns:1fr 1fr}#ml-ads .mla-kpi strong{font-size:18px}#ml-ads .mla-params-grid{grid-template-columns:1fr}#ml-ads .mla-footer{flex-direction:column;align-items:flex-start}}
@media(max-width:640px){#mlaProductPicker{padding:10px}#mlaProductPicker .stock-product-dialog{max-height:92vh;padding:12px}#mlaProductPicker .stock-product-options{min-height:180px}#mlaProductPicker .stock-product-dialog-actions{flex-wrap:wrap}#mlaProductPicker .stock-product-dialog-actions>div{display:flex;gap:8px;flex:1 1 100%}#mlaProductPicker .stock-product-dialog-actions>div button{flex:1;margin:0;padding:0 8px;white-space:nowrap;font-size:13px}#mlaProductPicker .stock-product-dialog-actions .primary{flex:1 1 100%}}
