/* o2ze — «إدارة المحل» (pos.js) */
.pos-app [hidden],[data-pos-camera-box][hidden]{display:none!important}
body[data-page="pos"]{background:#f3f6fa}
.pos-app{min-height:100vh;display:flex;flex-direction:column}
.pos-top{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;padding:12px 20px;background:#071c32;color:#fff}
.pos-brand{font-weight:800;font-size:1.25rem;color:#fff;text-decoration:none;display:flex;align-items:baseline;gap:8px}
.pos-brand i{color:#3b9bff;font-style:normal}.pos-brand span{font-size:.95rem;font-weight:600;opacity:.9}
.pos-store{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.pos-store b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pos-logo{width:36px;height:36px;border-radius:8px;object-fit:cover;background:#fff}
.pos-who{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:.92rem}
.pos-who .o-soft{background:#fff;color:#071c32}
.pos-tabs{display:flex;gap:4px;overflow-x:auto;padding:8px 16px;background:#fff;border-bottom:1px solid #dce5ef;scrollbar-width:thin}
.pos-tabs a{white-space:nowrap;padding:10px 14px;border-radius:10px;color:#07355b;text-decoration:none;font-weight:600}
.pos-tabs a[aria-current]{background:#0876ef;color:#fff}.pos-tabs a:hover:not([aria-current]){background:#eaf2fd}
.pos-main{flex:1;width:100%;max-width:1440px;margin:0 auto;padding:18px 20px 40px;box-sizing:border-box;min-width:0}
.pos-off{margin:12px 20px 0;border-color:#f5c27a;background:#fff8ec}
.pos-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.pos-head h1{margin:0}.pos-head p{margin:4px 0 0}
.pos-chip{display:inline-block;padding:3px 10px;border-radius:99px;background:#eef2f6;color:#334;font-size:.85rem;font-weight:600;white-space:nowrap}
.pos-chip.is-ok{background:#e3f6ec;color:#067647}.pos-chip.is-warn{background:#fff3dc;color:#a15c00}.pos-chip.is-bad{background:#fde8e7;color:#b42318}
.pos-warn{color:#b42318;font-weight:600}
.pos-actions{display:flex;flex-wrap:wrap;gap:6px}
.pos-table td,.pos-table th{vertical-align:middle}
.pos-filter{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin-bottom:14px}.pos-filter .o-field{flex:1 1 180px;margin:0}
.pos-quick{flex-wrap:wrap;margin-bottom:10px}.pos-quick .is-on{background:#0876ef;color:#fff}

/* ---- selling */
.pos-sell{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,420px);gap:18px;align-items:start}
.pos-left{min-width:0}
.pos-scan{background:#fff;border:1px solid #dce5ef;border-radius:14px;padding:16px}
.pos-scan label{display:block;font-weight:700;margin-bottom:8px}
.pos-scan-row{display:flex;gap:8px}.pos-scan-row input{flex:1;min-width:0;font-size:1.25rem;padding:14px;border:2px solid #0876ef;border-radius:10px}
.pos-barcode-field .pos-scan-row input{font-size:1rem;padding:10px;border-width:1px;border-color:#cedceb}
.pos-camera{margin-top:12px;background:#000;border-radius:14px;padding:10px;text-align:center;color:#fff}
.pos-camera video{width:100%;max-height:300px;border-radius:10px;object-fit:cover}
.pos-camera .o-muted{color:#cfd8e3}
.pos-results{margin-top:12px}
.pos-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px}
.pos-pick button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:start;padding:12px}
.pos-cart{background:#fff;border:1px solid #dce5ef;border-radius:14px;padding:16px;position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto}
.pos-cart-head{display:flex;justify-content:space-between;align-items:center}.pos-cart-head h2{margin:0}
.pos-lines{list-style:none;margin:12px 0;padding:0;display:grid;gap:8px}
.pos-lines li{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:8px;align-items:center;padding:10px;border:1px solid #e4ebf3;border-radius:10px}
.pos-lines .pos-warn{grid-column:1/-1;margin:0;font-size:.85rem}
.pos-line-name{min-width:0}.pos-line-name b{display:block;overflow-wrap:anywhere}.pos-line-name small{color:#5b6b7c}
.pos-qty{display:flex;align-items:center;gap:4px}.pos-qty input{width:56px;text-align:center;padding:8px 4px;border:1px solid #cedceb;border-radius:8px}
.pos-qty button{min-width:36px;padding:6px}
.pos-line-total{white-space:nowrap}
.pos-x{border:0;background:#fde8e7;color:#b42318;border-radius:8px;min-width:34px;min-height:34px;cursor:pointer}
.pos-empty{padding:24px 8px}
.pos-pay{display:grid;gap:10px}.pos-pay .o-field{margin:0}
.pos-sum{display:flex;justify-content:space-between;align-items:center;font-size:1.05rem}
.pos-total{font-size:1.45rem;padding:10px 0;border-top:2px dashed #dce5ef;border-bottom:2px dashed #dce5ef}.pos-total b{color:#0068e5}
.pos-methods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;border:0;padding:0;margin:0}
.pos-methods legend{font-weight:700;margin-bottom:6px}
.pos-methods label{display:flex;gap:8px;align-items:center;padding:10px;border:1px solid #dce5ef;border-radius:10px;cursor:pointer}
.pos-methods label:has(input:checked){border-color:#0876ef;background:#eaf2fd}
.pos-customer summary{cursor:pointer;color:#07355b;font-weight:600;padding:4px 0}
.pos-done{font-size:1.2rem;padding:16px}
.pos-last{margin-top:16px}.pos-done-box{border-color:#9fdcbc;background:#f1fbf5}
.pos-done-box h2{margin-top:0}

/* ---- receipt */
.pos-invoice-grid{display:grid;grid-template-columns:minmax(0,420px) minmax(0,1fr);gap:18px;align-items:start}
.pos-receipt-preview{background:#fff;border:1px solid #dce5ef;border-radius:14px;padding:16px;overflow:auto}
.pos-receipt{font-family:inherit;color:#000;background:#fff;margin:0 auto;font-size:13px;line-height:1.5}
.pos-receipt.w-80{width:72mm}.pos-receipt.w-58{width:50mm;font-size:11px}.pos-receipt.w-a4{width:100%;max-width:180mm;font-size:14px}
.pos-receipt h2{text-align:center;margin:4px 0;font-size:1.25em}.pos-receipt>p{text-align:center;margin:2px 0}
.pos-receipt-logo{display:block;margin:0 auto 4px;max-width:40%;max-height:70px;object-fit:contain}
.pos-receipt-meta{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;font-size:.92em}
.pos-receipt table{width:100%;min-width:0!important;max-width:100%;border-collapse:collapse;margin:6px 0;border-top:1px dashed #000;border-bottom:1px dashed #000}
.pos-receipt th,.pos-receipt td{padding:3px 2px;text-align:start;font-size:.95em;vertical-align:top}
.pos-receipt td:nth-child(2),.pos-receipt td:nth-child(3),.pos-receipt th:nth-child(2),.pos-receipt th:nth-child(3){white-space:nowrap;text-align:end}
.pos-receipt dl{margin:4px 0}.pos-receipt dl div{display:flex;justify-content:space-between}.pos-receipt dt,.pos-receipt dd{margin:0}
.pos-receipt-total{font-weight:800;font-size:1.2em;border-top:1px solid #000;padding-top:2px}
.pos-receipt-foot{border-top:1px dashed #000;padding-top:4px}.pos-receipt-by{font-size:.8em;opacity:.6}

/* ---- products, labels */
.pos-product-form .pos-where,.pos-where{border:1px solid #dce5ef;border-radius:10px;padding:10px;display:flex;flex-wrap:wrap;gap:8px 18px}
.pos-where legend{font-weight:700;padding:0 4px}
.pos-label{display:flex;justify-content:center;margin-bottom:10px}
.pos-label-item{display:inline-flex;flex-direction:column;align-items:center;width:50mm;padding:2mm;box-sizing:border-box;text-align:center;font-size:10px;line-height:1.2;background:#fff;color:#000}
.pos-label-item b{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.pos-ean{width:100%;height:auto}
.pos-label-sheet{display:flex;flex-wrap:wrap}
.pos-login-input{display:flex;align-items:center;gap:6px}.pos-login-input input{flex:1;min-width:0}.pos-login-input b{white-space:nowrap;color:#5b6b7c}

/* ---- costs, reports */
.pos-costs{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.pos-rows{border:1px solid #dce5ef;border-radius:10px;padding:10px;display:grid;gap:8px}
.pos-rows legend{font-weight:700;padding:0 4px}
.pos-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto;gap:8px}
.pos-row input{min-width:0;border:1px solid #cedceb;border-radius:8px;padding:10px}
.pos-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-bottom:14px}
.pos-kpis article{display:flex;flex-direction:column;gap:6px}.pos-kpis span{color:#5b6b7c}.pos-kpis strong{font-size:1.35rem;color:#0068e5}
.pos-kpis strong.pos-small{font-size:1rem}.pos-kpis small{color:#5b6b7c}
.pos-how{margin-bottom:12px}.pos-how summary{cursor:pointer;font-weight:700}
.pos-report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.pos-report-grid .pos-wide{grid-column:1/-1}
.pos-report-grid h2{margin-top:0;font-size:1.1rem}.pos-report-grid>section,.pos-invoice-grid>div,.pos-sell>*{min-width:0}
.pos-bars{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.pos-bars li{display:grid;grid-template-columns:minmax(110px,160px) minmax(0,1fr) auto auto;gap:10px;align-items:center}
.pos-bars meter{width:100%;height:14px}.pos-bars small{color:#5b6b7c}
.pos-features ul{columns:2;gap:24px;padding-inline-start:20px}.pos-features li{margin-bottom:6px;break-inside:avoid}

/* ---- store dashboard entry */
.store-sidebar a.pos-entry{background:#0876ef;font-weight:700;margin:4px 0 8px}
.pos-promo{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;border:2px solid #0876ef;background:linear-gradient(135deg,#eaf2fd,#fff)}
.pos-promo>div{flex:1 1 320px}.pos-promo h2{margin:2px 0 6px}.pos-promo p{margin:0 0 4px}.pos-promo-state{font-weight:700;color:#07355b}
.pos-promo .o-button{font-size:1.1rem;padding:14px 22px}

@media (max-width:1000px){.pos-sell{grid-template-columns:1fr}.pos-cart{position:static;max-height:none}.pos-invoice-grid{grid-template-columns:1fr}}
@media (max-width:700px){.pos-main{padding:12px 12px 32px}.pos-top{padding:10px 12px}.pos-store{order:3;flex-basis:100%}.pos-report-grid{grid-template-columns:1fr}
  .pos-lines li{grid-template-columns:minmax(0,1fr) auto}.pos-line-total{grid-column:1}.pos-features ul{columns:1}
  .pos-bars li{grid-template-columns:1fr auto}.pos-bars meter{grid-column:1/-1}.pos-row{grid-template-columns:minmax(0,1fr) minmax(0,.8fr) auto}
  .pos-scan-row{flex-wrap:wrap}.pos-scan-row input{flex-basis:100%}.pos-scan-row button{flex:1}.pos-methods{grid-template-columns:1fr 1fr}}

/* ---- printing: only the receipt / labels (commerce.css hides everything with visibility and uses A4 pages) */
#pos-print{display:none}
@page posreceipt{size:auto;margin:3mm}
@media print{
  body.pos-printing>:not(#pos-print){display:none!important}
  body.pos-printing #pos-print{display:block;page:posreceipt}
  body.pos-printing #pos-print,body.pos-printing #pos-print *{visibility:visible!important}
  body.pos-printing{background:#fff!important;margin:0}
  body.pos-printing .pos-receipt{margin:0}
  body.pos-printing .pos-receipt.w-80{width:72mm}body.pos-printing .pos-receipt.w-58{width:48mm}
  body.pos-printing .pos-label-item{break-inside:avoid;page-break-inside:avoid}
}
@media (max-width:700px){.store-sidebar a.pos-entry{display:none}}   /* phones: the first card on «متجري» is the entry; keeps the «المزيد» menu as it was */
