:root{color-scheme:dark;--bg:#06182d;--navy:#0d2e50;--navy2:#123b65;--panel:#0d3054;--line:#2c6697;--text:#f7f9fc;--muted:#adc4da;--red:#ed1c3b;--red2:#ff3b59;--blue:#54b8ff;--green:#53d6a0;--yellow:#ffc85a;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;min-height:100vh;background:radial-gradient(circle at 95% 0,#123e68 0,transparent 36rem),var(--bg);color:var(--text)}button,input,select{font:inherit}button{border:0;cursor:pointer}.mobile-header{position:sticky;z-index:30;top:0;display:flex;align-items:center;justify-content:space-between;height:64px;padding:8px 16px;border-bottom:1px solid rgba(79,143,195,.35);background:rgba(6,24,45,.94);backdrop-filter:blur(16px)}.mobile-header>a,.sidebar-brand{display:flex;align-items:center;gap:10px;color:var(--text);font-size:20px;text-decoration:none}.mobile-header img,.sidebar-brand img{width:38px;height:38px;object-fit:contain}.mobile-header>div{display:flex;align-items:center;gap:8px}.mobile-header button,.icon-button,.secondary{border:1px solid var(--line);border-radius:10px;padding:10px 13px;background:transparent;color:var(--text)}.icon-button{display:grid;width:42px;height:42px;padding:0;place-items:center;font-size:24px}#cloud-status{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:12px}#cloud-status:before{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 10px var(--green);content:""}#cloud-status.offline:before{background:var(--yellow);box-shadow:none}.mobile-sidebar{position:fixed;z-index:50;top:0;bottom:0;left:0;display:none;width:min(310px,87vw);padding:20px 14px;background:#0c3156;box-shadow:20px 0 60px rgba(0,0,0,.35);transform:translateX(-105%);transition:transform .22s ease}.app-ready .mobile-sidebar{display:flex;flex-direction:column}.mobile-sidebar.open{transform:translateX(0)}.sidebar-brand{padding:0 7px 20px;border-bottom:1px solid rgba(106,163,210,.25);font-size:24px}.sidebar-brand .icon-button{margin-left:auto}.mobile-sidebar nav{display:grid;gap:5px;overflow:auto;margin:18px 0}.mobile-sidebar nav button,.sidebar-footer button{display:flex;align-items:center;gap:13px;width:100%;min-height:52px;padding:12px 15px;border-radius:12px;background:transparent;color:#d3e2ef;font-weight:800;text-align:left}.mobile-sidebar nav button span{display:grid;width:27px;place-items:center;font-size:20px}.mobile-sidebar nav button.active,.mobile-sidebar nav button:hover{background:var(--red);color:#fff}.sidebar-footer{display:grid;gap:5px;margin-top:auto}.sidebar-footer>div{padding:14px;border:1px solid #78d7ba;border-radius:12px;color:#d9fff2;font-weight:800}.menu-backdrop{position:fixed;z-index:45;inset:0;background:rgba(0,8,18,.7)}main{width:100%;margin:auto;padding:24px 16px calc(42px + env(safe-area-inset-bottom))}.app-ready main{max-width:1500px}.eyebrow{color:var(--blue);font-size:12px;font-weight:900;letter-spacing:.16em}.mobile-auth{display:grid;gap:28px;max-width:900px;margin:8vh auto 0}.mobile-auth h1,.mobile-title h1,.page-heading h1{margin:8px 0;font-size:clamp(34px,8vw,58px);line-height:1}.mobile-auth p,.mobile-title p,.page-heading p{color:var(--muted)}.mobile-auth form,.mobile-panel,.panel,dialog form{padding:22px;border:1px solid var(--line);border-radius:20px;background:rgba(13,48,84,.93);box-shadow:0 24px 70px rgba(0,0,0,.18)}label{display:grid;gap:8px;margin:0 0 15px;color:#dbe8f5;font-size:14px;font-weight:750}input,select{width:100%;min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;outline:none;background:#071e38;color:var(--text)}input[type=file]{padding:10px}input:focus,select:focus{border-color:#61beff;box-shadow:0 0 0 3px rgba(97,190,255,.14)}.primary,.mobile-auth button[type=submit],.license-picker button{min-height:46px;padding:11px 17px;border-radius:11px;background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;font-weight:850;box-shadow:0 9px 24px rgba(237,28,59,.22)}button:disabled{cursor:not-allowed;opacity:.5}.compact{min-height:40px;padding:9px 13px}.message{min-height:20px;margin:10px 0 0;color:var(--muted);font-size:13px}.message.error{color:#ff8fa1}.message.success{color:var(--green)}.mobile-panel{max-width:820px;margin:5vh auto}.license-picker{display:grid;gap:12px;margin-top:24px}.license-card{display:grid;grid-template-columns:1fr auto;gap:12px;padding:17px;border:1px solid var(--line);border-radius:15px;background:#081f3a}.license-card h3{margin:0 0 5px}.license-card p{margin:3px 0;color:var(--muted);font-size:13px}.license-card code{color:#cfe9ff}.license-card button{align-self:center}.page-heading{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:22px}.page-heading h1{font-size:clamp(34px,6vw,54px)}.mobile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-bottom:20px}.stat{min-height:112px;padding:17px;border:1px solid var(--line);border-radius:15px;background:linear-gradient(145deg,var(--panel),#0a2848)}.stat.featured{border-top:4px solid var(--red)}.stat span{display:block;color:var(--muted);font-size:13px}.stat strong{display:block;margin-top:10px;font-size:clamp(22px,4vw,32px)}.dashboard-grid{display:grid;gap:16px}.panel h2,.section-title h2{margin:0;font-size:20px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.section-title p{margin:3px 0;color:var(--muted);font-size:13px}.section-title>strong{color:#7fcaff;font-size:22px}.link-button{padding:6px;background:transparent;color:#7fcaff}.monitor-row,.summary-row,.report-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0;border-bottom:1px solid rgba(83,138,183,.28)}.monitor-row:last-child,.summary-row:last-child,.report-row:last-child{border-bottom:0}.monitor-row span,.summary-row span,.report-row span{color:var(--muted)}.danger-text{color:#ff7389!important}.success-text{color:var(--green)!important}.status-pill{padding:8px 12px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;font-weight:850}.status-pill.open{border-color:#4cbf92;color:#9affd8}.status-pill.closed{border-color:#d47786;color:#ffafba}.sale-layout{display:grid;gap:18px}.search{margin-bottom:16px}.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.sale-product{overflow:hidden;min-height:180px;padding:0;border:1px solid var(--line);border-radius:15px;background:var(--panel);color:var(--text);text-align:left}.sale-product img,.product-thumb{width:100%;height:100px;object-fit:cover;background:#071e38}.sale-product .product-placeholder,.product-placeholder{display:grid;width:100%;height:100px;place-items:center;background:linear-gradient(135deg,#0c2947,#174a77);color:#82bce9;font-size:30px}.sale-product>div:last-child{padding:12px}.sale-product strong,.sale-product span,.sale-product small{display:block}.sale-product strong{overflow:hidden;margin-bottom:8px;text-overflow:ellipsis;white-space:nowrap}.sale-product span{color:#7dcbff;font-weight:850}.sale-product small{margin-top:4px;color:var(--muted)}.cart{align-self:start}.cart label{margin-top:15px}.cart-line{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid rgba(59,102,141,.35)}.cart-line p{margin:3px 0;color:var(--muted);font-size:12px}.quantity{display:flex;align-items:center;gap:8px}.quantity button{width:34px;height:34px;border:1px solid var(--line);border-radius:9px;background:#061a31;color:#fff}.empty{grid-column:1/-1;padding:28px 16px;border:1px dashed var(--line);border-radius:15px;color:var(--muted);text-align:center}.product-list,.entity-list,#mobile-sales{display:grid;gap:10px}.product-row,.entity-row,.sale-row{display:grid;grid-template-columns:72px 1fr auto;align-items:center;gap:14px;padding:13px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}.product-row .product-thumb,.product-row .product-placeholder{width:72px;height:72px;border-radius:10px}.product-row h3,.entity-row h3,.sale-row h3{margin:0 0 5px;font-size:16px}.product-row p,.entity-row p,.sale-row p{margin:3px 0;color:var(--muted);font-size:13px}.product-row button,.entity-row button{padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:#071e38;color:#fff}.entity-row,.sale-row{grid-template-columns:1fr auto}.price{color:#7fd0ff;font-weight:850}.profit{color:var(--green);font-weight:800}.warning{color:var(--yellow)}.cash-hero{display:grid;gap:14px;margin-bottom:16px}.cash-balance{text-align:center}.cash-balance span{color:var(--muted)}.cash-balance strong{display:block;margin:8px 0;font-size:42px}.button-row{display:flex;flex-wrap:wrap;gap:9px}.cash-movements{margin-top:18px}.report-history{margin-top:16px}.report-history h2{margin:0 0 15px}.sale-row strong{font-size:17px}.sale-row time{display:block;margin-top:4px;color:var(--muted);font-size:12px}dialog{width:min(760px,calc(100% - 22px));max-height:92vh;padding:0;border:0;border-radius:20px;background:transparent;color:var(--text)}dialog::backdrop{background:rgba(0,7,17,.8);backdrop-filter:blur(4px)}dialog form{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;overflow:auto;max-height:92vh}.dialog-heading,.dialog-actions,.image-field,.profit-preview,dialog .message{grid-column:1/-1}.dialog-heading h2{margin:6px 0 18px;font-size:30px}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:8px}.dialog-actions .primary{min-width:160px}.image-field{display:grid;grid-template-columns:110px 1fr auto;align-items:center;gap:14px;margin-bottom:16px;padding:13px;border:1px solid var(--line);border-radius:12px;background:#071e38}.image-field img{width:110px;height:90px;border-radius:10px;object-fit:cover;background:#123b65}.image-field label{margin:0}.image-field small{color:var(--muted);font-size:12px}.profit-preview{display:flex;justify-content:space-between;margin-bottom:14px;padding:13px;border:1px solid rgba(83,214,160,.4);border-radius:10px;background:rgba(83,214,160,.07)}.profit-preview span{color:var(--muted)}.profit-preview strong{color:var(--green)}[hidden]{display:none!important}@media(min-width:720px){.mobile-auth{grid-template-columns:1fr 1fr;align-items:center}.mobile-stats{grid-template-columns:repeat(4,1fr)}.product-grid{grid-template-columns:repeat(3,1fr)}.dashboard-grid{grid-template-columns:repeat(2,1fr)}.sale-layout{grid-template-columns:minmax(0,1.5fr) minmax(330px,.7fr)}.cart{position:sticky;top:82px}.license-picker{grid-template-columns:repeat(2,1fr)}}@media(min-width:1100px){.app-ready .mobile-header{padding-left:326px}.app-ready #menu-toggle{display:none}.app-ready .mobile-sidebar{transform:none}.sidebar-brand .icon-button{display:none}.app-ready main{padding:34px 28px 50px 338px}.product-grid{grid-template-columns:repeat(4,1fr)}}@media(max-width:620px){.mobile-header>a span{display:none}.page-heading{align-items:flex-start;flex-direction:column}.page-heading>.primary,.page-heading>.secondary{width:100%}.product-row{grid-template-columns:60px 1fr}.product-row>button{grid-column:1/-1}.product-row .product-thumb,.product-row .product-placeholder{width:60px;height:60px}.image-field{grid-template-columns:80px 1fr}.image-field img{width:80px;height:80px}.image-field>button{grid-column:1/-1}dialog form{grid-template-columns:1fr}.dialog-heading,.dialog-actions,.image-field,.profit-preview,dialog .message{grid-column:1}.dialog-actions{flex-direction:column}.dialog-actions button{width:100%}}
.help-card{display:block;color:var(--text);text-decoration:none}.help-card p{color:var(--muted);line-height:1.6}
.mobile-header #menu-toggle{visibility:hidden}.app-ready .mobile-header #menu-toggle{visibility:visible}
@media(min-width:1100px){.app-ready main{max-width:none;margin:0}}
body.app-ready main{max-width:none;margin:0}

/* Mantém o PDV web confortável em celular, tablet e desktop. */
main{padding:20px 14px calc(34px + env(safe-area-inset-bottom))}.mobile-auth{max-width:820px;gap:22px}.mobile-auth h1,.mobile-title h1,.page-heading h1{font-size:clamp(30px,6vw,46px)}.mobile-auth form,.mobile-panel,.panel,dialog form{padding:clamp(16px,3vw,20px);border-radius:16px}.page-heading{margin-bottom:18px}.stat{min-height:96px;padding:14px}.stat strong{font-size:clamp(21px,3vw,28px)}
@media(min-width:1100px){.app-ready main{padding:28px 24px 42px 330px}.page-heading h1{font-size:42px}}
.sale-origin{display:inline-flex;margin-left:.45rem;padding:.15rem .45rem;border-radius:999px;background:#e7eef7;color:#0b2a4b;font-size:.7rem;font-weight:700;vertical-align:middle}@media(max-width:620px){.mobile-header{padding-inline:10px}.mobile-header>div{gap:5px}#cloud-status{font-size:11px}.page-heading{gap:10px}.mobile-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat{min-width:0}.entity-row,.sale-row{grid-template-columns:1fr}.entity-row>div:last-child,.sale-row>div:last-child{width:100%}.entity-row button{width:100%}.cash-balance strong{font-size:34px}}
@media(max-width:360px){.mobile-stats{grid-template-columns:1fr}.mobile-header #cloud-status{display:none}.product-grid{grid-template-columns:1fr}}
.confirm-dialog{width:min(440px,calc(100% - 22px))}.confirm-dialog form{grid-template-columns:1fr}.confirm-dialog .dialog-heading,.confirm-dialog .dialog-actions{grid-column:1}.confirm-dialog .dialog-heading h2{font-size:clamp(24px,7vw,30px)}.confirm-dialog .dialog-heading p{margin:0;color:var(--muted);line-height:1.55}.confirm-dialog .dialog-actions{margin-top:20px}.confirm-dialog .danger{min-height:46px;padding:11px 17px;border-radius:11px;background:var(--red);color:#fff;font-weight:850}
.payment-dialog{width:min(520px,calc(100% - 22px))}.payment-dialog form{grid-template-columns:1fr}.payment-dialog .dialog-heading,.payment-dialog .dialog-actions,.payment-dialog .message{grid-column:1}.payment-dialog .dialog-heading p{margin:0;color:var(--muted);line-height:1.5}.payment-summary{display:grid;gap:10px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#071e38}.payment-summary>div,.change-preview{display:flex;align-items:center;justify-content:space-between;gap:18px}.payment-summary span,.change-preview span{color:var(--muted)}.payment-summary strong{font-size:18px}.change-preview{padding:16px;border:1px solid rgba(83,214,160,.5);border-radius:12px;background:rgba(83,214,160,.08)}.change-preview strong{color:var(--green);font-size:clamp(24px,7vw,34px)}.change-preview.insufficient{border-color:rgba(255,115,137,.6);background:rgba(255,115,137,.08)}.change-preview.insufficient strong{color:#ff8fa1}.payment-confirmation{display:flex;align-items:flex-start;grid-template-columns:none;gap:11px;margin:4px 0;padding:13px;border:1px solid var(--line);border-radius:12px;background:#071e38;cursor:pointer}.payment-confirmation input{flex:0 0 auto;width:20px;min-height:20px;height:20px;margin:1px 0 0;accent-color:var(--red)}.payment-confirmation span{line-height:1.4}.payment-dialog .dialog-actions{margin-top:2px}
.cash-shortcuts{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.cash-shortcuts button{min-height:34px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:var(--navy);color:var(--text);font-size:12px;font-weight:800}

/* Tela de vendas independente, inspirada no fluxo do PDV Desktop. */
body.sale-open{overflow:hidden}
.sale-open .mobile-header,.sale-open .mobile-sidebar,.sale-open .menu-backdrop{display:none!important}
.app-ready.sale-open main{max-width:none;margin:0;padding:0}
.sale-screen{position:fixed;z-index:80;inset:0;overflow:auto;background:#0b1e35;overscroll-behavior:contain}
.sale-topbar{position:sticky;z-index:3;top:0;display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:70px;padding:10px clamp(16px,2.5vw,34px);border-bottom:1px solid #315579;background:#123152;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.sale-brand,.sale-topbar-actions{display:flex;align-items:center;gap:14px}
.sale-brand img{width:44px;height:44px;object-fit:contain}
.sale-brand div{display:grid;gap:2px;min-width:0}
.sale-brand strong{font-size:20px;line-height:1}
.sale-brand span{overflow:hidden;max-width:44vw;color:#c0d7e9;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.sale-close{display:flex;align-items:center;gap:8px;min-height:44px;padding:9px 16px;border:1px solid #6b91b4;border-radius:11px;background:#0c2948;color:#fff;font-weight:850}
.sale-close:hover,.sale-close:focus-visible{border-color:#ff6e84;background:#7f2339}
.sale-screen-content{max-width:1800px;margin:auto;padding:20px clamp(12px,2vw,30px) 38px}
.sale-intro{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:18px}
.sale-intro h1{margin:5px 0;font-size:clamp(28px,3vw,40px);line-height:1.1}
.sale-intro p{margin:0;color:var(--muted);font-size:14px}
.sale-intro-hint{color:#d1e1ef;font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.sale-workspace{display:grid;grid-template-areas:"preview picker" "receipt receipt";grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
.sale-preview{grid-area:preview}.sale-picker{grid-area:picker}.sale-receipt{grid-area:receipt}
.sale-workspace>.panel{min-width:0;padding:18px;border-color:#36658e;border-radius:20px;background:#112f50;box-shadow:none}
.sale-panel-heading{margin-bottom:16px}.sale-panel-heading h2{margin:5px 0 0;font-size:19px}
.sale-preview-inner{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1fr);align-items:center;gap:16px;min-height:190px}
.sale-selected-visual{display:grid;overflow:hidden;min-height:180px;place-items:center;border:1px solid #315b83;border-radius:16px;background:#0b2542}
.sale-selected-visual img,.sale-selected-visual .product-thumb,.sale-selected-visual .product-placeholder{width:100%;height:180px;object-fit:contain}
.sale-selected-visual .product-placeholder{font-size:50px}
.sale-selected-info{min-width:0}.sale-selected-info h3{margin:0 0 8px;font-size:clamp(18px,2vw,26px);overflow-wrap:anywhere}.sale-selected-info p{margin:0 0 15px;color:var(--muted);font-size:13px}.sale-selected-info strong{color:#8ad0ff;font-size:clamp(19px,2vw,27px)}
.sale-add-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:12px;margin-top:20px}
.sale-add-controls label{margin:0}.sale-add-controls input{min-height:52px;font-size:20px;font-weight:800}.sale-line-total{display:grid;gap:5px;min-height:52px;align-content:center;padding:0 12px;border:1px solid #3b76a4;border-radius:10px;background:#0b2542}.sale-line-total span{color:var(--muted);font-size:12px}.sale-line-total strong{font-size:19px}
.sale-add-controls .primary{grid-column:1/-1;width:100%;min-height:52px;font-size:16px}
.sale-search-label{gap:8px;margin:0 0 15px}.sale-search-label input{margin:0}
.sale-picker .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;max-height:420px;overflow:auto;padding:2px}
.sale-picker .sale-product{min-height:150px;background:#0c2948;transition:border-color .15s,transform .15s,background .15s}
.sale-picker .sale-product:hover{transform:translateY(-2px);border-color:#73bdf2}
.sale-picker .sale-product.selected{border:2px solid #ff4964;background:#173b61;box-shadow:0 0 0 2px rgba(255,73,100,.14)}
.sale-picker .sale-product img,.sale-picker .sale-product .product-placeholder{height:86px}
.sale-picker .sale-product>div:last-child{padding:10px}.sale-picker .sale-product strong{margin-bottom:5px;font-size:13px}.sale-picker .sale-product small{font-size:11px}
.sale-receipt{display:flex;flex-direction:column;min-height:360px;padding:0!important;overflow:hidden}
.sale-receipt-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 19px;border-bottom:1px dashed #5785a8;background:#14395f}.sale-receipt-heading h2{margin:3px 0 0;font-size:24px}.sale-receipt-heading>span{padding:6px 10px;border:1px solid #5082aa;border-radius:999px;color:#d3e5f5;font-size:12px;font-weight:800}
.sale-cart-items{flex:1;min-height:150px;padding:4px 19px}.sale-empty{display:grid;min-height:150px;place-content:center;text-align:center}.sale-empty span{color:#8fb4d4;font-size:35px}.sale-empty strong{margin-top:6px;font-size:18px}.sale-empty p{margin:5px 0;color:var(--muted);font-size:13px}
.sale-receipt .cart-line{grid-template-columns:minmax(0,1fr) auto}.sale-receipt .cart-line strong{overflow-wrap:anywhere}.sale-receipt .cart-line .cart-line-total{display:inline-block;margin-top:4px;color:#91d1ff;font-weight:850}
.sale-receipt-bottom{padding:16px 19px 18px;border-top:1px solid #36658e;background:#0d2846}.sale-receipt-bottom label{margin:0 0 12px}.sale-receipt-bottom .sale-total{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:16px -19px 14px;padding:16px 19px;border-left:4px solid var(--red);background:#091d35}.sale-total span{color:#c8dced;font-size:13px;font-weight:800;text-transform:uppercase}.sale-total strong{font-size:clamp(26px,3vw,38px);white-space:nowrap}.sale-receipt-bottom .primary{width:100%;min-height:52px;font-size:16px}.sale-receipt-bottom .message{margin-top:10px}
.sale-mobile-dock{display:none}
@media(min-width:1150px){.sale-workspace{grid-template-areas:"preview picker receipt";grid-template-columns:minmax(240px,.8fr) minmax(285px,1fr) minmax(340px,1.08fr)}.sale-workspace>.panel{min-height:calc(100vh - 190px)}.sale-preview-inner{grid-template-columns:1fr}.sale-selected-visual,.sale-selected-visual img,.sale-selected-visual .product-thumb,.sale-selected-visual .product-placeholder{height:clamp(210px,28vh,320px)}.sale-picker .product-grid{max-height:calc(100vh - 345px);min-height:220px}.sale-receipt{min-height:calc(100vh - 190px)}.sale-cart-items{overflow:auto;max-height:calc(100vh - 510px)}}
@media(max-width:719px){.sale-topbar{min-height:62px;padding:8px 12px}.sale-brand img{width:37px;height:37px}.sale-brand strong{font-size:16px}.sale-brand span{max-width:38vw;font-size:11px}.sale-topbar-actions{gap:7px}.sale-topbar .status-pill{display:none}.sale-close{min-width:44px;min-height:44px;justify-content:center;padding:7px 10px}.sale-close span{display:none}.sale-screen-content{padding:16px 12px calc(104px + env(safe-area-inset-bottom))}.sale-intro{margin-bottom:13px}.sale-intro h1{font-size:30px}.sale-intro p{font-size:12px}.sale-intro-hint{display:none}.sale-workspace{grid-template-areas:"picker" "preview" "receipt";grid-template-columns:minmax(0,1fr);gap:12px}.sale-workspace>.panel{padding:15px;border-radius:16px}.sale-picker .product-grid{max-height:310px}.sale-picker .sale-product{min-height:134px}.sale-selected-visual,.sale-selected-visual img,.sale-selected-visual .product-thumb,.sale-selected-visual .product-placeholder{height:115px;min-height:115px}.sale-preview-inner{grid-template-columns:115px minmax(0,1fr);min-height:115px}.sale-add-controls{margin-top:15px}.sale-receipt{min-height:340px}.sale-cart-items{min-height:140px}.sale-mobile-dock{position:fixed;z-index:4;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px calc(11px + env(safe-area-inset-bottom));border-top:1px solid #477299;background:#09223d;box-shadow:0 -10px 24px rgba(0,0,0,.3)}.sale-mobile-dock>div{display:grid;gap:2px}.sale-mobile-dock span{color:var(--muted);font-size:11px}.sale-mobile-dock strong{font-size:20px}.sale-mobile-dock button{min-height:42px;padding:9px 15px;border-radius:10px;background:var(--red);color:#fff;font-weight:850}#sale-selected-heading,#sale-receipt{scroll-margin-top:75px}}
@media(max-width:390px){.sale-preview-inner{grid-template-columns:92px minmax(0,1fr)}.sale-selected-visual,.sale-selected-visual img,.sale-selected-visual .product-thumb,.sale-selected-visual .product-placeholder{height:92px;min-height:92px}.sale-picker .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-picker .sale-product img,.sale-picker .sale-product .product-placeholder{height:72px}.sale-picker .sale-product>div:last-child{padding:8px}.sale-add-controls{grid-template-columns:1fr}.sale-add-controls .primary{grid-column:1}}

/* Desktop: tela de vendas cabe inteira na janela, sem rolagem da página. Só listas longas rolam por dentro. */
@media(min-width:1150px) and (min-height:480px){
.sale-screen{display:flex;flex-direction:column;overflow:hidden}
.sale-topbar{position:relative;flex:none;min-height:60px;padding-block:8px}
.sale-screen-content{display:flex;flex:1;flex-direction:column;width:100%;min-height:0;padding:14px clamp(12px,1.6vw,26px) 16px}
.sale-intro{flex:none;align-items:center;margin-bottom:12px}
.sale-intro h1{margin:2px 0;font-size:clamp(24px,2.2vw,30px)}
.sale-intro-hint{display:none}
.sale-workspace{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
.sale-workspace>.panel{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;padding:16px}
.sale-workspace .sale-panel-heading{flex:none;margin-bottom:10px}
.sale-workspace .sale-preview-inner{display:flex;flex:1;flex-direction:column;align-items:stretch;gap:12px;min-height:0}
.sale-workspace .sale-selected-visual{position:relative;flex:1;height:auto;min-height:90px}
.sale-workspace .sale-selected-visual>img,.sale-workspace .sale-selected-visual>.product-thumb,.sale-workspace .sale-selected-visual>.product-placeholder{position:absolute;inset:0;width:100%;height:100%;min-height:0}
.sale-workspace .sale-selected-info{flex:none}
.sale-workspace .sale-selected-info h3{margin-bottom:4px;font-size:clamp(18px,1.5vw,22px)}
.sale-workspace .sale-selected-info p{margin:0 0 6px}
.sale-workspace .sale-add-controls{flex:none;margin-top:12px}
.sale-workspace .sale-search-label{flex:none;margin-bottom:12px}
.sale-workspace .sale-picker .product-grid{flex:1;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:max-content;min-height:0;max-height:none}
.sale-workspace .sale-picker .sale-product{flex:none;min-height:0}
.sale-workspace .sale-receipt{padding:0!important}
.sale-workspace .sale-receipt-heading{flex:none;padding:14px 16px}
.sale-workspace .sale-cart-items{flex:1;min-height:0;max-height:none;overflow:auto;padding:4px 16px}
.sale-workspace .sale-empty{min-height:100%}
.sale-workspace .sale-receipt-bottom{display:grid;flex:none;grid-template-columns:1fr 1fr;gap:0 12px;padding:14px 16px}
.sale-workspace .sale-receipt-bottom label{margin:0 0 10px}
.sale-workspace .sale-receipt-bottom select{min-height:44px}
.sale-workspace .sale-receipt-bottom .sale-total,.sale-workspace .sale-receipt-bottom .primary,.sale-workspace .sale-receipt-bottom .message{grid-column:1/-1}
.sale-workspace .sale-receipt-bottom .sale-total{margin:4px -16px 12px;padding:12px 16px}
.sale-workspace .sale-total strong{font-size:clamp(24px,2.2vw,32px)}
.sale-workspace .sale-receipt-bottom .message{min-height:0;margin-top:8px}
.sale-workspace .sale-receipt-bottom .message:empty{display:none}
}
/* Desktop com pouca altura (ex.: zoom do Windows 125-150%): compacta para caber sem rolagem. */
@media(min-width:1150px) and (min-height:480px) and (max-height:820px){
.sale-topbar{min-height:52px;padding-block:5px}
.sale-brand img{width:34px;height:34px}
.sale-brand strong{font-size:17px}
.sale-intro{display:none}
.sale-screen-content{padding-top:10px;padding-bottom:10px}
.sale-workspace{gap:10px}
.sale-workspace>.panel{padding:12px 14px;border-radius:16px}
.sale-workspace .sale-panel-heading{margin-bottom:8px}
.sale-workspace .sale-panel-heading h2{font-size:17px}
.sale-workspace .sale-selected-visual{min-height:60px}
.sale-workspace .sale-selected-info h3{font-size:17px}
.sale-workspace .sale-selected-info p{font-size:12px;margin-bottom:2px}
.sale-workspace .sale-selected-info strong{font-size:19px}
.sale-workspace .sale-add-controls{gap:8px;margin-top:8px}
.sale-workspace .sale-add-controls label{gap:4px;font-size:13px}
.sale-workspace .sale-add-controls input,.sale-workspace .sale-line-total{min-height:42px;font-size:17px}
.sale-workspace .sale-line-total strong{font-size:16px}
.sale-workspace .sale-add-controls .primary{min-height:42px}
.sale-workspace .sale-search-label{gap:5px;margin-bottom:8px;font-size:13px}
.sale-workspace .sale-search-label input{min-height:40px}
.sale-workspace .sale-receipt-heading{padding:10px 14px}
.sale-workspace .sale-receipt-heading h2{font-size:19px}
.sale-workspace .sale-empty{min-height:100%}
.sale-workspace .sale-empty span{font-size:24px}
.sale-workspace .sale-empty strong{font-size:15px}
.sale-workspace .sale-receipt-bottom{padding:10px 14px}
.sale-workspace .sale-receipt-bottom label{gap:4px;margin-bottom:8px;font-size:13px}
.sale-workspace .sale-receipt-bottom select{min-height:38px;padding-block:6px}
.sale-workspace .sale-receipt-bottom .sale-total{margin:2px -14px 8px;padding:8px 14px}
.sale-workspace .sale-total strong{font-size:24px}
.sale-workspace .sale-receipt-bottom .primary{min-height:42px}
}

/* Cadastro de produto: código de barras com leitor, câmera e gerador. */
.field-optional,.field-required{margin-left:4px;color:var(--muted);font-size:12px;font-weight:600}
.field-required{color:#ffb1bd}
.field-hint{color:var(--muted);font-size:12px;font-weight:600}
.barcode-input{display:flex;gap:8px}
.barcode-input input{flex:1;min-width:0}
.barcode-input button{flex:none;min-height:48px;padding-inline:14px;font-weight:800}
.barcode-input button#generate-barcode{border-color:#4cbf92;color:#9affd8}
.barcode-video{grid-column:1/-1;width:100%;max-height:50vh;border:1px solid var(--line);border-radius:12px;background:#000;object-fit:cover}
#product-form>label{align-content:start}

/* Caixa: fechamento com autorização e relatório imprimível. */
.cash-close-dialog,.cash-report-dialog{width:min(620px,calc(100% - 22px))}
.cash-close-dialog form,.cash-report-dialog form{grid-template-columns:1fr}
.cash-close-dialog .dialog-heading,.cash-report-dialog .dialog-heading{grid-column:1}
.cash-close-summary{margin-bottom:14px;padding:4px 14px;border:1px solid var(--line);border-radius:12px;background:#071e38}
.cash-close-summary .summary-row:last-child strong{font-size:20px}
#cash-close-difference{margin-bottom:14px}
#cash-close-amount{font-size:22px;font-weight:850}
.cash-report{padding:18px;border-radius:12px;background:#fff;color:#10233a}
.cash-report header{display:flex;align-items:center;gap:12px;padding-bottom:12px;border-bottom:2px solid #d9e3ee}
.cash-report header img{width:42px;height:42px;object-fit:contain}
.cash-report header div{display:grid}
.cash-report header strong{font-size:19px}
.cash-report header span{color:#4d6379;font-size:13px}
.cash-report section{padding:10px 0;border-bottom:1px dashed #cfdbe7}
.cash-report h3{margin:4px 0 6px;color:#4d6379;font-size:11px;letter-spacing:.12em;text-transform:uppercase}
.cash-report .report-line{display:flex;justify-content:space-between;gap:14px;padding:4px 0;font-size:14px}
.cash-report .report-line span{color:#2a3f55}
.cash-report .report-line strong{white-space:nowrap}
.cash-report footer{margin-top:10px;color:#6b7f93;font-size:11px}
.cash-report-dialog .dialog-actions{flex-wrap:wrap}
#print-root{display:none}
@media print{
  body.printing-report>*:not(#print-root){display:none!important}
  body.printing-report{background:#fff!important}
  body.printing-report #print-root{display:block}
  #print-root .cash-report{padding:0;color:#000}
  @page{margin:14mm}
}
dialog .danger,button.danger{min-height:46px;padding:11px 17px;border-radius:11px;background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;font-weight:850;box-shadow:0 9px 24px rgba(237,28,59,.22)}

/* Funcionários */
.employees-notice{margin-bottom:14px;border-color:#4a86b5;color:#d5e7f6;font-size:14px;line-height:1.5}
.employee-row.inactive{opacity:.6}
.role-badge{display:inline-block;margin-left:6px;padding:2px 8px;border:1px solid var(--line);border-radius:999px;color:#bfe3ff;font-size:11px;font-weight:800;vertical-align:middle}
.role-badge.role-owner{border-color:#ffc85a;color:#ffe2a6}
.role-badge.role-manager{border-color:#6fc3ff}
.employee-dialog{width:min(820px,calc(100% - 22px))}
.employee-switches,.employee-permissions{grid-column:1/-1}
.employee-switches{display:flex;flex-wrap:wrap;gap:8px 22px;margin-bottom:12px}
.check-row{display:flex!important;align-items:center;gap:10px;margin:0!important;font-weight:650}
.check-row input{width:20px;min-height:20px;height:20px;margin:0;accent-color:var(--red)}
.employee-permissions .section-title{margin:6px 0 10px}
#employee-permission-groups{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin-bottom:10px}
.permission-group{display:grid;gap:8px;margin:0;padding:12px;border:1px solid var(--line);border-radius:12px;background:#071e38}
.permission-group legend{padding:0 6px;color:var(--blue);font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.permission-group .check-row{font-size:13px}
.check-row input{flex:none}.permission-group{align-content:start}

/* Crédito da loja */
.credit-line{color:#bfe3ff!important}
.credit-line strong{color:var(--green)}
.credit-button{border-color:#4cbf92!important;color:#9affd8!important}
.credit-dialog{width:min(640px,calc(100% - 22px))}
.credit-dialog form,.credit-dialog .dialog-heading{grid-template-columns:1fr;grid-column:1}
.credit-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}
.credit-summary div{display:grid;gap:4px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#071e38}
.credit-summary span{color:var(--muted);font-size:12px}
.credit-summary strong{font-size:18px}
.credit-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.credit-actions button.active{border-color:var(--red);background:rgba(237,28,59,.14)}
.credit-panel{display:grid;gap:10px;margin-bottom:6px}
.credit-panel label{margin:0}
.credit-history{display:grid;gap:8px;max-height:45vh;overflow:auto;margin-bottom:6px}
.credit-entry{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(83,138,183,.35);border-radius:12px;background:#071e38}
.credit-entry p{margin:3px 0;color:#d3e2ef;font-size:13px}
.credit-entry small{color:var(--muted);font-size:11px}
.credit-entry-value{display:grid;justify-items:end;align-content:start;gap:4px;text-align:right;white-space:nowrap}
@media(min-width:560px){.credit-summary{grid-template-columns:repeat(4,minmax(0,1fr))}}
/* Vendas canceladas */
.sale-origin.cancelled{background:#ffd6dc;color:#7f1022}
.sale-row-side{display:grid;justify-items:end;gap:6px}
.strike{text-decoration:line-through;opacity:.6}
/* Configurações */
.settings-tabs{display:flex;gap:8px;overflow-x:auto;margin-bottom:14px;padding-bottom:4px;scrollbar-width:thin}
.settings-tabs button{flex:none;min-height:42px;padding:9px 14px;border:1px solid var(--line);border-radius:999px;background:transparent;color:#d3e2ef;font-weight:800;white-space:nowrap}
.settings-tabs button.active{border-color:var(--red);background:var(--red);color:#fff}
.muted-small{color:var(--muted);font-size:12px}
.store-form{display:grid;grid-template-columns:1fr;gap:0 14px}
.store-form .wide{grid-column:1/-1}
@media(min-width:720px){.store-form{grid-template-columns:1fr 1fr}}
.license-actions{margin-top:12px}
.device-list{display:grid;gap:10px}
.device-card{padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#071e38}
.device-card.inactive{opacity:.65}
.device-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}
.device-card header div{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.device-card h3{margin:0;font-size:16px;overflow-wrap:anywhere}
.device-card dl{display:grid;grid-template-columns:1fr;gap:4px;margin:0}
.device-card dl div{display:flex;justify-content:space-between;gap:12px;font-size:13px}
.device-card dt{color:var(--muted)}
.device-card dd{margin:0;text-align:right;overflow-wrap:anywhere}
.device-history summary{margin:6px 0;color:var(--muted);cursor:pointer}
.device-history .device-card{margin-top:8px}
