/* ASN ERP V5.1.2 — premium-first UX para o assistente (Clean Premium / Dark Total).
   Somente apresentação e organização de tela: não altera integração, custos, permissões ou estoque. */
html[data-theme] body:has(.setup-content){--asn512-bg:var(--asn-canvas);--asn512-card:var(--asn-surface);--asn512-card-alt:var(--asn-surface-2);--asn512-border:var(--asn-line);--asn512-text:var(--asn-ink);--asn512-dim:var(--asn-muted);--asn512-accent:var(--asn-rose);--asn512-soft:var(--asn-rose-soft);--asn512-success:var(--asn-success)}
html[data-theme] body:has(.setup-content) .setup{max-width:1690px!important;padding-top:30px}
html[data-theme] body:has(.setup-content) .setup-content{grid-template-columns:245px minmax(0,1fr);gap:22px}
html[data-theme] body:has(.setup-content) .hero{padding:10px 0 27px}
html[data-theme] body:has(.setup-content) .hero h1{font-weight:830!important;font-size:clamp(28px,2.6vw,39px)!important}
html[data-theme] body:has(.setup-content) .hero>p:last-child{font-size:14px;max-width:920px}
html[data-theme] body:has(.setup-content) .stepnav{gap:6px!important}
html[data-theme] body:has(.setup-content) .stepitem{min-height:68px;gap:10px;padding:11px 12px!important;border-radius:13px!important}
html[data-theme] body:has(.setup-content) .stepitem strong{font-size:13px}
html[data-theme] body:has(.setup-content) .stepitem small{font-size:11px}
html[data-theme] body:has(.setup-content) .stepitem .num{width:35px;height:35px;flex:0 0 35px;font-size:14px}
html[data-theme] body:has(.setup-content) .card{padding:28px!important;border-radius:20px!important;box-shadow:var(--asn-shadow)!important}
html[data-theme] body:has(.setup-content) .heading{padding-bottom:22px;margin-bottom:25px;border-bottom:1px solid var(--asn512-border);gap:14px}
html[data-theme] body:has(.setup-content) .heading-icon{width:58px;height:58px;flex:0 0 58px;font-size:26px;border-radius:16px}
html[data-theme] body:has(.setup-content) .heading h2{font-size:clamp(23px,2vw,30px);font-weight:800}
html[data-theme] body:has(.setup-content) .heading p{font-size:13px;max-width:750px;line-height:1.65}
html[data-theme] body:has(.setup-content) .btn{border-radius:11px!important;font-weight:760}
html[data-theme] body:has(.setup-content) .btn:focus-visible{outline:3px solid var(--asn512-accent);outline-offset:2px}
html[data-theme] body:has(.setup-content) .page-footer{margin-top:30px}
/* Composição de etapa 4 */
html[data-theme] body[data-asn-stage="4"] #wizard-card{background:var(--asn512-card)!important}
.asn-v512-kicker{font-size:10px;line-height:1.3;color:var(--asn512-accent);letter-spacing:.12em;font-weight:850;display:block;margin-bottom:6px}
.asn-v512-sectionbar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin:3px 0 20px}
.asn-v512-sectionbar h3{font-size:19px;letter-spacing:-.03em;line-height:1.3;margin:0 0 5px;color:var(--asn512-text);font-weight:820}
.asn-v512-sectionbar p{font-size:12px;color:var(--asn512-dim);margin:0;line-height:1.55}
.asn-v512-status{border-radius:100px;padding:7px 11px;background:var(--asn512-card-alt);border:1px solid var(--asn512-border);font-size:11px;white-space:nowrap;color:var(--asn512-dim);font-weight:720}
.asn-v512-status span{color:var(--asn512-success)}
body[data-asn-stage="4"] .inline-choose{margin-bottom:18px;gap:7px}
body[data-asn-stage="4"] .inline-choose button{padding:9px 17px;border-radius:10px!important;min-height:38px;border:1px solid var(--asn512-border);font-weight:750;color:var(--asn512-dim);background:transparent}
body[data-asn-stage="4"] .inline-choose button[aria-pressed="true"]{background:var(--asn512-soft)!important;border-color:var(--asn512-accent)!important;color:var(--asn512-accent)!important}
.asn-v512-store-picker{background:var(--asn512-card-alt);border:1px solid var(--asn512-border);border-radius:14px;padding:12px 16px;display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:18px}
.asn-v512-store-picker .field{margin:0;flex:1;max-width:440px}
.asn-v512-store-picker .field label{font-size:11px;text-transform:uppercase;letter-spacing:.055em;color:var(--asn512-dim);margin-bottom:6px}
.asn-v512-store-picker select{min-height:41px;border-radius:9px!important;background:var(--asn512-card)!important}
.asn-v512-micro{font-size:11px;color:var(--asn512-dim);padding-bottom:10px}
.asn-v512-storegroup{border-radius:14px;background:var(--asn512-card-alt);padding:18px;border:1px solid var(--asn512-border);display:flex;flex-direction:column;gap:14px;margin-bottom:18px}
.asn-v512-storegroup strong{font-size:13px}.asn-v512-storegroup p{margin:3px 0 0;color:var(--asn512-dim);font-size:12px}
.asn-v512-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:5px 0 17px}
.asn-v512-metric{position:relative;min-height:122px;background:var(--asn512-card);border:1px solid var(--asn512-border);border-radius:15px;padding:17px 17px 15px;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between}
.asn-v512-metric:before{content:"";position:absolute;top:0;right:0;width:82px;height:82px;background:radial-gradient(circle at 100% 0%,rgba(243,55,112,.075),transparent 70%);pointer-events:none}
.asn-v512-metric-title{font-size:11px;font-weight:720;color:var(--asn512-dim)}
.asn-v512-metric strong{font-size:29px;line-height:1.05;letter-spacing:-.045em;font-variant-numeric:tabular-nums;color:var(--asn512-text)}
.asn-v512-metric.good strong{color:var(--asn512-success)}
.asn-v512-metric.attention strong{color:var(--asn512-accent)}
.asn-v512-metric-desc{font-size:10px;color:var(--asn512-dim);line-height:1.5}
.asn-v512-progress{border:1px solid var(--asn512-border);border-radius:15px;padding:19px 19px 21px;background:var(--asn512-card-alt);margin-bottom:21px}
.asn-v512-progress-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:14px}
.asn-v512-progress-title>div{display:flex;flex-direction:column;gap:2px}
.asn-v512-progress-title>div strong{font-size:13px;color:var(--asn512-text)}
.asn-v512-progress-title>div span{font-size:11px;color:var(--asn512-dim)}
.asn-v512-percent{font-size:25px;color:var(--asn512-accent);font-weight:860;font-variant-numeric:tabular-nums}
.asn-v512-progress-track{height:8px;border-radius:100px;background:var(--asn512-border);overflow:hidden}
.asn-v512-progress-track>span{display:block;height:100%;border-radius:100px;background:linear-gradient(90deg,#ef5c87,#d91650);transition:width .2s}
.asn-v512-alerts{border:1px solid var(--asn512-border);border-radius:15px;padding:16px;margin-bottom:21px}
.asn-v512-alert-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:13px}
.asn-v512-alert-head strong{font-size:13px}.asn-v512-alert-head>span{font-size:11px;color:var(--asn512-dim)}
.asn-v512-alert-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.asn-v512-alert-item{display:flex;align-items:center;gap:9px;min-width:0;border:1px solid var(--asn512-border);border-radius:10px;padding:11px;background:var(--asn512-card-alt);text-decoration:none;color:var(--asn512-text)!important;transition:transform .15s,border-color .15s}
.asn-v512-alert-item:hover{border-color:var(--asn512-accent);transform:translateY(-1px)}
.asn-v512-alert-item strong{font-size:17px;font-variant-numeric:tabular-nums}.asn-v512-alert-item span:not(.asn-v512-dot){font-size:11px;min-width:0}.asn-v512-alert-item small{margin-left:auto;color:var(--asn512-accent);font-size:10px;white-space:nowrap}
.asn-v512-dot{width:8px;height:8px;border-radius:99px;flex:0 0 8px}.asn-v512-dot.amber{background:#f0b54c}.asn-v512-dot.rose{background:#f03a6a}.asn-v512-dot.violet{background:#a782fa}
.asn-v512-commandbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:10px 0 21px;flex-wrap:wrap}
.asn-v512-commandbar h3{font-size:15px;margin:0 0 4px}.asn-v512-commandbar p{font-size:11px;color:var(--asn512-dim);margin:0;max-width:520px}
.asn-v512-inline-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.asn-v512-inline-actions .btn{min-height:42px;padding:10px 15px;font-size:11px}
.asn-v512-edit-panel{border:1px solid var(--asn512-border);border-radius:17px;overflow:hidden;background:var(--asn512-card);margin-top:18px}
.asn-v512-edit-head{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;padding:20px 20px 16px}
.asn-v512-edit-head h3{font-size:18px;letter-spacing:-.025em;margin:0 0 5px}.asn-v512-edit-head p{font-size:11px;color:var(--asn512-dim);margin:0;line-height:1.6}
.asn-v512-tag{display:inline-flex;padding:5px 9px;border-radius:100px;font-size:10px;font-weight:790;white-space:nowrap;background:var(--asn512-card-alt);border:1px solid var(--asn512-border);color:var(--asn512-dim)}
.asn-v512-tag.warn{color:var(--asn512-accent);background:var(--asn512-soft);border-color:transparent}
.asn-v512-table-toolbar{padding:11px 20px;background:var(--asn512-card-alt);display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid var(--asn512-border);border-bottom:1px solid var(--asn512-border)}
.asn-v512-search{position:relative;display:block;width:min(100%,350px)}
.asn-v512-search span{position:absolute;top:50%;left:12px;transform:translateY(-50%);font-size:21px;line-height:1;color:var(--asn512-dim)}
.asn-v512-search input{width:100%;min-height:40px;padding:9px 11px 9px 37px!important;border:1px solid var(--asn512-border)!important;background:var(--asn512-card)!important;border-radius:10px!important;color:var(--asn512-text)!important;font-size:12px}
.asn-v512-table-toolbar>span{color:var(--asn512-dim);font-size:11px}
body[data-asn-stage="4"] .asn-v512-products{overflow:auto;max-height:540px;scrollbar-width:thin}
body[data-asn-stage="4"] .asn-v512-products table{width:100%;min-width:610px;border-collapse:separate;border-spacing:0}
body[data-asn-stage="4"] .asn-v512-products thead th{background:var(--asn512-card-alt)!important;border-bottom:1px solid var(--asn512-border);font-size:10px;font-weight:820;color:var(--asn512-dim)!important;text-transform:uppercase;letter-spacing:.055em;position:sticky;top:0;z-index:1}
body[data-asn-stage="4"] .asn-v512-products :is(th,td){padding:13px 15px;border-bottom:1px solid var(--asn512-border)}
body[data-asn-stage="4"] .asn-v512-products tbody tr[hidden]{display:none!important}
body[data-asn-stage="4"] .asn-v512-products tbody tr:hover{background:var(--asn512-card-alt)}
.asn-v512-product{display:flex;align-items:center;gap:10px;min-width:0}.asn-v512-product-avatar{width:35px;height:35px;border:1px solid var(--asn512-border);background:var(--asn512-card-alt);border-radius:9px;display:grid;place-items:center;color:var(--asn512-accent);font-size:18px;flex:0 0 35px}
.asn-v512-product span:last-child{min-width:0}.asn-v512-product strong{display:block;max-width:320px;overflow-wrap:anywhere;font-size:12px;color:var(--asn512-text)}.asn-v512-product small{display:block;font-size:11px;color:var(--asn512-dim);line-height:1.35;max-width:320px}
.asn-v512-cost-current{font-size:10px;color:var(--asn512-dim);margin-top:3px}
.asn-v512-cell-label{display:none;font-size:10px;color:var(--asn512-dim)}
body[data-asn-stage="4"] .asn-v512-products input[data-cost-id]{width:128px;min-height:36px;padding:8px 10px;font-size:12px;border-radius:9px}
body[data-asn-stage="4"] .asn-v512-products .asn-v512-row-save{background:var(--asn512-card)!important;border:1px solid var(--asn512-border)!important;color:var(--asn512-accent)!important;padding:8px 14px;border-radius:9px;font-size:11px;font-weight:780}
body[data-asn-stage="4"] .asn-v512-products .asn-v512-row-save:hover{border-color:var(--asn512-accent)!important}
.asn-v512-no-results{padding:20px;text-align:center;color:var(--asn512-dim);font-size:12px}
.asn-v512-batchbar{margin:0;display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;padding:18px 20px;background:var(--asn512-card-alt)}
.asn-v512-batchbar strong{font-size:12px;color:var(--asn512-text)}.asn-v512-batchbar p{font-size:11px;color:var(--asn512-dim);margin:4px 0 0;max-width:600px}
.asn-v512-batchbar .btn{font-size:12px;min-height:42px}
.asn-v512-page-note{padding:10px 20px;font-size:11px;color:var(--asn512-dim);margin:0}
.asn-v512-safety{border-left:3px solid #eeb250;background:var(--asn512-card-alt);padding:13px 15px;border-radius:0 9px 9px 0;font-size:12px;color:var(--asn512-dim);margin:18px 0}
.asn-v512-safety strong{color:var(--asn512-text)}
.asn-v512-link-panel{border:1px solid var(--asn512-border);border-radius:14px;margin:18px 0;padding:0!important;overflow:hidden;background:var(--asn512-card)!important}
.asn-v512-link-panel summary{display:flex;gap:11px;align-items:center;padding:16px 18px;cursor:pointer;list-style:none;color:var(--asn512-text)}
.asn-v512-link-panel summary::-webkit-details-marker{display:none}
.asn-v512-link-icon{width:35px;height:35px;border-radius:9px;display:grid;place-items:center;background:var(--asn512-soft);color:var(--asn512-accent);font-size:19px}
.asn-v512-link-panel summary strong{display:block;font-size:12px}.asn-v512-link-panel summary small{display:block;font-size:11px;color:var(--asn512-dim);margin-top:2px}
.asn-v512-link-arrow{margin-left:auto;font-size:20px;color:var(--asn512-dim)}
.asn-v512-link-panel[open] summary{border-bottom:1px solid var(--asn512-border)}
.asn-v512-link-panel>p,.asn-v512-link-panel>.asn-v504-link-actions,.asn-v512-link-panel>#asn-v504-link-form{margin:15px 18px;font-size:12px;color:var(--asn512-dim)}
.asn-v512-bottom-links{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:20px 0 0;font-size:11px;color:var(--asn512-dim)}
.asn-v512-bottom-links .btn{min-height:40px;padding:9px 13px;font-size:11px}
.asn-v512-empty{text-align:center;border:1px dashed var(--asn512-border);background:var(--asn512-card-alt);border-radius:15px;padding:36px 20px;margin:18px 0}
.asn-v512-empty-icon{display:inline-grid;width:60px;height:60px;place-items:center;font-size:27px;color:var(--asn512-accent);background:var(--asn512-soft);border-radius:18px}
.asn-v512-empty h3{font-size:18px;margin:14px 0 8px}.asn-v512-empty p{font-size:12px;max-width:560px;margin:0 auto 17px;color:var(--asn512-dim)}
.asn-v512-empty .asn-v512-inline-actions{justify-content:center}
@media(max-width:1300px){.asn-v512-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.asn-v512-alert-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.asn-v512-commandbar{align-items:flex-start}}
@media(max-width:1050px){html[data-theme] body:has(.setup-content) .setup-content{grid-template-columns:1fr}.asn-v512-store-picker{align-items:flex-start;flex-direction:column}.asn-v512-micro{padding:0}}
@media(max-width:720px){html[data-theme] body:has(.setup-content) .setup{padding:20px 14px!important}html[data-theme] body:has(.setup-content) .card{padding:17px!important}.asn-v512-sectionbar{flex-direction:column}.asn-v512-status{align-self:flex-start}.asn-v512-metrics{gap:8px}.asn-v512-metric{min-height:100px;padding:12px}.asn-v512-metric strong{font-size:25px}.asn-v512-alert-grid{grid-template-columns:1fr}.asn-v512-edit-head,.asn-v512-table-toolbar{padding:13px}.asn-v512-table-toolbar{flex-wrap:wrap}.asn-v512-batchbar{padding:14px}.asn-v512-batchbar .btn{width:100%}.asn-v512-commandbar .btn{flex:1}.asn-v512-commandbar .asn-v512-inline-actions{width:100%}.asn-v512-alert-head{align-items:flex-start;flex-direction:column}}
@media(max-width:400px){.asn-v512-metric strong{font-size:22px}.asn-v512-metric-desc{font-size:9px}.asn-v512-product small{max-width:180px}}
/* Diferencie etapa visitada de etapa verdadeiramente concluída. */
html[data-theme] body:has(.setup-content) .stepitem.visited:not(.active){background:transparent!important;border-color:var(--asn512-border)!important;opacity:.9}
html[data-theme] body:has(.setup-content) .stepitem.visited:not(.active) .num{background:var(--asn512-card-alt)!important;border-color:var(--asn512-border)!important;color:var(--asn512-dim)!important}
/* Em telas estreitas, custo vira cartão editável; o usuário não precisa arrastar uma tabela lateral. */
@media(max-width:720px){
 body[data-asn-stage="4"] .asn-v512-products{overflow:visible;max-height:none}
 body[data-asn-stage="4"] .asn-v512-products table,body[data-asn-stage="4"] .asn-v512-products tbody{width:100%;min-width:0!important;display:block}
 body[data-asn-stage="4"] .asn-v512-products thead{display:none}
 body[data-asn-stage="4"] .asn-v512-products tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:5px 10px;padding:13px;border-bottom:1px solid var(--asn512-border);background:var(--asn512-card)!important}
 body[data-asn-stage="4"] .asn-v512-products tbody td{display:block;padding:0!important;border:0!important;min-width:0}
 body[data-asn-stage="4"] .asn-v512-products tbody td:nth-child(1),body[data-asn-stage="4"] .asn-v512-products tbody td:nth-child(2){grid-column:1/-1}
 body[data-asn-stage="4"] .asn-v512-products tbody td:nth-child(3){grid-column:1}
 body[data-asn-stage="4"] .asn-v512-products tbody td:nth-child(4){grid-column:2}
 body[data-asn-stage="4"] .asn-v512-products input[data-cost-id]{width:100%;max-width:220px;margin-top:5px}
 body[data-asn-stage="4"] .asn-v512-products .asn-v512-row-save{min-height:36px}
 .asn-v512-cell-label{display:block}
 .asn-v512-cost-current{display:inline-block;margin-left:7px}
 .asn-v512-product strong,.asn-v512-product small{max-width:none}
}
