/* SmoField v2 — estilos isolados (prefixo implícito: só carregado em /v2/) */
:root{--bg:oklch(0.972 0.004 265);--panel:oklch(1 0 0);--panel2:oklch(0.955 0.005 265);--line:oklch(0.905 0.007 265);--line2:oklch(0.84 0.01 265);--ink:oklch(0.22 0.025 268);--ink2:oklch(0.44 0.02 268);--ink3:oklch(0.56 0.015 268);--acc:oklch(0.5 0.19 268);--acc-ink:#fff;--acc-soft:oklch(0.94 0.035 268);--acc-text:oklch(0.45 0.19 268);--dy:oklch(0.5 0.14 245);--pbb:oklch(0.5 0.13 150);--sn:oklch(0.53 0.14 55);--ok:oklch(0.5 0.13 150);--ok-soft:oklch(0.94 0.04 150);--warn:oklch(0.52 0.12 75);--warn-soft:oklch(0.95 0.05 85);--err:oklch(0.52 0.19 25);--err-soft:oklch(0.95 0.03 25);--shadow:0 1px 2px oklch(0.2 0.02 268/.06),0 12px 32px oklch(0.2 0.02 268/.10);--overlay:oklch(0.2 0.02 268/.45)}
html[data-theme="dark"]{--bg:oklch(0.165 0.012 268);--panel:oklch(0.205 0.014 268);--panel2:oklch(0.24 0.014 268);--line:oklch(0.3 0.014 268);--line2:oklch(0.38 0.014 268);--ink:oklch(0.95 0.006 268);--ink2:oklch(0.8 0.012 268);--ink3:oklch(0.68 0.012 268);--acc:oklch(0.72 0.14 268);--acc-ink:oklch(0.17 0.03 268);--acc-soft:oklch(0.3 0.06 268);--acc-text:oklch(0.82 0.11 268);--dy:oklch(0.76 0.12 245);--pbb:oklch(0.76 0.12 150);--sn:oklch(0.78 0.12 60);--ok:oklch(0.77 0.13 150);--ok-soft:oklch(0.3 0.05 150);--warn:oklch(0.82 0.12 85);--warn-soft:oklch(0.32 0.05 85);--err:oklch(0.74 0.15 25);--err-soft:oklch(0.32 0.06 25);--shadow:0 1px 2px #0006,0 12px 32px #0009;--overlay:oklch(0.08 0.01 268/.6)}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}
*{box-sizing:border-box;scrollbar-width:none}*::-webkit-scrollbar{display:none}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font:14px/1.4 Figtree,system-ui,sans-serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}
a{color:var(--acc-text)}a:hover{color:var(--ink)}
:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
::placeholder{color:var(--ink3)}
.ic{font-family:'Material Symbols Outlined';font-size:20px;line-height:1;font-weight:400;font-style:normal;display:inline-block;width:1em;flex:none;overflow:hidden;white-space:nowrap;-webkit-font-smoothing:antialiased}
.mono{font-family:'IBM Plex Mono',monospace}
.boot{display:flex;align-items:center;justify-content:center;height:100vh;color:var(--ink2)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--line);background:var(--panel);font-weight:650;white-space:nowrap}
.btn:hover{background:var(--panel2)}
.btn.pri{background:var(--acc);color:var(--acc-ink);border:0;font-weight:700}
.btn.pri:hover{filter:brightness(1.06)}
.btn.lg{height:46px;font-size:15px}.btn.sm{height:32px;padding:0 10px;font-size:13px}
.btn.ghost{border:0;background:transparent;color:var(--acc-text)}
.btn.danger{border:0;background:var(--err-soft);color:var(--err)}
.iconbtn{width:40px;height:40px;border-radius:10px;border:1px solid var(--line);background:var(--panel);display:inline-flex;align-items:center;justify-content:center;flex:none}
.iconbtn:hover{background:var(--panel2)}
.field{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:13px}
.input{height:44px;padding:0 12px;border-radius:10px;border:1px solid var(--line2);background:var(--panel);outline:none;font-weight:400;font-size:14px;width:100%}
.input:focus{border-color:var(--acc)}
.search{position:relative}.search .ic{position:absolute;left:11px;top:50%;transform:translateY(-50%);font-size:19px;color:var(--ink3);pointer-events:none}.search .input{padding-left:38px;height:38px}
.chip{height:32px;padding:0 12px;border-radius:20px;border:1px solid var(--line);background:var(--panel);font-weight:600;font-size:13px;color:var(--ink2);white-space:nowrap}
.chip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.seg{display:inline-flex;gap:2px;padding:3px;border-radius:10px;background:var(--panel2);border:1px solid var(--line)}
.seg button{height:30px;padding:0 12px;border-radius:7px;border:0;background:transparent;font-weight:650;color:var(--ink2);white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.seg button.on{background:var(--panel);color:var(--ink);box-shadow:0 1px 3px oklch(0.2 0.02 268/.15)}
.seg.acc button.on{background:var(--acc);color:var(--acc-ink)}
.badge{display:inline-flex;align-items:center;font-size:11.5px;font-weight:700;padding:3px 8px;border-radius:20px}
.b-ok{background:var(--ok-soft);color:var(--ok)}.b-new{background:var(--acc-soft);color:var(--acc-text)}.b-err{background:var(--err-soft);color:var(--err)}.b-warn{background:var(--warn-soft);color:var(--warn)}.b-mute{background:var(--panel2);color:var(--ink2)}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
.eyebrow{font-size:12px;font-weight:700;letter-spacing:.1em;color:var(--ink3);text-transform:uppercase}
.h1{margin:6px 0 0;font-size:28px;font-weight:750;letter-spacing:-.015em}
.card{border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.empty{padding:40px 24px;text-align:center;color:var(--ink2)}.empty .ic{font-size:32px;color:var(--ink3)}
.alert{display:flex;gap:8px;align-items:center;padding:10px 12px;border-radius:10px;font-weight:650;font-size:13.5px}

/* Login */
.login{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.login-hero{background:oklch(0.26 0.07 270);color:oklch(0.97 0.01 270);padding:48px 56px;display:flex;flex-direction:column;justify-content:space-between;gap:32px}
.login-hero h1{font-size:44px;line-height:1.08;margin:14px 0 0;font-weight:750;letter-spacing:-.02em;text-wrap:pretty}
.login-form{display:flex;align-items:center;justify-content:center;padding:48px;position:relative}
.login-form form{width:100%;max-width:400px;display:flex;flex-direction:column;gap:16px}
.terms-doc{width:100%;max-height:38vh;overflow:auto;padding:16px 18px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--ink2);font-size:12.5px;line-height:1.55;overscroll-behavior:contain}
.terms-doc h3{margin:14px 0 4px;color:var(--ink);font-size:13px}.terms-doc section:first-of-type h3{margin-top:4px}.terms-doc p{margin:0}.terms-version{margin-bottom:10px;color:var(--ink3);font-size:11px;font-weight:700}.terms-owner{margin-top:14px!important;color:var(--ink3)}
.terms-owner a,.login-privacy a{color:var(--acc-text);font-weight:700}.login-privacy{margin:0;text-align:center;font-size:12px;color:var(--ink3)}
.privacy-page{min-height:100dvh;padding:0 22px 56px;background:var(--bg);color:var(--ink)}.privacy-head{max-width:900px;margin:0 auto;padding:18px 0;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.privacy-brand{display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;letter-spacing:2px;font-size:13px}.privacy-brand i{width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,#41a9df,#6c5ce7)}.privacy-brand span{margin-left:2px;color:var(--ink3);font-size:10px;letter-spacing:1px}.privacy-content{max-width:780px;margin:40px auto 0;padding:clamp(22px,5vw,44px);border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:var(--shadow);line-height:1.7}.privacy-content h1{margin:4px 0 10px;font-size:32px}.privacy-content h2{margin:28px 0 8px;font-size:18px}.privacy-content p{margin:8px 0;color:var(--ink2)}.privacy-content ul{padding-left:22px;color:var(--ink2)}.privacy-content li{margin:8px 0}.privacy-content a{color:var(--acc-text)}.privacy-lead{font-size:16px}.privacy-meta{font-size:12px;color:var(--ink3)!important}.privacy-footer{margin-top:32px;padding-top:18px;border-top:1px solid var(--line);font-size:13px;color:var(--ink3)}
html.privacy-root,body.privacy-body{height:auto;min-height:100%;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}body.privacy-body .privacy-page{min-height:100vh;min-height:100dvh;height:auto}body.privacy-body::-webkit-scrollbar{display:block;width:6px}body.privacy-body::-webkit-scrollbar-thumb{background:var(--line2);border-radius:8px}
.terms-check{display:flex;align-items:flex-start;gap:10px;color:var(--ink2);font-size:13px;line-height:1.45}.terms-check input{width:18px;height:18px;margin:1px 0 0;accent-color:var(--acc);flex:none}
.terms-gate{height:100dvh;overflow:auto;padding:clamp(16px,4vw,40px);display:flex;align-items:center;justify-content:center}
.terms-panel{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;gap:16px;padding:clamp(18px,3vw,32px);border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:var(--shadow)}
.terms-title h1{margin:6px 0;font-size:clamp(22px,4vw,30px)}.terms-title p{margin:4px 0;color:var(--ink2)}.terms-account{font-weight:650}.terms-panel .terms-doc{max-height:min(46vh,440px)}.terms-actions{display:flex;flex-direction:column;gap:14px}.terms-buttons{display:flex;gap:10px;flex-wrap:wrap}
.logo{display:flex;align-items:center;gap:10px}.logo i{width:26px;height:26px;border-radius:50%;background:linear-gradient(160deg,oklch(0.82 0.09 240),oklch(0.55 0.2 290))}.logo b{letter-spacing:.3em;font-size:12.5px;font-weight:750}
@media (max-width:900px){.login{grid-template-columns:1fr}.login-hero{display:none}}
@media (max-width:600px){.login-form{padding:22px 16px}.login-form form{max-width:480px}.terms-doc{max-height:32vh;padding:12px}.terms-panel .terms-doc{max-height:44vh}.terms-gate{padding:10px}.terms-panel{gap:12px;border-radius:12px;padding:16px}.terms-buttons{flex-direction:column}.terms-buttons .btn{width:100%}}

/* Shell */
.shell{display:grid;grid-template-rows:60px 48px minmax(0,1fr);height:100vh}
.top{display:flex;align-items:center;gap:16px;padding:0 16px 0 20px;background:var(--panel);border-bottom:1px solid var(--line)}
.top .logo{width:228px;flex:0 1 228px;min-width:0}
.nav{display:flex;gap:2px;height:100%}
.nav button{display:flex;align-items:center;gap:8px;padding:0 12px;height:100%;border:0;background:transparent;color:var(--ink2);font-weight:550;white-space:nowrap;flex:none}
.nav button.on{color:var(--ink);font-weight:700;box-shadow:inset 0 -2px 0 var(--acc)}
.gsearch{position:relative;flex:1;min-width:200px;max-width:520px;margin-left:auto}
.gsearch .input{height:40px;padding-left:40px;background:var(--panel2);border-color:var(--line)}
.gsearch>.ic{position:absolute;left:12px;top:10px;color:var(--ink3)}
.pop{position:absolute;top:46px;left:0;right:0;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:6px;z-index:40;max-height:420px;overflow:auto}
.pop .grp{font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--ink3);padding:8px 10px 4px}
.pop button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:transparent;border-radius:8px;text-align:left}
.pop button:hover,.pop button.hl{background:var(--panel2)}
.menu{position:absolute;right:0;top:48px;width:280px;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);z-index:45;overflow:hidden}
.menu button{display:flex;align-items:center;gap:10px;width:100%;height:40px;padding:0 12px;border:0;background:transparent;text-align:left}
.menu button:hover{background:var(--panel2)}
.ctxbar{display:flex;align-items:center;gap:12px;padding:0 16px 0 20px;background:var(--panel2);border-bottom:1px solid var(--line);min-width:0}
.body{display:grid;grid-template-columns:264px minmax(0,1fr) 60px;min-height:0}
.side{border-right:1px solid var(--line);background:var(--panel);overflow:auto;padding:14px 12px 24px;display:flex;flex-direction:column;gap:6px}
.side .lbl{font-size:11px;font-weight:700;letter-spacing:.1em;color:var(--ink3);padding:10px 8px 2px}
.bcard{flex:none;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.bhead{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px 9px 14px;border:0;background:var(--panel);text-align:left}
.bhead:hover{background:var(--panel2)}
.bini{width:30px;height:30px;border-radius:50%;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:10.5px;flex:none}
.sitem{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:0 10px;border:0;border-radius:8px;background:transparent;text-align:left;color:var(--ink2);font-weight:550}
.sitem:hover{background:var(--panel2)}
.sitem.on{background:var(--acc-soft);color:var(--acc-text);font-weight:700;box-shadow:inset 3px 0 0 var(--acc)}
.sgroup{font-size:10.5px;font-weight:700;letter-spacing:.08em;color:var(--ink3);padding:10px 8px 4px}
main{overflow:auto;min-width:0}
.page{padding:24px 32px 48px;display:flex;flex-direction:column;gap:18px}
.tools{border-left:1px solid var(--line);background:var(--panel);display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 0}
.tools button{position:relative;width:44px;height:44px;border-radius:11px;border:0;background:transparent;color:var(--ink2);display:flex;align-items:center;justify-content:center}
.tools button:hover{background:var(--panel2)}.tools button.on{background:var(--acc-soft);color:var(--acc-text)}
.drawer{position:fixed;top:var(--drawer-top,140px);right:60px;bottom:0;width:440px;background:var(--panel);border-left:1px solid var(--line);box-shadow:var(--shadow);z-index:30;display:flex;flex-direction:column}
.drawer iframe{flex:1;border:0;width:100%;background:var(--bg)}

/* Grelhas e tabelas */
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden}
.kpis>div{padding:16px 18px;border-right:1px solid var(--line)}.kpis>div:last-child{border-right:0}
.kpis .k{font-size:12px;color:var(--ink2);font-weight:600}.kpis .v{font-size:24px;font-weight:750;margin-top:4px;font-variant-numeric:tabular-nums}.kpis .s{font-size:12px;color:var(--ink3);margin-top:2px}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.pcard{overflow:hidden;display:flex;flex-direction:column}
.pcard .img{aspect-ratio:4/3;background:var(--panel2);display:flex;align-items:center;justify-content:center;position:relative;border:0;padding:8px;width:100%;border-bottom:1px solid var(--line)}
.pcard .img img{position:absolute;inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);max-width:none;max-height:none;object-fit:contain;mix-blend-mode:multiply}
html[data-theme="dark"] .pcard .img{background:oklch(0.93 0.004 265)}
.pcard .img .badge{position:absolute;right:8px;bottom:8px}
.pcard .meta{padding:12px 14px 4px;font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--ink2);display:flex;align-items:center;gap:6px;text-transform:uppercase}
.pcard .nm{padding:0 14px;font-weight:700;line-height:1.3;min-height:36px}
.pcard .cd{padding:4px 14px 0;font-size:12px;color:var(--ink2)}
.pcard .act{padding:10px 14px 14px;margin-top:auto}
.pcard.dim{opacity:.62}
.addbtn{width:100%;height:38px;border-radius:9px;border:1px solid var(--line);background:var(--panel);color:var(--acc-text);font-weight:650;display:flex;align-items:center;justify-content:center;gap:6px}
.addbtn.in{background:var(--acc-soft);border-color:transparent}
.tbl{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.tbl th{background:var(--panel2);font-size:11.5px;letter-spacing:.06em;color:var(--ink2);text-align:left;padding:10px 12px;font-weight:700;white-space:nowrap}
.tbl td{padding:10px 12px;border-top:1px solid var(--line)}
.tbl tr.click{cursor:pointer}.tbl tr.click:hover td{background:var(--panel2)}
.sales-page{gap:14px}
.sales-period{align-self:flex-start;max-width:100%;overflow:auto}
.sales-period button{height:34px}
.sales-filters{display:grid;grid-template-columns:minmax(260px,1.5fr) repeat(4,minmax(130px,1fr));gap:10px;align-items:end}
.sales-filters>label{display:flex;flex-direction:column;gap:5px;color:var(--ink2);font-size:12px;font-weight:650;min-width:0}
.sales-filters .input{height:38px;min-width:0}
.sales-category{display:flex;gap:2px;max-width:100%;overflow:auto}
.sales-category button{height:38px}
.sales-chart{padding:14px 18px 8px;min-width:0}
.sales-chart-title{display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:13px;font-weight:700;margin-bottom:8px}
.sales-chart-title span{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--ink2)}
.sales-chart-title i{width:9px;height:9px;border-radius:50%;display:inline-block}
.sales-chart svg{width:100%;height:auto;display:block;overflow:visible}
.sales-tables{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.4fr);gap:12px;align-items:start;min-width:0}
.sales-table{overflow:hidden;min-width:0}
.sales-table-head{min-height:48px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line)}
.sales-table-head span{font-size:12px;color:var(--ink3);white-space:nowrap}
.sales-table .table-scroll{overflow:auto;max-height:460px}
.sales-table .tbl td.r{text-align:right;white-space:nowrap}
.sales-table .tbl td.sales-positive{color:var(--ok);font-weight:700}
.sales-table .tbl td.sales-negative{color:var(--err);font-weight:700}
.sales-search{padding:9px 12px;border-bottom:1px solid var(--line)}
.sales-store-pick{display:flex;align-items:center;gap:9px;min-width:150px;cursor:pointer}
.sales-store-pick input{width:17px;height:17px;accent-color:var(--acc);flex:none}
.sales-store-pick span{display:flex;flex-direction:column;min-width:0}
.sales-store-pick small{font-size:11px;color:var(--ink3)}
.store-profile-list{display:flex;flex-direction:column;gap:7px;min-width:0}
.store-profile{border:1px solid var(--line);border-radius:10px;background:var(--panel);overflow:hidden}
.store-profile summary{display:flex;align-items:center;gap:10px;min-height:54px;padding:9px 12px;cursor:pointer;list-style:none}
.store-profile summary::-webkit-details-marker{display:none}
.store-profile-name{display:flex;flex:1;flex-direction:column;gap:2px;min-width:0}
.store-profile-name b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.store-profile-name small,.store-profile-fields small{font-size:11px;color:var(--ink3)}
.store-profile-caret{font-size:18px;color:var(--ink3);transition:transform .15s ease}
.store-profile[open] .store-profile-caret{transform:rotate(180deg)}
.store-profile-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 16px;padding:12px;border-top:1px solid var(--line);background:var(--panel2)}
.store-profile-fields>div{display:flex;flex-direction:column;gap:3px;min-width:0;overflow-wrap:anywhere}
.store-profile-fields b{font-size:13px;font-weight:550;line-height:1.35}
.store-profile-fields a{overflow-wrap:anywhere}
.store-profile-action{display:flex;justify-content:flex-end;padding:8px 12px}
.r{text-align:right!important}
.gtabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.gtabs button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px 14px;border-radius:12px;text-align:left;background:var(--panel2);border:1px solid var(--line)}
.gtabs button.on{background:var(--panel);border-color:var(--line2)}
.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.bulk-editor{display:flex;flex-direction:column;gap:12px;min-width:0}
.bulk-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.bulk-search{flex:1 1 260px;min-width:180px;max-width:420px}
.bulk-filter{display:flex;align-items:center;gap:7px;color:var(--ink3);font-size:10px;font-weight:700;letter-spacing:.06em}
.bulk-filter select,.bulk-field input,.bulk-field select,.bulk-field textarea{width:100%;min-width:0;border:1px solid var(--line2);border-radius:7px;background:var(--bg);color:var(--ink);font:500 13px Figtree,system-ui,sans-serif;padding:8px 9px;outline:none}
.bulk-filter select{height:38px}
.bulk-field input,.bulk-field select{height:38px}
.bulk-field textarea{min-height:76px;resize:vertical;line-height:1.4}
.bulk-field input:focus,.bulk-field select:focus,.bulk-field textarea:focus,.bulk-filter select:focus{border-color:var(--acc);box-shadow:0 0 0 2px var(--acc-soft)}
.bulk-count{margin-left:auto;font-size:12px;color:var(--ink2);white-space:nowrap}
.bulk-note{margin:0;color:var(--ink2);font-size:13px}
.bulk-list{display:flex;flex-direction:column;gap:8px;min-width:0}
.bulk-row{display:grid;grid-template-columns:minmax(105px,1.15fr) minmax(140px,1.6fr) minmax(105px,1fr) minmax(75px,.8fr) minmax(125px,1fr) minmax(95px,.8fr);align-items:start;gap:9px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.bulk-row.dirty{border-color:var(--acc);box-shadow:inset 3px 0 0 var(--acc)}
.bulk-identity{display:flex;flex-direction:column;gap:5px;min-width:0;padding:3px 0}
.bulk-identity b{font-size:13px;line-height:1.25;overflow-wrap:anywhere}
.bulk-identity .mono{font-size:11px;color:var(--ink2)}
.bulk-identity .badge{align-self:flex-start}
.bulk-group-heading,.product-group-heading{margin:8px 0 0;padding:10px 12px;border-left:3px solid var(--group-color);color:var(--ink);font-size:14px;font-weight:750}
.product-section{display:flex;flex-direction:column;gap:10px}
.product-group-heading{display:flex;align-items:center;justify-content:space-between;background:var(--panel2);border-radius:0 8px 8px 0}
.product-group-heading span{color:var(--ink2);font-size:12px;font-weight:600}
.trash-action{height:32px;padding:0 8px;font-size:11px;color:var(--err);white-space:normal;text-align:left}
.trash-list{display:flex;flex-direction:column;gap:8px}
.trash-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(140px,.7fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.trash-format{margin-top:4px;color:var(--ink2);font-size:12px}
.scroll-top{position:fixed;z-index:35;right:76px;bottom:20px;width:46px;height:46px;border:1px solid var(--line);border-radius:50%;background:var(--acc);color:var(--acc-ink);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;cursor:pointer}
.scroll-top .ic{font-size:25px}
.scroll-top[hidden]{display:none}
.bulk-field{display:flex;flex-direction:column;gap:5px;min-width:0;color:var(--ink3);font-size:9px;font-weight:700;letter-spacing:.05em}
.bulk-field-name{grid-column:auto}
.bulk-check{display:flex;align-items:center;gap:8px;min-height:38px;color:var(--ink);font-size:12px;font-weight:600;letter-spacing:0}
.bulk-check input{width:18px;height:18px;accent-color:var(--acc)}
.bulk-advanced{grid-column:2/-1;min-width:0;border-top:1px solid var(--line);padding-top:7px}
.bulk-advanced summary{width:max-content;max-width:100%;color:var(--acc-text);font-size:12px;font-weight:650;cursor:pointer}
.bulk-advanced>div{display:grid;grid-template-columns:minmax(120px,1fr) minmax(180px,1.5fr) minmax(120px,.8fr);gap:9px;padding-top:9px}
.orders{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(360px,1fr);gap:16px;min-height:540px}
.orders section{display:flex;flex-direction:column;min-height:0;overflow:hidden;max-height:calc(100vh - 290px)}
.order-context{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 200px;gap:10px}
.order-context>.card{display:flex;align-items:center;gap:10px;min-width:0;height:48px;padding:0 12px}
.order-context>.card>b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-context>.card>input{flex:1;min-width:0;border:0;background:transparent;outline:none;font-weight:650}
.order-picker-tools{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.order-picker-tools>.search{flex:1 1 170px;min-width:150px}.order-picker-tools .input{height:38px}
.order-brand-filter{width:auto;min-width:150px;max-width:210px;height:38px;padding:0 10px}
.order-pick-list,.order-selected-list{overflow:auto;flex:1;min-height:0;overscroll-behavior:contain}
.order-brand-heading,.order-group-heading{position:sticky;top:0;z-index:1;padding:8px 14px;background:var(--panel2);border-bottom:1px solid var(--line);font-size:11px;font-weight:750;letter-spacing:.06em;text-transform:uppercase}
.order-brand-heading span{float:right;color:var(--ink3);font-weight:600}
.order-group-heading{padding-top:10px}
.order-pick-row,.order-selected-row{gap:12px;padding:10px 12px;min-height:98px}
.order-thumb{width:82px;height:76px;flex:none;border-radius:8px;background:#f0f2f6;display:flex;align-items:center;justify-content:center;overflow:hidden}
.order-thumb img{width:100%;height:100%;object-fit:contain;padding:4px}
.order-pick-info,.order-selected-info{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.order-pick-info b,.order-selected-info b{font-size:13.5px;line-height:1.3}
.order-pick-info>span,.order-selected-info>span{font-size:12px;color:var(--ink2)}
.order-pick-action{width:130px;flex:none}
.order-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.order-list-head b{font-size:15px}.order-list-head>div>div,.order-review-footer>div:last-child{font-size:12.5px;color:var(--ink2)}
.order-selected-row .iconbtn{width:36px;height:36px}
.order-review-footer{padding:14px 16px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:10px;background:var(--panel2)}
.orow{display:flex;align-items:center;gap:12px;padding:8px 14px;border-bottom:1px solid var(--line)}
.orow.in{background:var(--acc-soft)}
.thumb{width:44px;height:36px;border-radius:7px;flex:none;background:oklch(0.95 0.004 265);display:flex;align-items:center;justify-content:center;overflow:hidden}
.thumb img{max-width:100%;max-height:100%;object-fit:contain}
.qty{display:flex;align-items:center;border:1px solid var(--line2);border-radius:9px;overflow:hidden;flex:none}
.qty.zero{border-color:var(--warn)}
.qty button{width:36px;height:36px;border:0;background:var(--panel2);font-size:18px;font-weight:700}
.qty input{width:48px;height:36px;border:0;text-align:center;background:var(--panel);outline:none;font-weight:700}
.ell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Diálogos */
.ov{position:fixed;inset:0;background:var(--overlay);display:flex;align-items:center;justify-content:center;z-index:60;padding:24px}
.dlg{width:100%;max-height:calc(100vh - 48px);background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}
.dlg header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 12px}
.dlg header h2{margin:2px 0 0;font-size:19px;font-weight:750}
.dlg header p{margin:3px 0 0;font-size:13px;color:var(--ink2)}
.dlg .content{overflow:auto;padding:4px 20px 20px;display:flex;flex-direction:column;gap:14px}
#toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);padding:12px 16px;border-radius:12px;background:var(--ink);color:var(--bg);font-weight:600;box-shadow:var(--shadow);z-index:80;max-width:560px}
.skel{background:var(--panel2);border-radius:6px}
.mobile-nav,.mobile-brands-toggle,.mobile-tools,.mobile-scrim{display:none}

/* Mobile shell: the same CRM hierarchy, with persistent primary navigation. */
@media (max-width:760px), (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  html,body{height:100%;min-height:100%;overflow:hidden}
  .shell{height:100dvh;min-height:0;grid-template-rows:calc(98px + env(safe-area-inset-top)) auto minmax(0,1fr) calc(64px + env(safe-area-inset-bottom))}
  .top{display:grid;grid-template-columns:minmax(0,1fr) 40px auto;grid-template-rows:42px 40px;gap:4px 8px;padding:calc(6px + env(safe-area-inset-top)) 12px 6px}
  .top .logo{grid-column:1;grid-row:1;width:auto;flex:auto;gap:8px}
  .top .logo i{width:23px;height:23px}
  .top .logo b{font-size:11px}
  .top .logo .badge{font-size:9px!important}
  .top .nav{display:none}
  .top .gsearch{grid-column:1/-1;grid-row:2;width:100%;min-width:0;max-width:none;margin:0}
  .top .gsearch .input{height:38px;font-size:16px}
  .top>.iconbtn{grid-column:2;grid-row:1;width:40px;height:40px}
  .top>div:last-child{grid-column:3;grid-row:1}
  .top>div:last-child>button{height:40px}
  .top>div:last-child>button>.ell{display:none}
  .ctxbar{display:grid;grid-template-columns:minmax(0,1fr) 40px;gap:8px;padding:8px 12px;background:var(--panel2)}
  .ctxbar>.eyebrow{display:none}
  .ctxbar>.ctx-choice{grid-column:1;min-width:0;justify-content:flex-start;overflow:hidden}
  .ctxbar>.ctx-choice .ic{margin-left:auto}
  .ctxbar>.mobile-brands-toggle{display:inline-flex;grid-column:2;grid-row:1;width:40px;height:40px}
  .ctxbar>.seg{grid-column:1/-1;width:100%;display:flex}
  .ctxbar>.seg button{flex:1;justify-content:center;min-width:0;padding:0 8px}
  .ctxbar>.ell,.ctxbar>.btn.ghost,.ctxbar>div[style*="margin-left:auto"]{display:none!important}
  .body{position:relative;grid-template-columns:minmax(0,1fr);min-height:0}
  .side,.tools{display:none}
  .side.mobile-open{display:flex;position:fixed;z-index:51;inset:0 auto 0 0;width:min(88vw,340px);padding:calc(12px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));border-right:1px solid var(--line);box-shadow:var(--shadow)}
  .mobile-scrim{display:block;position:fixed;z-index:50;inset:0;width:100%;height:100%;border:0;background:var(--overlay)}
  main{min-height:0;overscroll-behavior:contain}
  .page{width:100%;min-width:0;padding:18px 14px calc(22px + env(safe-area-inset-bottom));gap:14px}
  .page>*{min-width:0;max-width:100%}
  .input,.search .input{font-size:16px}
  .h1{font-size:24px;line-height:1.2}
  .page>div[style*="grid-template-columns:repeat(3"]{grid-template-columns:1fr!important;gap:8px!important}
  .page>div[style*="minmax(0,1.5fr)"]{grid-template-columns:1fr!important;gap:12px!important}
  .page>div[style*="grid-template-columns:120px 1fr"]{grid-template-columns:88px minmax(0,1fr)!important}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpis>div{padding:12px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
  .sales-period{width:100%;display:flex;overflow-x:auto}
  .sales-period button{flex:1;height:36px;padding:0 8px;font-size:12px}
  .sales-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .sales-category{grid-column:1/-1;width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
  .sales-category button{justify-content:center;padding:0 6px}
  .sales-tables{grid-template-columns:minmax(0,1fr)}
  .sales-table .table-scroll{max-height:48dvh}
  .sales-table .tbl{min-width:460px}
  .sales-chart{padding:12px 10px 6px}
  .sales-chart-title{gap:8px}
  .kpis>div:nth-child(2n){border-right:0}
  .kpis>div:nth-last-child(-n+2){border-bottom:0}
  .kpis .v{font-size:20px}
  .pgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .pcard{min-width:0;border-radius:10px}
  .pcard .img{aspect-ratio:1/0.82}
  .pcard .meta{padding:9px 10px 3px;font-size:10px}
  .pcard .nm{padding:0 10px;font-size:13px;min-height:0}
  .pcard .cd{padding:4px 10px 0;font-size:11px}
  .pcard .act{padding:9px 10px 10px}
  .addbtn{height:40px;font-size:12px;padding:0 5px}
  .gtabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .gtabs button{padding:10px;min-width:0}
  .gtabs button span{font-size:11px!important;line-height:1.3}
  .toolbar{padding:8px;gap:8px}
  .toolbar>.search{flex:1 1 100%!important;min-width:0!important;max-width:none!important}
  .toolbar>.seg{max-width:100%;overflow:auto}
  .toolbar>.seg button{padding:0 8px;font-size:12px}
  .toolbar>div[style*="flex-wrap:wrap"]{max-width:100%;overflow:auto;flex-wrap:nowrap!important;padding-bottom:2px}
  .toolbar>.eyebrow{display:none}
  .bulk-toolbar{align-items:stretch;padding:8px;gap:7px}
  .bulk-search{flex:1 1 100%;min-width:0;max-width:none}
  .bulk-filter{flex:1 1 100%;justify-content:space-between}
  .bulk-filter select{flex:1;max-width:65%}
  .bulk-count{flex:1 1 100%;margin:0;align-self:center}
  .bulk-toolbar>.btn{flex:1 1 auto;justify-content:center;padding:0 9px;font-size:12px}
  .bulk-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px;padding:10px}
  .bulk-identity,.bulk-field-name,.bulk-advanced{grid-column:1/-1}
  .bulk-identity{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
  .bulk-identity b{grid-column:1/-1}
  .bulk-identity .badge{grid-column:2;grid-row:2}
  .bulk-identity .trash-action{grid-column:1/-1;justify-self:start}
  .trash-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .trash-row .bulk-identity{grid-column:1/-1}
  .trash-row>.btn{grid-column:1/-1;justify-self:start}
  .scroll-top{right:14px;bottom:calc(76px + env(safe-area-inset-bottom));width:44px;height:44px}
  .bulk-advanced>div{grid-template-columns:minmax(0,1fr)}
  .bulk-field input,.bulk-field select{height:42px;font-size:16px}
  .bulk-field textarea{font-size:16px}
  .orders{grid-template-columns:minmax(0,1fr);gap:12px;min-height:0}
  .page>div[style*="minmax(0,1.2fr)"]{grid-template-columns:minmax(0,1fr)!important}
  .orders section{min-height:260px;max-height:none;overflow:visible}
  .orders section[aria-label="Selecionar produtos"]{min-height:360px}
  .orders section[aria-label="Lista de encomenda"]{min-height:250px}
  .orders .orow{gap:8px;padding:9px 10px}
  .orders .orow>span[style*="width:120px"]{width:92px!important}
  .orders .qty button{width:34px;height:38px}
  .orders .qty input{width:40px;height:38px}
  .mobile-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;position:relative;z-index:20;padding:4px 4px calc(4px + env(safe-area-inset-bottom));background:var(--panel);border-top:1px solid var(--line)}
  .mobile-nav button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:54px;padding:2px 0;border:0;border-radius:8px;background:transparent;color:var(--ink2);font-size:10px;font-weight:650}
  .mobile-nav button .ic{font-size:21px}
  .mobile-nav button.on{background:var(--acc-soft);color:var(--acc-text)}
  .mobile-nav-count{position:absolute;top:0;right:calc(50% - 22px);min-width:16px;padding:1px 4px;border-radius:9px;background:var(--acc);color:var(--acc-ink);font:600 10px/1.3 Figtree,system-ui,sans-serif}
  .mobile-tools{display:flex;position:fixed;z-index:45;right:8px;bottom:calc(70px + env(safe-area-inset-bottom));width:min(270px,calc(100vw - 16px));padding:6px;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
  .mobile-tools button{display:flex;align-items:center;gap:10px;min-height:46px;padding:0 10px;border:0;border-radius:8px;background:transparent;text-align:left}
  .mobile-tools button:hover{background:var(--panel2)}
  .drawer{top:auto!important;left:0;right:0;bottom:0;width:100%;height:min(84dvh,760px);border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom)}
  .ov{align-items:flex-end;padding:0}
  .dlg{max-height:calc(100dvh - 12px);border-radius:16px 16px 0 0}
  .dlg header{padding:16px 16px 10px}
  .dlg .content{padding:4px 16px calc(18px + env(safe-area-inset-bottom))}
  .tbl{min-width:680px}
  .store-profile-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px}
  #toast{bottom:calc(74px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);width:max-content;text-align:center}
}

/* Dedicated order workspace: reclaim the shell chrome while keeping the draft in memory. */
.order-launch{min-height:100%;display:grid;place-items:center;padding:28px}
.order-launch-content{width:min(100%,560px);display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:42px 30px;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}
.order-launch-icon,.order-workspace-mark{display:grid;place-items:center;width:58px;height:58px;border-radius:15px;background:var(--acc-soft);color:var(--acc-text)}
.order-launch-icon .ic{font-size:30px}
.order-launch-content .eyebrow{font-size:11px}
.order-launch-content h1{margin:0;font-size:26px;line-height:1.2}
.order-launch-content p{max-width:440px;margin:0;color:var(--ink2);line-height:1.55}
.order-launch-context{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;color:var(--ink2);font-size:13px}
.order-launch-context .ic{color:var(--acc-text)}
.order-launch-cta{min-width:230px;margin-top:6px}
.order-resume-dock{position:fixed;z-index:42;right:22px;bottom:22px;display:flex;align-items:center;gap:10px;min-height:58px;padding:8px 14px;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:var(--shadow);color:var(--ink);text-align:left}
.order-resume-dock>.ic:first-child{color:var(--acc-text)}
.order-resume-dock>span{display:flex;flex-direction:column;gap:1px}
.order-resume-dock small{color:var(--ink2);font-size:12px}
.order-workspace{height:100%;min-height:0;display:grid;grid-template-rows:58px auto minmax(0,1fr);gap:10px;padding:12px 16px;background:var(--bg)}
.order-workspace-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2px}
.order-workspace-head>div{display:flex;align-items:center;gap:12px;min-width:0}
.order-workspace-head>div>span:last-child{display:flex;flex-direction:column;min-width:0}
.order-workspace-head b{font-size:17px}
.order-workspace-head small{color:var(--ink2);font-size:12px}
.order-workspace-mark{width:40px;height:40px;border-radius:11px;flex:none}
.order-minimize{height:38px}
.order-workspace .order-context{gap:8px}
.order-workspace .order-context>.card{height:44px}
.order-workspace .orders{grid-template-columns:minmax(0,1.45fr) minmax(340px,.85fr);gap:12px;min-height:0;height:100%;overflow:hidden}
.order-workspace .orders section{height:auto;min-height:0;max-height:none}
.order-workspace .order-picker-tools{padding:8px;gap:7px}
.order-workspace .order-pick-row,.order-workspace .order-selected-row{min-height:82px}
.order-pane-switch{display:none}
.shell.order-focus .top,.shell.order-focus .ctxbar,.shell.order-focus .mobile-nav,.shell.order-focus .mobile-tools,.shell.order-focus #scroll-top{display:none!important}
.shell.order-focus .body{position:fixed;inset:0;z-index:55;display:block;width:100%;height:100dvh;min-height:0;overflow:hidden;background:var(--bg)}
.shell.order-focus .side,.shell.order-focus .tools{display:none!important}
.shell.order-focus #main{width:100%;height:100%;overflow:hidden;min-height:0}
@media (min-width:761px) and (max-width:1100px) and (orientation:portrait), (max-width:760px) and (orientation:portrait){
  .order-launch{padding:16px}
  .order-launch-content{padding:30px 22px}
  .order-launch-content h1{font-size:23px}
  .order-resume-dock{left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));justify-content:center}
  .order-workspace{grid-template-rows:54px auto 48px minmax(0,1fr);gap:7px;padding:calc(5px + env(safe-area-inset-top)) 10px 8px}
  .order-workspace-head{min-height:48px}
  .order-workspace-head b{font-size:15px}
  .order-workspace-mark{width:36px;height:36px}
  .order-minimize{width:40px;height:40px;padding:0}
  .order-minimize>span:not(.ic){display:none}
  .order-workspace .order-context{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) 132px;gap:5px}
  .order-workspace .order-context>.card{height:40px;min-width:0;padding:0 7px;gap:5px}
  .order-workspace .order-context .eyebrow{font-size:9px}
  .order-workspace .order-context .btn{height:30px;padding:0 7px;font-size:11px}
  .order-pane-switch{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:3px;border:1px solid var(--line);border-radius:11px;background:var(--panel2)}
  .order-pane-switch button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;border:0;border-radius:8px;background:transparent;color:var(--ink2);font-weight:650}
  .order-pane-switch button.on{background:var(--panel);color:var(--acc-text);box-shadow:0 1px 3px #10182820}
  .order-pane-switch button>span:last-child{font-size:11px;opacity:.8}
  .order-workspace .orders{display:grid;grid-template-columns:minmax(0,1fr)!important;gap:0}
  .order-workspace .orders>.card{height:100%;width:100%;min-height:0}
  .order-workspace[data-pane="products"] .order-panel-list,.order-workspace[data-pane="list"] .order-panel-picker{display:none}
  .order-workspace .order-picker-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:7px}
  .order-workspace .order-picker-tools>.seg{grid-column:1/-1;grid-row:1;width:100%;overflow:auto;flex:none}
  .order-workspace .order-picker-tools>.seg button{height:32px;padding:0 9px;font-size:12px}
  .order-workspace .order-picker-tools>.search{grid-column:1;grid-row:2;min-width:0}
  .order-workspace .order-picker-tools>.order-brand-filter{grid-column:1;grid-row:3;width:100%;max-width:none;height:36px}
  .order-workspace .order-picker-tools>[data-a="selVisible"]{grid-column:2;grid-row:2/4;height:100%;min-height:36px;padding:0 9px;white-space:normal}
  .order-workspace .order-picker-tools .input{height:36px}
  .order-workspace .order-pick-row,.order-workspace .order-selected-row{min-height:76px;padding:8px;gap:8px}
  .order-workspace .order-thumb{width:66px;height:62px}
  .order-workspace .order-pick-action{width:104px}
  .order-workspace .order-pick-action .addbtn{height:36px;font-size:11px}
  .order-workspace .order-list-head{padding:10px 12px}
  .order-workspace .order-review-footer{padding:9px;gap:6px}
  .order-workspace .order-review-footer>div:last-child{font-size:11px;text-align:center}
}
@media (max-width:420px) and (orientation:portrait){
  .order-workspace{grid-template-rows:50px auto 46px minmax(0,1fr);gap:6px;padding:calc(4px + env(safe-area-inset-top)) 7px 6px}
  .order-workspace .order-context{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .order-workspace .order-context>.card:last-child{grid-column:1/-1}
  .order-workspace .order-context>.card{height:36px}
  .order-workspace .order-picker-tools>[data-a="selVisible"]{font-size:11px}
  .order-workspace .order-pick-info b,.order-workspace .order-selected-info b{font-size:12px}
}
@media (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  .order-workspace{grid-template-rows:42px 38px minmax(0,1fr);gap:5px;padding:calc(3px + env(safe-area-inset-top)) 8px 4px}
  .order-workspace-head{min-height:38px}
  .order-workspace-head b{font-size:14px}
  .order-workspace-head small{font-size:10px}
  .order-workspace-mark{width:32px;height:32px}
  .order-minimize{height:34px}
  .order-workspace .order-context{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 132px;gap:5px}
  .order-workspace .order-context>.card{height:36px;padding:0 6px}
  .order-pane-switch{display:none}
  .order-workspace .orders{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)!important;gap:7px}
  .order-workspace .order-picker-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;padding:5px}
  .order-workspace .order-picker-tools>.seg{grid-column:1/-1;grid-row:1;overflow:auto}
  .order-workspace .order-picker-tools>.search{grid-column:1;grid-row:2;min-width:0}
  .order-workspace .order-picker-tools>.order-brand-filter{grid-column:1;grid-row:3;width:100%;max-width:none;height:28px}
  .order-workspace .order-picker-tools>[data-a="selVisible"]{grid-column:2;grid-row:2/4;min-height:28px;padding:0 6px;font-size:10px}
  .order-workspace .order-picker-tools .input{height:28px;min-height:28px;font-size:12px}
  .order-workspace .order-picker-tools>.seg button{height:25px;padding:0 6px;font-size:10px}
  .order-workspace .order-pick-row,.order-workspace .order-selected-row{min-height:56px;padding:4px;gap:5px}
  .order-workspace .order-thumb{width:48px;height:46px}
  .order-workspace .order-pick-info b,.order-workspace .order-selected-info b{font-size:11px}
  .order-workspace .order-pick-info>span,.order-workspace .order-selected-info>span{font-size:10px}
  .order-workspace .order-pick-action{width:80px}
  .order-workspace .order-pick-action .addbtn{height:30px;font-size:10px}
  .order-workspace .order-review-footer{padding:5px;gap:4px}
  .order-workspace .order-review-footer .btn{height:32px}
  .order-workspace .order-review-footer>div:last-child{font-size:9px}
  .order-workspace .order-list-head{padding:6px 8px}
}

/* Unified left navigation and compact, persistent minimized panels. */
.body{grid-template-columns:292px minmax(0,1fr)}
.tools{display:none!important}
.side{gap:5px;padding:12px 10px 22px}
.side .lbl{padding-left:9px}
.sitem{min-height:46px;gap:10px;padding:5px 9px}
.sitem>.ic{align-self:flex-start;margin-top:3px;color:var(--acc-text);font-size:19px}
.sitem-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:1px}
.sitem-title{font-size:11px;font-weight:700;line-height:1.3;text-transform:uppercase}
.sitem-copy small{overflow:hidden;color:var(--ink3);font-size:10.5px;font-weight:450;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.sitem.on .sitem-copy small{color:var(--acc-text);opacity:.85}
.side .sgroup{font-size:10px;padding:10px 8px 3px}
.top .nav{display:none!important}
.drawer{right:16px;width:min(440px,calc(100vw - 330px));border:1px solid var(--line);border-radius:12px 12px 0 0;overflow:hidden}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:9px 12px 9px 16px;border-bottom:1px solid var(--line);background:var(--panel)}
.drawer-head>b{font-size:14px;text-transform:uppercase}
.drawer-actions{display:flex;align-items:center;gap:6px}
.drawer-minimize{background:var(--acc);border-color:var(--acc);color:var(--acc-ink)}
.drawer.minimized{visibility:hidden;pointer-events:none;transform:translateX(calc(100% + 30px))}
.resume-docks{position:fixed;z-index:42;right:18px;bottom:84px;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:calc(100vw - 24px)}
.order-resume-dock,.tool-resume-dock{position:static;width:max-content;max-width:min(330px,calc(100vw - 24px));min-height:48px;padding:7px 12px;border:1px solid var(--acc);border-radius:11px;background:var(--acc);box-shadow:var(--shadow);color:var(--acc-ink)}
.order-resume-dock{display:flex;align-items:center;gap:8px;text-align:left}
.order-resume-dock>span{display:flex;flex-direction:column;gap:0}
.order-resume-dock b{font-size:11px;line-height:1.2}
.order-resume-dock small{color:var(--acc-ink);font-size:10px;opacity:.82;line-height:1.15}
.order-resume-dock>.ic,.tool-resume-dock>.ic{color:var(--acc-ink)}
.tool-resume-dock{display:flex;align-items:center;justify-content:flex-start;gap:8px;text-align:left}
.tool-resume-dock>span{overflow:hidden;font-size:11px;font-weight:750;text-overflow:ellipsis;white-space:nowrap}
.order-minimize{background:var(--acc)!important;border-color:var(--acc)!important;color:var(--acc-ink)!important}
.order-minimize:hover,.drawer-minimize:hover{filter:brightness(1.08)}
.scroll-top{right:18px;bottom:20px}
.pcard .img{box-sizing:border-box}
@media (max-width:760px), (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  .shell{grid-template-rows:calc(98px + env(safe-area-inset-top)) auto minmax(0,1fr)!important}
  .body{grid-template-columns:minmax(0,1fr)!important}
  .side{display:none}
  .side.mobile-open{display:flex}
  .mobile-nav,.mobile-tools{display:none!important}
  .ctxbar>.mobile-brands-toggle{display:inline-flex}
  .resume-docks{right:10px;bottom:calc(14px + env(safe-area-inset-bottom));max-width:calc(100vw - 20px)}
  .order-resume-dock,.tool-resume-dock{max-width:calc(100vw - 20px);min-height:46px}
  .scroll-top{right:12px;bottom:calc(74px + env(safe-area-inset-bottom))}
  .drawer{left:0;right:0;width:100%;height:min(84dvh,760px);top:auto!important;bottom:0;border-radius:16px 16px 0 0}
  .drawer-head{min-height:58px;padding-top:max(9px,env(safe-area-inset-top))}
  #toast{bottom:calc(16px + env(safe-area-inset-bottom))}
}
@media (min-width:761px) and (max-width:1100px){
  .body{grid-template-columns:264px minmax(0,1fr)}
  .drawer{width:min(440px,calc(100vw - 280px))}
}
@media (max-width:380px){
  .page{padding-left:11px;padding-right:11px}
  .ctxbar>.seg button{font-size:12px;padding:0 5px}
  .ctxbar>.seg .ic{font-size:17px}
  .pcard .img .badge{right:5px;bottom:5px;font-size:10px;padding:3px 6px}
  .pcard .nm{font-size:12px}
  .store-profile summary{gap:6px;padding:8px}
  .store-profile summary>.badge{font-size:10px;padding:3px 6px}
  .store-profile-fields{grid-template-columns:minmax(0,1fr);gap:8px}
  .sales-period button{font-size:11px;padding:0 5px}
  .sales-filters{grid-template-columns:minmax(0,1fr)}
  .sales-category{grid-column:1}
}

@media (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  html,body{overflow-x:hidden}
  .shell{width:100vw;height:100dvh;min-height:0;min-width:0;overflow:hidden}
  .body{width:100%;min-width:0;grid-template-columns:220px minmax(0,1fr) 52px;overflow:hidden}
  .top{gap:7px;padding-left:12px;padding-right:10px}
  .top .logo{width:135px;flex-basis:135px}
  .nav button{gap:5px;padding:0 7px;font-size:12.5px}
  .gsearch{min-width:115px}
  .page{min-height:100%;padding:20px 22px 32px;gap:16px}
  .pgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .bulk-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bulk-identity,.bulk-field-name,.bulk-advanced{grid-column:1/-1}
  .orders{grid-template-columns:minmax(0,1fr);gap:12px;min-height:0}
  .orders section{max-height:none;height:min(58dvh,720px)}
  .sales-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sales-category{grid-column:1/-1;width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
  .sales-category button{justify-content:center;padding:0 7px}
  .sales-tables{grid-template-columns:minmax(0,1fr)}
  .sales-table .table-scroll{max-height:420px}
  .drawer{inset:0!important;width:100vw;height:100dvh;border:0;z-index:70}
  .drawer>div:first-child{min-height:58px;padding-top:max(12px,env(safe-area-inset-top))!important}
}

@media (max-width:760px), (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  .order-context{grid-template-columns:minmax(0,1fr);gap:8px}
  .order-context>.card{height:46px}
  .order-picker-tools{gap:7px;padding:9px;align-items:stretch}
  .order-picker-tools>.seg{flex:1 1 100%;max-width:100%;overflow:auto}
  .order-picker-tools>.search{flex:1 1 100%;min-width:0}
  .order-brand-filter{flex:1;max-width:none;min-width:0}
  .orders section[aria-label="Selecionar produtos"]{height:min(66dvh,650px);min-height:400px;overflow:hidden}
  .orders section[aria-label="Lista de encomenda"]{height:min(58dvh,570px);min-height:300px;overflow:hidden}
  .order-pick-row,.order-selected-row{gap:8px;padding:8px;min-height:88px}
  .order-thumb{width:78px;height:76px}
  .order-pick-action{width:92px}
  .order-pick-action .addbtn{font-size:11px}
  .order-selected-row .qty button{width:32px}
  .order-selected-row .qty input{width:38px}
  .order-selected-row .iconbtn{width:32px;height:34px}
}

@media (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  .shell{grid-template-rows:42px auto minmax(0,1fr) 56px}
  .top{grid-template-columns:auto minmax(0,1fr) 34px auto;grid-template-rows:34px;gap:2px 8px;padding:4px 10px}
  .top .logo i{width:20px;height:20px}
  .top .logo{grid-column:1;grid-row:1}
  .top .gsearch{grid-column:2;grid-row:1;width:100%;min-width:0;margin:0}
  .top .gsearch .input{height:32px}
  .top>.iconbtn{grid-column:3;grid-row:1;width:34px;height:34px;min-height:34px}
  .top>div:last-child{grid-column:4;grid-row:1}
  .top>.iconbtn,.top>div:last-child>button{height:34px;min-height:34px}
  .ctxbar{grid-template-columns:minmax(160px,.8fr) 36px minmax(220px,1fr);grid-template-rows:34px;gap:6px;padding:6px 10px}
  .ctxbar>.ctx-choice{grid-column:1;grid-row:1;height:34px;min-height:34px}
  .ctxbar>.mobile-brands-toggle{grid-column:2;grid-row:1;height:34px;width:36px}
  .ctxbar>.seg{grid-column:3;grid-row:1;width:100%;height:34px}
  .ctxbar>.seg button{height:32px}
  .page{padding:10px 12px 14px;gap:9px}
  .order-page{gap:6px}
  .order-page>div:first-child{align-items:center}
  .order-page>div:first-child .eyebrow{display:none}
  .order-page>div:first-child .h1{font-size:19px;line-height:1.1;margin:0}
  .order-context{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 158px;gap:6px}
  .order-context>.card{height:40px;padding:0 7px;gap:6px}
  .order-context .eyebrow{font-size:9px}
  .orders{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:8px}
  .orders section[aria-label="Selecionar produtos"],.orders section[aria-label="Lista de encomenda"]{height:calc(100dvh - 230px);min-height:110px;max-height:none}
  .order-picker-tools{display:grid;grid-template-columns:minmax(60px,1fr) minmax(70px,1fr) auto;grid-template-rows:28px 30px;padding:5px;gap:4px}
  .order-picker-tools>.seg{grid-column:1/-1;grid-row:1;max-width:100%;overflow:auto;flex:none}
  .order-picker-tools>.search{grid-column:1;grid-row:2;min-width:0}
  .order-picker-tools>.order-brand-filter{grid-column:2;grid-row:2;min-width:0;max-width:none;width:100%;padding:0 5px;font-size:11px}
  .order-picker-tools>[data-a="selVisible"]{grid-column:3;grid-row:2;height:30px;padding:0 7px;font-size:10px}
  .order-picker-tools>.seg button{height:28px;padding:0 7px;font-size:11px}
  .order-picker-tools .input,.order-brand-filter{height:32px;min-height:32px}
  .order-pick-row,.order-selected-row{min-height:72px;padding:6px;gap:6px}
  .order-thumb{width:54px;height:58px}
  .order-pick-action{width:82px}
  .order-pick-action .addbtn{height:32px;font-size:10px}
  .order-selected-row .qty button{width:27px;height:30px}
  .order-selected-row .qty input{width:34px;height:30px}
  .order-review-footer{padding:7px;gap:5px}
  .order-review-footer .btn{height:36px}
}

@media (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  .body{grid-template-columns:220px minmax(0,1fr)!important}
  .tools{display:none!important}
  .top .nav{display:none!important}
  .shell{grid-template-rows:60px 48px minmax(0,1fr)!important}
}

@media (min-width:1001px) and (max-width:1440px) and (orientation:landscape){
  .order-workspace .orders{grid-template-columns:minmax(0,1.45fr) minmax(360px,.9fr)}
  .order-workspace .order-picker-tools{display:grid;grid-template-columns:minmax(190px,1.15fr) minmax(90px,1fr) minmax(90px,.8fr) auto;align-items:center;gap:5px;padding:6px}
  .order-workspace .order-picker-tools>.seg{display:flex;min-width:0;max-width:100%;overflow:auto;flex:none}
  .order-workspace .order-picker-tools>.seg button{flex:none;height:34px;padding:0 6px;font-size:12px;white-space:nowrap}
  .order-workspace .order-picker-tools>.search{min-width:0;width:100%}
  .order-workspace .order-picker-tools>.search .input,.order-workspace .order-picker-tools>.order-brand-filter{width:100%;min-width:0;max-width:none;height:36px}
  .order-workspace .order-picker-tools>[data-a="selVisible"]{height:36px;padding:0 7px;font-size:12px;white-space:nowrap}
  .order-workspace .order-pick-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:8px;padding:8px}
  .order-workspace .order-group-heading,.order-workspace .order-brand-heading{grid-column:1/-1;margin:-8px -8px 0}
  .order-workspace .order-brand-heading{margin-top:0}
  .order-workspace .order-pick-row{display:grid;grid-template-columns:82px minmax(0,1fr);grid-template-rows:minmax(58px,1fr) auto;align-items:center;gap:6px 9px;min-width:0;min-height:136px;padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
  .order-workspace .order-thumb{grid-column:1;grid-row:1/-1;width:82px;height:76px}
  .order-workspace .order-pick-info{grid-column:2;grid-row:1;align-self:end}
  .order-workspace .order-pick-info b{font-size:13px}
  .order-workspace .order-pick-info>span{font-size:11px}
  .order-workspace .order-pick-action{grid-column:2;grid-row:2;width:100%;align-self:start}
  .order-workspace .order-pick-action .addbtn{height:34px;font-size:12px}
}
