/* Aveltrim | Central de reposicao de teste. Scoped to original dialogs. */
html body dialog.vm-studio-dialog:is(.vm-replenish-dialog,.vm-replenish-batch-dialog){inset:0!important;margin:auto!important;width:min(820px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;height:fit-content!important;max-height:calc(100dvh - 32px)!important;border:1px solid #d5e3da!important;border-radius:14px!important;overflow:auto!important;animation:none!important;box-shadow:0 18px 60px #102c2533!important;box-sizing:border-box!important;color:#173329}
html body dialog.vm-replenish-dialog .vm-studio-content,html body dialog.vm-replenish-batch-dialog .vm-studio-content{display:grid;gap:14px;padding:18px 24px 0!important;min-width:0;box-sizing:border-box}
.vm-replenish-dialog .vm-rp-notice{display:flex;align-items:center;gap:12px;border:1px solid #e8d4aa;border-radius:9px;background:#fff9ed;color:#795214;padding:12px 14px;font-size:13px;line-height:1.5}
.vm-replenish-dialog .vm-rp-test{font-size:10px;font-weight:750;letter-spacing:.06em;background:#f7e8c8;border-radius:6px;padding:6px 8px;flex:none}
.vm-replenish-dialog .vm-rp-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:5px;background:#f1f6f3;border:1px solid #d5e3da;border-radius:10px}
html body dialog.vm-replenish-dialog .vm-rp-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px!important;border-radius:7px!important;background:transparent!important;border:1px solid transparent!important;color:#526e60!important;white-space:normal!important;text-align:center}
html body dialog.vm-replenish-dialog .vm-rp-tabs button[aria-pressed=true]{background:#fff!important;border-color:#b9d5c5!important;color:#176b47!important;box-shadow:0 1px 3px #14372c10!important}
.vm-rp-tabs small{font-size:11px;font-weight:700;background:#e4eee8;padding:2px 7px;border-radius:999px;color:#176b47}
.vm-replenish-dialog .vm-rp-pane{display:grid;gap:12px;min-width:0}.vm-replenish-dialog .vm-rp-pane[hidden]{display:none!important}
.vm-replenish-dialog .vm-rp-card{display:grid;gap:12px;min-width:0;padding:16px;border:1px solid #d5e3da;border-radius:10px;background:#fff}
.vm-replenish-dialog .vm-rp-heading{display:flex;align-items:flex-start;gap:10px;min-width:0}.vm-replenish-dialog .vm-rp-heading>div{min-width:0;flex:1}
.vm-replenish-dialog .vm-rp-step{display:grid;place-items:center;flex:none;width:28px;height:28px;background:#e6f1e9;color:#176b47;border-radius:8px;font-size:13px;font-weight:750}
.vm-replenish-dialog .vm-rp-heading h3{margin:0!important;font-size:16px!important;line-height:1.4;color:#173329}.vm-replenish-dialog .vm-rp-heading p,.vm-replenish-dialog .vm-rp-card>p{margin:3px 0 0!important;font-size:13px;line-height:1.5;color:#526e60}
.vm-replenish-dialog .vm-rp-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,155px);gap:12px;align-items:end;min-width:0}
html body dialog.vm-replenish-dialog label:not(.vm-rp-batch){display:grid!important;gap:6px;min-width:0;margin:0!important;font-size:13px;font-weight:600;line-height:1.4}
html body dialog:is(.vm-replenish-dialog,.vm-replenish-batch-dialog) :is(input[type=number],select){width:100%!important;min-width:0!important;max-width:100%!important;min-height:42px!important;height:auto!important;padding:9px 12px!important;border:1px solid #bdcfc3!important;border-radius:8px!important;background:#fff!important;color:#173329!important;box-sizing:border-box!important;font:inherit;margin:0!important}
.vm-replenish-dialog .vm-rp-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.vm-replenish-dialog .vm-rp-empty{margin:0!important;padding:12px!important;border:1px dashed #d5e3da;border-radius:8px;background:#f5f8f6;color:#526e60;font-size:13px;line-height:1.5}
.vm-replenish-dialog .vm-studio-shelf{display:grid;gap:9px;padding:13px;background:#f8faf9}.vm-replenish-dialog .vm-studio-shelf p{margin:0;font-size:13px;color:#526e60;line-height:1.5}.vm-replenish-dialog .vm-studio-shelf .vm-actions{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.vm-replenish-dialog .vm-studio-shelf .vm-actions label{flex:1 1 140px;max-width:200px}
.vm-replenish-dialog .vm-rp-balance{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px;border:1px solid #d5e3da;border-radius:8px;background:#f3f7f4}.vm-replenish-dialog .vm-rp-balance strong{color:#176b47;white-space:nowrap}
.vm-replenish-dialog details.vm-rp-card:not([open])>*:not(summary){display:none!important}.vm-replenish-dialog details.vm-rp-card[open]>summary{margin-bottom:10px}.vm-replenish-dialog details.vm-rp-card summary{cursor:pointer;font-size:14px;font-weight:650;color:#176b47;line-height:1.5}
html body dialog.vm-replenish-dialog .vm-rp-batch,html body dialog.vm-replenish-batch-dialog .vm-studio-batch{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(80px,120px)!important;gap:14px!important;align-items:center;padding:12px!important;border:1px solid #d5e3da;border-radius:9px;background:#fff;min-width:0;margin:0!important}
.vm-rp-batch>span,.vm-replenish-batch-dialog .vm-studio-batch>span{min-width:0;overflow-wrap:anywhere}.vm-rp-batch b,.vm-replenish-batch-dialog .vm-studio-batch b{display:block;font-size:14px;line-height:1.4}.vm-rp-batch small,.vm-replenish-batch-dialog .vm-studio-batch small{display:block;color:#526e60;font-size:12px;line-height:1.4;margin-top:4px}
html body dialog.vm-replenish-dialog footer,html body dialog.vm-replenish-batch-dialog footer{background:#fff;position:sticky;bottom:0;z-index:2;padding:12px 0!important;margin:0!important;display:flex;gap:8px;justify-content:flex-end}
html body dialog.ap-suggestions-pro [data-commercial-notice][hidden]{display:none!important}
@media(max-width:600px){html body dialog.vm-studio-dialog:is(.vm-replenish-dialog,.vm-replenish-batch-dialog){width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important}html body dialog.vm-replenish-dialog .vm-studio-content,html body dialog.vm-replenish-batch-dialog .vm-studio-content{padding:14px 14px 0!important}.vm-replenish-dialog .vm-rp-fields{grid-template-columns:minmax(0,1fr)}.vm-replenish-dialog .vm-rp-notice{align-items:flex-start}.vm-replenish-dialog .vm-rp-card{padding:12px}.vm-replenish-dialog .vm-rp-tabs button svg{display:none}.vm-replenish-dialog .vm-rp-actions>button{width:100%}.vm-replenish-dialog .vm-rp-batch{grid-template-columns:minmax(0,1fr) 86px!important}}
html body dialog.vm-replenish-dialog select{appearance:none!important;padding-right:34px!important;background:#fff right 12px center/16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23176b47' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important}

/* V1.1 - campos e acoes no mesmo eixo, somente na central de reposicao. */
html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions){display:grid!important;grid-template-columns:minmax(0,1fr) max-content;column-gap:12px;row-gap:14px;align-items:end}
html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions) > .vm-rp-heading{grid-column:1/-1}
html body dialog.vm-replenish-dialog .vm-rp-card > .vm-rp-fields{grid-template-columns:minmax(0,1fr) minmax(98px,120px);gap:10px;align-self:end}
html body dialog.vm-replenish-dialog .vm-rp-card > .vm-rp-fields :is(select,input[type=number]){height:42px!important;min-height:42px!important;max-height:42px!important}
html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions) > .vm-rp-actions{display:flex!important;align-self:end;align-items:end;margin:0!important;padding:0!important;min-width:0}
html body dialog.vm-replenish-dialog :is(.vm-rp-actions,.vm-studio-shelf .vm-actions) > button{display:inline-flex!important;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;height:42px!important;min-height:42px!important;padding:0 14px!important;font-size:13px!important;line-height:1.3!important;border-radius:8px!important}
html body dialog.vm-replenish-dialog .vm-rp-actions > button:is([data-sim=create],[data-sim=transfer]){white-space:nowrap!important}
html body dialog.vm-replenish-dialog .vm-studio-shelf .vm-actions input[type=number]{height:42px!important;min-height:42px!important;max-height:42px!important}
html body dialog:is(.vm-replenish-dialog,.vm-replenish-batch-dialog) footer > button{display:inline-flex!important;align-items:center;justify-content:center;box-sizing:border-box;height:40px!important;min-height:40px!important;min-width:94px;padding:0 16px!important;line-height:1.3!important;font-size:13px!important}
@media(max-width:760px){html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions){grid-template-columns:minmax(0,1fr)}html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions) > .vm-rp-actions{justify-content:flex-end}html body dialog.vm-replenish-dialog .vm-rp-card > .vm-rp-fields{grid-template-columns:minmax(0,1fr) minmax(88px,120px)}}
@media(max-width:480px){html body dialog.vm-replenish-dialog .vm-rp-card > .vm-rp-fields{grid-template-columns:minmax(0,1fr)}html body dialog.vm-replenish-dialog .vm-rp-card:has(> .vm-rp-fields + .vm-rp-actions) > .vm-rp-actions > button{width:100%;white-space:normal!important}html body dialog:is(.vm-replenish-dialog,.vm-replenish-batch-dialog) footer > button{flex:1 1 0;min-width:0}}

/* Compras unificadas: escopo exclusivo do módulo de pedidos e seus modais. */
html body [data-view="fx-purchases"] .ap-env-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border:1px solid #d5e3da;border-radius:10px;background:#fff;margin:0 0 14px}
html body [data-view="fx-purchases"] .ap-env-switch{display:flex;gap:4px;flex-wrap:wrap;background:#f3f7f4;padding:4px;border:1px solid #d5e3da;border-radius:9px}
html body [data-view="fx-purchases"] .ap-env-switch button{display:inline-flex!important;align-items:center;gap:7px;justify-content:center;min-height:38px!important;border-radius:7px!important;padding:8px 14px!important;background:transparent!important;border:1px solid transparent!important;color:#526e60!important;box-shadow:none!important;font-size:13px!important}
html body [data-view="fx-purchases"] .ap-env-switch button[aria-pressed=true]{background:#fff!important;border-color:#b9d5c5!important;color:#176b47!important;font-weight:700}
html body [data-view="fx-purchases"][data-purchase-env=test] .ap-env-switch button[aria-pressed=true]{background:#fff9ed!important;border-color:#e6c88d!important;color:#805510!important}
[data-view="fx-purchases"] .ap-env-description{font-size:13px;color:#526e60;flex:1;min-width:140px}
html body [data-view="fx-purchases"] [data-sim-stock]{margin-left:auto;display:inline-flex;gap:7px;align-items:center;min-height:38px}
html body [data-view="fx-purchases"] [hidden]{display:none!important}
html body [data-view="fx-purchases"] .ap-env-note,html body dialog.ap-unified-test .ap-env-note{display:flex;align-items:flex-start;gap:10px;background:#fff9ed;border:1px solid #e7d2a7;color:#805510;border-radius:9px;padding:13px 15px;margin:0 0 14px;font-size:13px;line-height:1.5}
.ap-env-note svg{flex:none;margin-top:2px}.ap-env-note div{min-width:0;display:grid;gap:4px}.ap-env-note strong{font-size:13px}.ap-env-note small{font-size:12px;color:#805510}
html body [data-view="fx-purchases"][data-purchase-env=test] .ap-stages{grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr))!important}
html body dialog.ap-unified-test .ap-sim-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:end}
html body dialog.ap-unified-test :is(input,select){height:42px!important;min-height:42px!important;width:100%;min-width:0;box-sizing:border-box;margin:0!important;border:1px solid #bdcfc3;border-radius:8px}
html body dialog.ap-unified-test label{display:grid!important;gap:6px;font-size:13px;font-weight:600;margin:0!important;min-width:0}
html body dialog.ap-unified-test input[readonly]{background:#f3f7f4!important;color:#526e60!important}
html body dialog.ap-unified-test .aq-footer button{min-height:42px!important;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 14px!important;line-height:1.3!important}
html body dialog.ap-unified-test .ap-sim-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}.ap-sim-metrics>div{background:#f3f7f4;border:1px solid #d5e3da;border-radius:8px;padding:12px;display:grid;gap:6px}.ap-sim-metrics small{font-size:12px;color:#526e60}.ap-sim-metrics strong{font-size:18px;color:#173329}
@media(max-width:600px){html body dialog.ap-unified-test .ap-sim-form{grid-template-columns:1fr}html body [data-view="fx-purchases"] .ap-env-switch{width:100%}html body [data-view="fx-purchases"] .ap-env-switch button{flex:1}html body [data-view="fx-purchases"] [data-sim-stock]{margin-left:0}html body dialog.ap-unified-test .aq-footer{flex-wrap:wrap}html body dialog.ap-unified-test .ap-sim-metrics{grid-template-columns:1fr}}

/* FIX-ESPACAMENTO-ABASTECIMENTO-V1 */
html body dialog.vm-replenish-dialog details.vm-rp-direct > .vm-rp-batch + .vm-rp-batch{margin-top:12px!important} html body dialog.vm-replenish-dialog details.vm-rp-direct > p:not(.vm-rp-empty){margin-bottom:12px!important} html body dialog.vm-replenish-dialog details.vm-rp-direct > .vm-rp-batch{padding:14px!important} html body dialog.vm-replenish-dialog details.vm-rp-direct > .vm-rp-actions{margin-top:14px!important}
