/* SABOR DA CARNE - correção final mobile/PWA smartphone */
*,*::before,*::after{box-sizing:border-box}html,body{width:100%;max-width:100%;min-width:0;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:900px){html{font-size:16px}body{width:100%;max-width:100vw;min-width:0;overflow-x:hidden;font-size:16px;touch-action:manipulation}input,select,textarea,button,.btn{font-size:16px!important}input,select,textarea{min-height:48px;padding:12px 13px}textarea{min-height:110px}.topbar{position:sticky!important;top:0!important;z-index:1200!important;width:100%;max-width:100vw;min-height:60px;padding:calc(8px + env(safe-area-inset-top,0px)) 10px 8px!important;gap:8px}.menu-toggle{display:inline-flex!important;align-items:center;justify-content:center;width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;padding:0!important;border-radius:12px!important;font-size:22px!important}.brand{min-width:0;flex:1 1 auto;gap:8px}.brand img{width:36px!important;height:36px!important;border-radius:10px;object-fit:contain}.brand span{max-width:calc(100vw - 170px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px!important}.topbar .actions{width:auto!important;flex:0 0 auto;margin-left:0!important;display:flex!important;gap:6px}.topbar .user-chip{display:none!important}.topbar [data-install-pwa]:not([hidden]),.mobile-install:not([hidden]){display:inline-flex!important;white-space:nowrap!important;min-width:auto!important;width:auto!important;flex:0 0 auto!important}.topbar .btn.ghost{width:auto!important;min-height:38px;padding:8px 10px;font-size:13px!important;border-radius:10px}.layout{display:block!important;width:100%!important;max-width:100vw!important;min-width:0!important;min-height:calc(100dvh - 60px)!important;padding-bottom:0!important}.sidebar{position:fixed!important;top:60px!important;left:0!important;right:auto!important;bottom:0!important;width:min(86vw,300px)!important;max-width:300px!important;height:calc(100dvh - 60px)!important;max-height:calc(100dvh - 60px)!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;padding:12px!important;background:#0f172a!important;z-index:1100!important;box-shadow:10px 0 30px rgba(15,23,42,.28)!important;transform:translateX(-105%)!important;transition:transform .22s ease!important;border-radius:0 18px 18px 0!important}body.menu-open .sidebar{transform:translateX(0)!important}.sidebar a{flex:0 0 auto!important;width:100%!important;min-width:0!important;max-width:none!important;min-height:46px!important;margin:0!important;padding:11px 12px!important;border-radius:12px!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;text-align:left!important;line-height:1.2!important;font-size:14px!important;white-space:nowrap!important}.main{width:100%!important;max-width:100vw!important;min-width:0!important;margin:0!important;padding:10px 10px 16px!important;overflow-x:hidden}.card,.flash,.help,.login-card,.total-box,.responsive-card .row{width:100%!important;max-width:100%!important;min-width:0!important}.card{padding:13px!important;margin-bottom:12px!important;border-radius:16px!important;overflow:hidden}.grid,.grid-2,.grid-3,.grid-4,.form-grid,.totals,.os-head{display:grid!important;grid-template-columns:1fr!important;width:100%!important;min-width:0!important;gap:10px!important}.field,.field.span-2,.field.span-3,.field.span-4,.field.span-5,.field.span-6,.field.span-8,.field.span-9,.field.span-12{grid-column:1/-1!important;width:100%;min-width:0}.title-row{display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important;gap:10px!important;width:100%}.actions,.title-row>.actions,.title-row>form.actions{width:100%!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important}.actions .btn,.actions button,.actions a,.title-row>.btn,.card>.btn,form .btn,form button{width:100%!important;min-height:46px;padding:12px 13px;white-space:normal;line-height:1.15}h1{font-size:22px!important}h2{font-size:19px!important}h3{font-size:17px!important}.stat{min-height:76px}.stat b{font-size:23px!important;word-break:break-word}.kpi-icon{font-size:24px!important}.table-wrap{width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden;-webkit-overflow-scrolling:touch;border-radius:14px;touch-action:pan-x pan-y}table{width:100%;min-width:620px!important}th,td{padding:10px 9px!important;font-size:13px}td .actions,td.actions{display:flex!important;flex-direction:column;gap:6px!important;min-width:110px}td .actions .btn,td.actions .btn,td .actions button,td.actions button{width:100%!important;min-height:38px;padding:8px 9px;font-size:13px!important}.item-row{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%;min-width:0;gap:8px!important}.item-row select,.item-row input[name="item_description[]"]{grid-column:1/-1!important}.item-row button{grid-column:1/-1!important;width:100%!important}.login-page{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:12px}.login-card{padding:20px!important;border-radius:22px!important}body.menu-open{overflow:hidden!important}}
@media(max-width:430px){.main{padding-left:8px!important;padding-right:8px!important}.card{padding:12px!important}.sidebar{width:86vw!important;max-width:290px!important}.sidebar a{font-size:13.5px!important;min-height:45px!important}table{min-width:560px!important}.item-row{grid-template-columns:1fr!important}.item-row>*{grid-column:1/-1!important}}
@media(display-mode:standalone) and (max-width:900px){body{padding-bottom:0}.layout{min-height:100dvh}}

/* Ajustes finais PWA mobile */
@media(max-width:900px){body.menu-open .menu-backdrop{display:block!important}.topbar [data-install-pwa]:not([hidden]){display:inline-flex!important;width:auto!important;min-width:auto!important;flex:0 0 auto!important}.sidebar{will-change:transform}.table-wrap:after{content:'Arraste para o lado se tiver mais colunas';display:block;padding:6px 10px;color:#64748b;font-size:11px;background:#f8fafc}}

@media(max-width:900px){input[type="checkbox"],input[type="radio"]{width:20px!important;min-width:20px!important;max-width:20px!important;height:20px!important;min-height:20px!important}label:has(input[type="checkbox"]),label:has(input[type="radio"]){min-height:44px!important;align-items:center!important}.field label{align-items:center!important}input.money-natural,[data-money-watch],input[name="item_price[]"],input[name="item_discount[]"],input[name="discount"],input[name="down_payment"],#manualPrice,#receivedInput{text-align:right!important}}


/* SABOR DA CARNE - reforço mobile para os novos alinhamentos */
@media(max-width:900px){
  .card{padding:18px 16px!important;border-radius:18px!important;}
  .grid .card.stat,.card.stat{display:flex!important;align-items:center!important;justify-content:space-between!important;min-height:102px!important;padding:18px 16px!important;gap:14px!important;}
  .card.stat>div:first-child{display:grid!important;gap:8px!important;align-content:center!important;justify-items:start!important;}
  .card.stat span{display:block!important;font-size:14px!important;font-weight:750!important;line-height:1.35!important;margin:0!important;}
  .card.stat b{display:block!important;font-size:clamp(1.75rem,7vw,2.25rem)!important;font-weight:950!important;line-height:1.05!important;margin:0!important;letter-spacing:-.035em!important;}
  .kpi-icon{display:grid!important;place-items:center!important;width:50px!important;height:50px!important;min-width:50px!important;border-radius:16px!important;font-size:25px!important;}
  .form-grid{gap:14px!important;align-items:end!important;}
  .field{gap:8px!important;}
  .field label,label{display:block!important;margin:0 0 1px!important;padding-left:3px!important;font-size:13.5px!important;font-weight:850!important;line-height:1.35!important;color:#334155!important;}
  input,select,textarea{min-height:52px!important;height:auto!important;padding:0 16px!important;border-radius:14px!important;font-size:16px!important;line-height:52px!important;}
  select{padding-right:40px!important;line-height:normal!important;}
  textarea{min-height:108px!important;padding-top:14px!important;padding-bottom:14px!important;line-height:1.45!important;}
  #manualPrice,#totalInput,#receivedInput,#changeInput,input.money-natural,[data-money-watch],input[name="sale_price"],input[name="cost_price"],input[name="item_price[]"],input[name="item_discount[]"],input[name="discount"],input[name="down_payment"]{text-align:right!important;padding-right:18px!important;font-weight:850!important;font-variant-numeric:tabular-nums!important;}
  #pdvQty,input[name="quantity"],input[name="item_qty[]"],[data-qty]{text-align:center!important;font-weight:850!important;}
  .pdv-shell{gap:16px!important;}
  .pdv-payment{padding:18px 16px!important;}
  .pay-grid-simple{gap:10px!important;}
  .pay-btn{min-height:68px!important;border-radius:16px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;}
  .pay-btn span{font-size:16px!important;font-weight:950!important;line-height:1.2!important;}
  .payment-help{margin-top:12px!important;padding:12px 14px!important;border-radius:14px!important;line-height:1.45!important;}
  .pdv-total{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:16px!important;border-radius:18px!important;}
  .pdv-total span{font-size:14px!important;font-weight:850!important;}
  .pdv-total b{font-size:2rem!important;font-weight:950!important;}
}
@media(max-width:640px){
  .pdv-total{align-items:flex-start!important;flex-direction:column!important;}
}

