/* Aveltrim | Maquinas Pro V1. Original component selectors; no DOM or event changes. */
[data-view="vending"].vm-page,dialog.vm-dialog,dialog.av-shop-admin,dialog.av-diagnostic-dialog,dialog.vm-qr-dialog{--mp-green:#176b47;--mp-deep:#14372c;--mp-ink:#173329;--mp-muted:#536e60;--mp-line:#d5e3da;--mp-soft:#f3f7f4;--mp-amber:#805711;--mp-amber-bg:#fcf3df;--mp-red:#983d36;--mp-red-bg:#fcefeb}
[data-view="vending"].vm-page #vmBody{max-width:1440px;margin:0 auto;min-width:0}
[data-view="vending"].vm-page .vm-toolbar{max-width:1440px;margin:0 auto 18px!important}
[data-view="vending"].vm-page .vm-toolbar p{color:var(--mp-muted);font-size:14px;line-height:1.55;margin:0}
[data-view="vending"].vm-page .vm-machine-toolbar{gap:16px;margin:0 0 18px;align-items:center}
[data-view="vending"].vm-page .vm-machine-toolbar h3{font-size:22px;line-height:1.35;color:var(--mp-ink);letter-spacing:-.02em;margin:0}
[data-view="vending"].vm-page .vm-machine-toolbar h3::before{content:'GESTÃO DE EQUIPAMENTOS';display:block;color:var(--mp-green);font-size:11px;font-weight:750;letter-spacing:.09em;margin-bottom:6px}
[data-view="vending"].vm-page .vm-machine-toolbar .vm-actions{gap:10px;flex-wrap:wrap}
[data-view="vending"].vm-page .vm-machine-totals{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 20px}
[data-view="vending"].vm-page .vm-machine-totals>div{min-width:0;padding:16px 18px;border:1px solid var(--mp-line);border-radius:12px;background:white;display:grid;gap:10px;align-content:start;min-height:100px}
[data-view="vending"].vm-page .vm-machine-totals small{display:flex;align-items:center;gap:9px;font-size:13px;line-height:1.4;color:var(--mp-muted);margin:0}
[data-view="vending"].vm-page .vm-machine-totals small::before{content:'';display:block;width:30px;height:30px;border-radius:8px;background:#e6f2eb center/17px 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'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 11h8M8 15h3'/%3E%3C/svg%3E");flex:none}
[data-view="vending"].vm-page .vm-machine-totals>div:first-child{background:var(--mp-deep);border-color:var(--mp-deep)}
[data-view="vending"].vm-page .vm-machine-totals>div:first-child :is(small,strong){color:white}
[data-view="vending"].vm-page .vm-machine-totals>div:nth-child(2) small::before{background-color:#e3f2e9;background-image: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.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E")}
[data-view="vending"].vm-page .vm-machine-totals>div:nth-child(3) small::before{background-color:#f8eddb;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23805711' stroke-width='1.7'%3E%3Cpath d='M12 3 2 20h20L12 3ZM12 9v5m0 3v1'/%3E%3C/svg%3E")}
[data-view="vending"].vm-page .vm-machine-totals strong{font-size:27px;line-height:1.1;color:var(--mp-ink);margin:0;font-variant-numeric:tabular-nums}
[data-view="vending"].vm-page #vmBody>.card{padding:16px;border:1px solid var(--mp-line);border-radius:12px;background:#fff}
[data-view="vending"].vm-page .vm-empty{display:grid;justify-items:center;align-content:center;gap:9px;min-height:180px;padding:28px 18px;border:1px dashed #ccded2;border-radius:9px;background:var(--mp-soft);color:var(--mp-ink);text-align:center}
[data-view="vending"].vm-page .vm-empty svg{width:38px;height:38px;padding:8px;box-sizing:border-box;border-radius:10px;background:#e4f1e8;color:var(--mp-green)}
[data-view="vending"].vm-page .vm-empty strong{font-size:15px;line-height:1.4;margin:0}
[data-view="vending"].vm-page .vm-empty p{margin:0;line-height:1.6;font-size:13px;color:var(--mp-muted)}
[data-view="vending"].vm-page .vm-quality-filter{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:14px 16px;margin:0 0 16px;border:1px solid var(--mp-line);border-radius:10px;background:#fff}
[data-view="vending"].vm-page .vm-quality-filter label{display:grid;gap:6px;flex:1 1 210px;font-size:13px;font-weight:650;min-width:0}
[data-view="vending"].vm-page .vm-quality-filter small{color:var(--mp-muted);padding:0 0 10px}
[data-view="vending"].vm-page .vm-quality-filter :is(input,select){width:100%;min-height:42px;border-color:var(--mp-line);border-radius:8px;margin:0}
[data-view="vending"].vm-page .vm-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:16px;align-items:stretch}
[data-view="vending"].vm-page .vm-card{max-width:none;min-width:0;padding:18px;border:1px solid var(--mp-line);border-radius:12px;box-shadow:0 2px 7px #183e2c06;gap:14px;background:#fff}
[data-view="vending"].vm-page .vm-machine-summary{gap:14px;grid-template-columns:76px minmax(0,1fr)}
[data-view="vending"].vm-page .vm-machine-art{background:var(--mp-soft);border:1px solid var(--mp-line);border-radius:10px}
[data-view="vending"].vm-page .vm-machine-info{gap:6px}
[data-view="vending"].vm-page .vm-machine-info h3{font-size:18px;color:var(--mp-ink);margin:0}
[data-view="vending"].vm-page .vm-machine-info p{font-size:13px;color:var(--mp-muted);margin:0;line-height:1.5}
[data-view="vending"].vm-page .vm-machine-tags{gap:6px}
[data-view="vending"].vm-page .vm-machine-tags .status{font-size:11px;border-radius:999px;padding:5px 9px;white-space:normal}
[data-view="vending"].vm-page .vm-machine-tags .status.on{background:#e5f2e9;color:var(--mp-green)}
[data-view="vending"].vm-page .vm-kpis{gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}
[data-view="vending"].vm-page .vm-kpis>div{min-width:0;background:var(--mp-soft);border:1px solid var(--mp-line);border-radius:8px;padding:12px;display:grid;gap:6px}
[data-view="vending"].vm-page .vm-kpis small{font-size:12px;line-height:1.4;color:var(--mp-muted);margin:0}
[data-view="vending"].vm-page .vm-kpis strong{font-size:18px;line-height:1.3;overflow-wrap:anywhere;color:var(--mp-ink);margin:0;font-variant-numeric:tabular-nums}
[data-view="vending"].vm-page .vm-machine-state{color:var(--mp-muted);font-size:12px;line-height:1.55;margin:0;padding:10px 12px;background:var(--mp-soft);border:0;border-radius:8px}
[data-view="vending"].vm-page .vm-machine-card .vm-actions{gap:8px;margin-top:auto}
[data-view="vending"].vm-page .vm-actions :is(button.primary,button.action),html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog,.vm-qr-dialog) :is(button.primary,button.action,button.secondary,a.action){min-height:40px!important;padding:9px 13px!important;border-radius:8px!important;line-height:1.3!important;font-size:13px!important;font-weight:650!important;box-shadow:none!important;white-space:normal!important;max-width:100%;text-decoration:none}
[data-view="vending"].vm-page .vm-actions button.primary,html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog,.vm-qr-dialog) button.primary{background:var(--mp-green)!important;border:1px solid var(--mp-green)!important;color:#fff!important}
[data-view="vending"].vm-page .vm-actions button.action,html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog,.vm-qr-dialog) :is(button.action,button.secondary,a.action){background:white!important;border:1px solid var(--mp-line)!important;color:var(--mp-ink)!important}
[data-view="vending"].vm-page .vm-actions [data-vm="catalogcode"]{background:#edf6f0!important;border-color:#c2dccc!important;color:var(--mp-green)!important}
[data-view="vending"].vm-page button:disabled,html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog,.vm-qr-dialog) button:disabled{opacity:.5!important;cursor:not-allowed!important}
[data-view="vending"].vm-page [hidden],html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog,.vm-qr-dialog) [hidden]{display:none!important}
/* Shared machine form: layout only on original containers. */
html body dialog.av-form-dialog.av-catalog-dialog.vm-dialog{width:min(760px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 24px)!important;padding:0!important;border:1px solid var(--mp-line)!important;border-radius:14px!important;overflow:auto!important;background:#fff!important}
html body dialog.vm-dialog form.av-form{display:flex!important;flex-direction:column!important;gap:0!important;padding:0!important;margin:0!important;max-height:none!important;overflow:visible!important;min-width:0}
html body dialog.vm-dialog #avFormTitle{font-size:21px!important;line-height:1.35!important;color:var(--mp-ink)!important;padding:20px 24px 8px!important;margin:0!important;flex:none!important}
html body dialog.vm-dialog #avFormTitle::before{content:'VENDING MACHINES';display:block;color:var(--mp-green);font-size:10px;letter-spacing:.1em;font-weight:750;margin:0 0 6px}
html body dialog.vm-dialog .av-form-desc{font-size:13px!important;color:var(--mp-muted)!important;line-height:1.55!important;padding:0 24px 16px!important;margin:0!important;border-bottom:1px solid var(--mp-line)!important;flex:none!important}
html body dialog.vm-dialog .av-form-fields{padding:18px 24px!important;gap:14px 16px!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start!important;overflow:visible!important;flex:none!important}
html body dialog.vm-dialog .av-form-fields:empty{display:none!important}
html body dialog.vm-dialog .av-catalog-field{min-width:0!important;margin:0!important;padding:0!important}
html body dialog.vm-dialog .av-form-fields>[data-field="code"]{grid-column:1/-1!important}
html body dialog.vm-dialog .av-catalog-field label:not(:has(input[type=checkbox],input[type=radio])){display:grid!important;gap:6px!important;line-height:1.45!important;font-size:13px!important;color:var(--mp-ink);margin:0!important}
html body dialog.vm-dialog .av-form-fields :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file]),select,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:42px;border-radius:8px;border-color:var(--mp-line);font-size:14px;box-shadow:none;margin:0}
html body dialog.vm-dialog .av-form-help{font-size:12px!important;line-height:1.5!important;color:var(--mp-muted)!important;margin:4px 0 0!important}
html body dialog.vm-dialog .av-form-error:empty{display:none!important}
html body dialog.vm-dialog .av-form-error:not(:empty){padding:0 24px!important;margin:0 0 12px!important}
html body dialog.vm-dialog .av-form-actions{display:flex!important;align-items:center;justify-content:flex-end;gap:8px!important;padding:13px 24px!important;margin:0!important;border-top:1px solid var(--mp-line)!important;background:white!important;position:sticky!important;bottom:0!important;z-index:3;flex:none!important;flex-wrap:wrap}
html body dialog.vm-dialog .av-form-actions button.av-danger{background:#a54037!important;border:1px solid #a54037!important;color:white!important;border-radius:8px!important;min-height:40px!important;padding:9px 13px!important}
html body dialog.vm-dialog [data-vm-live]{padding:18px 24px 0}
html body dialog.vm-dialog .vm-control-status{gap:12px}
html body dialog.vm-dialog .vm-control-connection{background:var(--mp-soft);border-color:var(--mp-line);padding:14px;gap:12px}
html body dialog.vm-dialog .vm-control-status dl>div{padding:10px 0;font-size:13px;gap:12px}
html body dialog.vm-dialog .vm-control-status p{padding:12px;line-height:1.55;background:var(--mp-soft)}
html body dialog.vm-dialog .vm-reset-test{margin:16px 24px;padding:12px 0 0;gap:8px}
html body dialog.vm-dialog .vm-reset-test button{color:var(--mp-red)!important;border-color:#e9c5bf!important}
html body dialog.vm-dialog .vm-reset-test small{font-size:12px;line-height:1.5}
/* Catalog and QR: actual Smart Shop administrative dialog. */
html body dialog.av-shop-admin{width:min(1000px,calc(100vw - 24px))!important;max-height:calc(100dvh - 24px)!important;border:1px solid var(--mp-line)!important;border-radius:14px!important}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>header{padding:20px 24px!important;flex:0 0 auto!important;border-bottom:1px solid var(--mp-line)!important;gap:12px!important}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>header small{color:var(--mp-green)!important;font-size:10px;font-weight:750;letter-spacing:.09em}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>header h2{font-size:22px!important;color:var(--mp-ink);line-height:1.3;margin:5px 0!important}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>header p{font-size:13px;line-height:1.5;color:var(--mp-muted);margin:0}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog) .av-wh-body{padding:18px 24px!important;gap:16px!important;min-height:0!important;align-content:start!important;overflow:auto!important;overscroll-behavior:contain}
html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>footer{padding:12px 24px!important;gap:8px!important;flex:none!important;border-top:1px solid var(--mp-line)!important;background:#fff!important}
html body dialog.av-shop-admin .av-shop-summary{gap:10px}
html body dialog.av-shop-admin .av-shop-summary>div{padding:14px 16px;gap:8px;border-color:var(--mp-line);border-radius:10px;min-width:0}
html body dialog.av-shop-admin .av-shop-summary>div:first-child{background:var(--mp-deep);border-color:var(--mp-deep)}
html body dialog.av-shop-admin .av-shop-summary>div:first-child :is(strong,small){color:white}
html body dialog.av-shop-admin .av-shop-summary small{font-size:12px;line-height:1.45;color:var(--mp-muted)}
html body dialog.av-shop-admin .av-shop-summary strong{font-size:21px;line-height:1.25;overflow-wrap:anywhere}
html body dialog.av-shop-admin label.av-shop-publish{background:#eef6f0;border-color:#c9dfd0;padding:14px 18px!important}
html body dialog.av-shop-admin input:checked+.av-shop-toggle-track{background:var(--mp-green)!important;border-color:var(--mp-green)!important}
html body dialog.av-shop-admin .av-shop-address{padding:16px;border-color:var(--mp-line);border-radius:10px;background:var(--mp-soft);gap:16px}
html body dialog.av-shop-admin .av-shop-address code{color:var(--mp-green);font-size:12px;line-height:1.6;background:white;border:1px solid var(--mp-line);border-radius:7px;padding:9px;overflow-wrap:anywhere}
html body dialog.av-shop-admin .av-shop-address img{border-color:var(--mp-line);padding:8px;max-width:100%}
html body dialog.av-shop-admin .av-shop-link-actions{gap:8px;margin-top:-6px}
html body dialog.av-shop-admin .av-shop-link-actions [data-open]{background:#eaf4ed!important;color:var(--mp-green)!important;border-color:#bad7c4!important}
html body dialog.av-shop-admin .av-shop-list-head{gap:12px;padding-top:16px;margin-top:0;border-color:var(--mp-line)}
html body dialog.av-shop-admin .av-shop-list-head h3{font-size:17px;line-height:1.4;color:var(--mp-ink)}
html body dialog.av-shop-admin :is(.av-shop-publish,.av-shop-address,.av-shop-list-head) p{font-size:12px;line-height:1.55;margin-top:5px}
html body dialog.av-shop-admin .av-shop-list-controls{gap:8px;min-width:0}
html body dialog.av-shop-admin .av-shop-list-controls :is(input,select){border-radius:8px!important;border-color:var(--mp-line)!important;min-height:42px!important;max-width:100%}
html body dialog.av-shop-admin .av-shop-list-count{margin:0;color:var(--mp-muted);font-size:12px}
html body dialog.av-shop-admin .av-shop-list{border:1px solid var(--mp-line);border-radius:10px;background:#fff}
html body dialog.av-shop-admin .av-shop-list article{padding:14px 16px;gap:14px;min-height:84px;border-color:#e4ede6}
html body dialog.av-shop-admin .av-shop-item-main{gap:5px;flex:1;min-width:0}
html body dialog.av-shop-admin .av-shop-item-main b{font-size:14px;line-height:1.45;color:var(--mp-ink)}
html body dialog.av-shop-admin .av-shop-item-main small{font-size:12px;line-height:1.5;color:var(--mp-muted)}
html body dialog.av-shop-admin .av-shop-item-main :is(.av-shop-stock-ok,.av-shop-warning){justify-self:start;padding:4px 8px;border-radius:6px;font-weight:650}
html body dialog.av-shop-admin .av-shop-item-main .av-shop-stock-ok{background:#e8f3ec;color:var(--mp-green)}
html body dialog.av-shop-admin .av-shop-item-main .av-shop-warning{background:var(--mp-amber-bg);color:var(--mp-amber)}
html body dialog.av-shop-admin .av-shop-empty{margin:10px;padding:22px 12px;background:var(--mp-soft);border:1px dashed var(--mp-line);border-radius:8px;line-height:1.5}
html body dialog.av-shop-admin .av-shop-help{font-size:12px;line-height:1.55;color:var(--mp-muted)}
html body dialog.av-shop-admin [data-message]:empty{display:none!important}
html body dialog.av-shop-admin [data-message]:not(:empty){padding:10px 12px;border-radius:8px;background:var(--mp-soft);border:1px solid var(--mp-line)}
html body dialog.av-shop-admin .av-shop-pager{gap:12px;flex-wrap:wrap}
html body dialog.av-diagnostic-dialog .av-diag-kpis>div{padding:14px;border:1px solid var(--mp-line);border-radius:10px;background:var(--mp-soft)}
html body dialog.av-diagnostic-dialog .av-diag-facts>div{padding:11px 0;gap:12px;border-color:var(--mp-line)}
html body dialog.av-diagnostic-dialog .av-diag-facts dd{overflow-wrap:anywhere}
html body dialog:is(.vm-dialog,.av-shop-admin,.av-diagnostic-dialog) :is(button,a,input,select,textarea):focus-visible{outline:2px solid #78a98a!important;outline-offset:2px!important}
@media(max-width:760px){[data-view="vending"].vm-page .vm-machine-totals{grid-template-columns:1fr}[data-view="vending"].vm-page .vm-machine-totals>div{min-height:0;gap:8px}[data-view="vending"].vm-page .vm-machine-toolbar .vm-actions{width:100%}[data-view="vending"].vm-page .vm-machine-toolbar .vm-actions button{flex:1 1 130px}html body dialog.vm-dialog .av-form-fields{grid-template-columns:minmax(0,1fr)!important}html body dialog.vm-dialog :is(#avFormTitle,.av-form-desc,.av-form-fields,.av-form-actions,[data-vm-live]),html body dialog:is(.av-shop-admin,.av-diagnostic-dialog)>:is(header,footer),html body dialog:is(.av-shop-admin,.av-diagnostic-dialog) .av-wh-body{padding-left:16px!important;padding-right:16px!important}html body dialog.vm-dialog .vm-reset-test{margin-left:16px;margin-right:16px}html body dialog.av-shop-admin .av-shop-list-controls{width:100%;display:grid;grid-template-columns:minmax(0,1fr)}html body dialog.av-shop-admin .av-shop-list-controls :is(input,select){width:100%!important;max-width:none!important}html body dialog.av-shop-admin .av-shop-list article{padding:12px;gap:10px;flex-wrap:wrap}html body dialog.av-shop-admin .av-shop-summary{grid-template-columns:repeat(2,minmax(0,1fr))}html body dialog.av-shop-admin .av-shop-summary>div:last-child{grid-column:1/-1}}
/* Prevent content compression and keep field outlines explicit over shared reset. */
html body dialog.av-shop-admin .av-wh-body{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;align-items:stretch!important}
html body dialog.av-shop-admin .av-wh-body>*{flex:0 0 auto!important;min-width:0!important}
html body dialog.av-shop-admin .av-shop-list{height:auto!important;max-height:none!important}
html body dialog.vm-dialog .av-form-fields :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file]),select,textarea),html body [data-view="vending"].vm-page .vm-quality-filter :is(input,select){border:1px solid #bdcfc3!important;border-radius:8px!important;background:#fff!important;padding:9px 12px!important;font-weight:400!important;line-height:1.45!important;color:var(--mp-ink)!important}
[data-view="vending"].vm-page .vm-cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr))}


/* AVELTRIM_SIMULADOR_UI_V2: somente o painel de controle local. */
html body dialog.vm-dialog:has([data-vm-live]) :is(.av-form-actions > button, .vm-reset-test > button.action) {
  display:inline-flex!important; align-items:center!important; justify-content:center!important;
  box-sizing:border-box!important; height:auto!important; min-height:40px!important;
  padding:9px 13px!important; margin:0!important; border-width:1px!important;
  border-style:solid!important; border-radius:8px!important; font-size:13px!important;
  font-weight:650!important; line-height:1.3!important; box-shadow:none!important;
  white-space:normal!important; width:auto!important; min-width:0!important;
}
html body dialog.vm-dialog:has([data-vm-live]) .av-form-actions {
  flex-direction:row!important; align-items:center!important; justify-content:flex-end!important;
}
