.sales-tabs{display:flex;gap:8px;margin-bottom:22px}.sales-tabs [aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}.sale-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.sale-fields{display:grid;grid-template-columns:1.3fr 1fr 1.1fr .8fr;gap:16px}.delivery-fields{display:grid;grid-template-columns:1fr 170px;gap:16px}.sale-customer{margin-bottom:22px}.pos-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(340px,1fr);gap:22px;align-items:start}.pos-catalog{padding:22px}.category-chips{display:flex;flex-wrap:wrap;gap:7px;margin:18px 0}.category-chips button{border-radius:24px;padding:7px 12px;min-height:36px;font-weight:500}.category-chips [aria-pressed=true]{background:#e3eee6;border-color:#4f8061;color:var(--green)}.pos-products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.pos-product{padding:0;display:flex;flex-direction:column;align-items:stretch;text-align:left;overflow:hidden;border-radius:10px;min-height:200px;font-weight:400}.pos-product img,.pos-photo{height:112px;width:100%;object-fit:cover;background:#eef2ef}.pos-photo{display:grid;place-items:center;color:#718079;font-size:13px}.pos-product-info{padding:12px;display:flex;flex:1;flex-direction:column;gap:5px}.pos-product strong{font-size:14px;overflow-wrap:anywhere}.pos-product small{font-size:12px;color:var(--muted)}.pos-product b{font-size:15px;color:var(--green);margin-top:auto}.select-label{font-size:13px;color:var(--green);margin-top:4px}.cart-empty{padding:34px 8px;text-align:center;color:var(--muted);font-size:14px}.cart-line{display:grid;grid-template-columns:44px 1fr;gap:12px;padding:18px 0;border-bottom:1px solid var(--line)}.cart-line img,.cart-thumb{width:44px;height:52px;object-fit:cover;border-radius:6px;background:#eef2ef}.cart-line h3{font-size:15px;margin:0 0 4px}.cart-line p{font-size:13px;color:var(--muted);margin:3px 0}.cart-controls{display:flex;gap:12px;align-items:center;margin-top:10px;flex-wrap:wrap}.cart-controls input{width:65px;padding:7px;min-height:36px}.cart-controls button{padding:5px;min-height:32px}.cart-controls strong{margin-left:auto;font-size:14px}.cart-line.stale{border-left:3px solid #ac692b;padding-left:10px}.cart-line .stale-note{color:#9b571b;font-weight:600}.cart-summary{padding:12px 0}.cart-summary p{display:flex;justify-content:space-between;gap:10px;margin:12px 0;font-size:14px}.discount-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.discount-line input{max-width:115px}.discount-line label{margin:0}.cart-summary .grand-total{font-size:23px;border-top:1px solid var(--line);padding-top:16px;margin-top:18px}.payment-hint{margin-top:12px}.payment-row{display:grid;grid-template-columns:minmax(0,1fr) 100px 30px;gap:7px;align-items:end;margin-top:12px}.payment-row label{font-size:13px;margin:0}.payment-row input,.payment-row select{margin-top:5px;padding:8px;font-size:14px}.payment-row button{padding:5px;min-width:30px}.payment-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:16px}.sale-error{font-size:14px;color:#9b452e;margin-top:14px;margin-bottom:12px}.sale-error:empty{margin:0}.finalize{width:100%;font-size:15px;min-height:50px;margin-top:20px}.item-total{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:20px}.item-total strong{font-size:22px}#item-choices fieldset{border:1px solid var(--line);border-radius:8px;margin:20px 0;padding:14px}#item-choices legend{font-size:16px;font-weight:650}#item-choices .choice-row{display:flex;align-items:center;gap:12px;font-size:14px;font-weight:400}#item-choices input[type=number]{width:65px}#item-choices .choice-row input[type=checkbox]{flex-shrink:0}.history-summary{display:flex;gap:30px;flex-wrap:wrap;margin:26px 0}.history-summary strong{display:block;font-size:23px}.sale{border-top:1px solid var(--line);padding:18px 0}.sale summary{cursor:pointer;list-style:none}.sale-head{display:flex;justify-content:space-between;gap:12px}.sale small{font-size:13px;color:var(--muted)}.sale p{font-size:14px;overflow-wrap:anywhere;white-space:pre-wrap;margin:14px 0}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:10px 6px;text-align:left;border-bottom:1px solid var(--line)}.badge.paid{background:#e1f1e5}.badge.partial{background:#fff0cc;color:#815c0b}@media(max-width:1300px){.pos-products{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-fields{grid-template-columns:1fr 1fr}.pos-layout{gap:16px}}@media(max-width:1050px){.pos-layout{grid-template-columns:1fr}.pos-products{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:650px){.sale-fields,.delivery-fields{grid-template-columns:1fr}.pos-products{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-heading{align-items:start;flex-wrap:wrap}.category-chips{max-height:160px;overflow:auto}.pos-catalog,.pos-cart{padding:16px}.pos-product{min-height:185px}.pos-product img,.pos-photo{height:95px}.item-total{align-items:stretch;flex-direction:column}.sales-tabs button{flex:1}}

td:first-child{white-space:pre-wrap;min-width:150px}
.history-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0 14px}.history-top h2{margin:0}.history-periods{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}.history-periods [aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}.history-filter-grid{display:grid;grid-template-columns:minmax(180px,2fr) 1fr 1fr auto;gap:16px;align-items:end}.history-filter-grid:has(#history-from:not([hidden])){grid-template-columns:2fr 1fr 1fr}.history-filter-grid label{margin-top:0}.history-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:20px 0 12px}.history-metrics .card{padding:18px}.history-metrics span{font-size:14px;color:var(--muted)}.history-metrics strong{display:block;margin-top:9px;font-size:clamp(19px,1.7vw,26px);overflow-wrap:anywhere}.history-results{padding:0 18px}.history-table{min-width:850px;font-size:14px}.history-table th{font-weight:600;color:var(--muted);font-size:14px;padding:17px 10px;white-space:nowrap}.history-table td{padding:18px 10px;vertical-align:middle}.history-table td:first-child{min-width:90px;font-weight:650;white-space:nowrap}.history-table td:nth-child(3){min-width:100px;overflow-wrap:anywhere}.history-table td:nth-child(4){max-width:230px;min-width:150px;overflow-wrap:anywhere}.history-table td:nth-child(5){white-space:nowrap;font-weight:650}.history-table small{display:block;color:var(--muted);margin-top:4px}.history-table tbody tr:hover{background:#f6f9f7}.badge.cancelled{background:#f4e3e3;color:#923838}.badge.pending{background:#f5eddf;color:#835b24}.sale-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(620px,100%);max-width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0;padding:0 28px 28px;overflow-y:auto;box-shadow:-8px 0 40px #172b2426}.sale-drawer::backdrop{background:#14231d66}.drawer-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:0;background:white;z-index:1;padding:22px 0 16px;border-bottom:1px solid var(--line)}.drawer-heading h2{margin:4px 0 0}.sale-drawer p{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}.sale-drawer h3{margin-top:26px;font-size:17px}.snapshot-item{display:flex;gap:14px;padding:16px 0;border-bottom:1px solid var(--line)}.snapshot-item img{height:60px;width:52px;object-fit:cover;border-radius:6px;flex-shrink:0}.snapshot-item p{margin:5px 0}.snapshot-item strong{font-size:16px}.detail-totals{background:#f2f6f3;padding:12px 18px;margin:20px 0;border-radius:8px}.detail-totals p{display:flex;justify-content:space-between;gap:18px}.detail-totals p:nth-child(4){font-size:18px;font-weight:650;border-top:1px solid var(--line);padding-top:12px}.detail-actions{display:flex;flex-wrap:wrap;gap:10px;margin:24px 0}.detail-more{margin-top:22px}.detail-more button{margin-top:12px}.audit-event{padding:12px 0;border-bottom:1px solid var(--line)}.cancel-note{padding:12px 16px;background:#fbefec;border-radius:8px;margin:20px 0}.sale-drawer summary{cursor:pointer;font-size:14px}#detail-message button{display:block;margin-top:12px}#history-action{border-top:1px solid var(--line);margin-top:22px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:1100px){.history-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.history-filter-grid{grid-template-columns:2fr 1fr}}@media(max-width:650px){.history-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.history-metrics .card{padding:14px}.history-filter-grid,.history-filter-grid:has(#history-from:not([hidden])){grid-template-columns:1fr}.history-top{align-items:flex-start;flex-direction:column}.sale-drawer{padding:0 18px 22px}.history-results{padding:0 10px}.detail-actions button{flex:1}.history-periods button{padding:8px 10px}}

/* Compact owner sales layout on phones; desktop keeps its table and cards. */
@media(max-width:650px){
 .sale-customer{padding:16px}.sale-fields{gap:8px}.sale-fields label{margin-top:12px}.sale-heading h2{margin:0 0 8px}
 .pos-products{grid-template-columns:1fr;gap:8px;max-height:360px;overflow-y:auto;overscroll-behavior:contain;padding:2px}
 .pos-product{min-height:86px;display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center}
 .pos-product img,.pos-product .pos-photo{width:52px;height:60px;font-size:12px}
 .pos-product-info{padding:9px 12px;gap:3px}.pos-product strong,.pos-product small,.select-label{font-size:14px}.select-label{margin:0}
 .category-chips{max-height:108px;margin:12px 0;padding:2px}.category-chips button{min-height:44px}
 .pos-catalog .pagination{margin-top:10px}.cart-empty{padding:12px 0}.pos-layout{gap:14px}
 .history-results .table-wrap{overflow:visible}
 .history-table{min-width:0;width:100%;display:block}
 .history-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .history-table tbody{display:block}
 .history-table tbody tr{display:block;padding:16px 0;border-bottom:1px solid var(--line)}
 .history-table td,.history-table td:first-child,.history-table td:nth-child(3),.history-table td:nth-child(4){display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;padding:7px 6px;border:0;font-size:14px}
 .history-table td::before{font-weight:500;color:var(--muted)}
 .history-table td:nth-child(1)::before{content:'Número'}
 .history-table td:nth-child(2)::before{content:'Data / hora'}
 .history-table td:nth-child(3)::before{content:'Cliente'}
 .history-table td:nth-child(4)::before{content:'Itens'}
 .history-table td:nth-child(5)::before{content:'Total'}
 .history-table td:nth-child(6)::before{content:'Pagamento'}
 .history-table td:nth-child(7)::before{content:'Situação'}
 .history-table td:nth-child(4) small{grid-column:2}
 .history-table td:last-child{display:block;padding-top:12px}
 .history-table td:last-child button{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px}
 .history-table .badge{justify-self:start}
}
