:root{
  --bg:#f4f6fb;
  --card:#ffffff;
  --panel:#ffffff;
  --text:#172033;
  --muted:#667085;
  --line:#e6eaf0;
  --line2:#d8dee8;
  --primary:#4f46e5;
  --primary2:#2563eb;
  --green:#16a34a;
  --red:#dc2626;
  --amber:#d97706;
  --blue:#2563eb;
  --purple:#7c3aed;
  --shadow:0 12px 32px rgba(15,23,42,.08);
  --soft:0 5px 14px rgba(15,23,42,.05);
  --radius:18px;
}
*{box-sizing:border-box;margin:0;padding:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
html,body{min-height:100%;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}.layout{min-height:100vh;padding:10px}.panel{min-height:calc(100vh - 20px);background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:12px;box-shadow:var(--shadow)}
/* login */
.login{min-height:100vh;display:grid;place-items:center;padding:18px;background:linear-gradient(135deg,#f6f8fb,#eef2ff)}.login-card{width:min(410px,100%);background:#fff;border:1px solid var(--line);border-radius:22px;padding:28px;box-shadow:var(--shadow)}.login-card h1{font-size:32px;color:#111827;letter-spacing:-1px;margin-bottom:4px}.login-card p{color:var(--muted);font-size:13px;margin:6px 0 18px}.login-card label{margin-top:8px}.login-card input{margin-bottom:8px}.login-card .btn{width:100%;margin-top:8px}
/* top */
.topbar{display:grid;grid-template-columns:170px 1fr auto;align-items:center;gap:10px;padding:8px 8px 12px;margin-bottom:10px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:9px;font-size:23px;font-weight:900;letter-spacing:-.8px;color:#111827}.brand:before{content:"S";width:34px;height:34px;border-radius:12px;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:17px;box-shadow:var(--soft)}.mini-nav{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap}.mini-nav a,.mini-nav button{min-height:32px;border:1px solid var(--line);background:#fff;color:#344054;padding:7px 10px;border-radius:11px;font-size:12px;font-weight:800;cursor:pointer;transition:.15s}.mini-nav a:hover,.mini-nav a.active{background:#111827;color:#fff;border-color:#111827}.userbox{display:flex;gap:7px;align-items:center;justify-content:flex-end;font-size:12px;color:var(--muted);font-weight:800}.userbox span{background:#f8fafc;border:1px solid var(--line);padding:7px 10px;border-radius:11px}.userbox .btn{height:32px;padding:0 10px;border-radius:11px;font-size:12px}
/* basic controls */
label{display:block;font-size:10px;font-weight:900;color:#667085;margin-bottom:5px;text-transform:uppercase;letter-spacing:.45px}input,select,textarea{width:100%;border:1px solid var(--line2);border-radius:11px;padding:9px 10px;background:#fff;color:#111827;font-weight:650;outline:0;transition:.15s}textarea{resize:vertical;min-height:78px}input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(79,70,229,.10)}.btn{border:0;cursor:pointer;background:var(--primary);color:#fff;min-height:36px;padding:8px 13px;border-radius:11px;font-size:12px;font-weight:900;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;transition:.15s}.btn:hover{filter:brightness(.96);transform:translateY(-1px)}.btn.secondary{background:#fff;color:#344054;border:1px solid var(--line2)}.btn.danger{background:#dc2626;color:#fff}.btn.success{background:#16a34a;color:#fff}.btn.small{min-height:30px;padding:6px 9px;border-radius:9px;font-size:11px}.same-action{width:106px;height:36px;min-height:36px}.action-row,.action-cell{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.action-cell.nowrap{flex-wrap:nowrap!important}.action-cell form{display:inline-flex;margin:0}
/* headers/filter */
.toolbar,.page-head{background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:10px;margin-bottom:10px}.toolbar{display:grid;gap:10px}.toolbar-title,.page-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.toolbar-title h2,.page-head h2{font-size:18px;letter-spacing:-.3px;color:#111827}.toolbar-title p,.page-head p{font-size:12px;color:var(--muted);margin-top:2px}.compact-toolbar{padding:9px}.filter-grid{display:grid;grid-template-columns:1.5fr repeat(3,1fr) auto auto;gap:8px;align-items:end}.live-filter{grid-template-columns:minmax(210px,1fr) 130px 130px 106px 106px 106px!important}.products-filter{grid-template-columns:minmax(220px,1fr) 106px 106px 128px 120px 120px!important}.returns-filter{grid-template-columns:minmax(220px,1fr) 150px 150px 106px 106px 120px!important}.reports-filter{grid-template-columns:150px 150px 106px 106px 120px 128px!important}.sales-report-filter{grid-template-columns:150px 150px 106px 106px!important}.report-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.report-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}.compact-table{max-height:360px;overflow:auto;margin:0}.compact-table table{min-width:0;width:100%}.section-tabs{display:flex;gap:6px;flex-wrap:wrap}.section-tabs a{padding:7px 10px;border:1px solid var(--line);border-radius:11px;background:#fff;font-size:12px;font-weight:850;color:#344054}.section-tabs a.active{background:#111827;color:#fff}.import-btn{position:relative;overflow:hidden}.import-btn input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}
/* tables */
.table-wrap{width:100%;overflow:auto;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:var(--soft);max-height:calc(100vh - 160px)}table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}th,td{padding:8px 9px;border-bottom:1px solid #eef2f6;background:#fff;vertical-align:middle;white-space:nowrap;text-align:center}th{position:sticky;top:0;z-index:5;background:#f8fafc;color:#475467;text-transform:uppercase;font-size:10px;letter-spacing:.35px;font-weight:950}tbody tr:hover td{background:#fbfdff}.empty{text-align:center;padding:28px;color:var(--muted);font-weight:800}.amount,.money,td.amount,td.money{text-align:right!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.products-table{table-layout:fixed;min-width:900px}.products-table .product-name-head,.products-table .product-name-cell{width:34%;min-width:300px;text-align:left!important;white-space:normal!important;line-height:1.3;font-weight:800}.products-table th,.products-table td{padding:9px 10px}.text-clip{display:inline-block;max-width:150px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;cursor:pointer;color:#344054}.plain-wrap,.note-wrap{border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;margin:0!important;color:#344054!important;font-weight:700!important;cursor:pointer!important;line-height:1.25!important;text-align:left!important}.note-wrap{display:inline-block;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.last-update-cell{text-align:left!important;max-width:250px}.address-cell{text-align:left!important;max-width:170px}
/* status/badges */
.badge{display:inline-flex;align-items:center;justify-content:center;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:950;line-height:1;white-space:nowrap}.Pending{background:#fff7d6;color:#9a6700}.Processing{background:#dbeafe;color:#1d4ed8}.Confirmed{background:#dcfce7;color:#166534}.Courier{background:#ede9fe;color:#6d28d9}.Delivered{background:#bbf7d0;color:#14532d}.Cancelled{background:#fee2e2;color:#991b1b}.Need,.NeedReview,.Need-Review{background:#ffedd5;color:#9a3412}.Return,.Returned{background:#ffedd5;color:#9a3412}.free-pill,.locked-pill,.agent-use-pill{display:inline-flex;align-items:center;justify-content:center;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:950}.free-pill{background:#dcfce7;color:#166534}.locked-pill,.agent-use-pill{background:#fee2e2;color:#991b1b}.stock-pill,.status-active,.status-inactive{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:950}.stock-pill,.status-active{background:#dcfce7;color:#166534}.stock-pill.low,.status-inactive{background:#fee2e2;color:#991b1b}.view-btn,.view-img-btn,.invoice-chip{border:0;cursor:pointer;padding:6px 9px;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:11px;font-weight:950;white-space:nowrap}.view-btn:hover,.view-img-btn:hover,.invoice-chip:hover{background:#4338ca;color:#fff}.courier-chip{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#dcfce7;color:#166534;font-size:11px;font-weight:850;margin-right:4px;white-space:nowrap}.courier-error-chip{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:11px;font-weight:850;margin-right:4px;white-space:nowrap}
/* cards reports */
.cards{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin-bottom:10px}.card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;box-shadow:var(--soft)}.card p{font-size:11px;text-transform:uppercase;font-weight:900;color:var(--muted)}.card h3{font-size:22px;color:#111827;margin-top:5px}.notice{padding:10px 12px;border-radius:12px;background:#dcfce7;color:#166534;font-weight:850;margin:8px 0;border:1px solid #bbf7d0}.notice.error{background:#fee2e2;color:#991b1b;border-color:#fecaca}.settings-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;box-shadow:var(--soft)}.settings-card h3{font-size:15px;margin-bottom:10px}.small-section-title{font-size:15px;font-weight:900;color:#344054;margin:4px 0 10px}
/* modals */
.modal{display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(6px);z-index:100;align-items:center;justify-content:center;padding:14px}.modal.show{display:flex}.modal-content{background:#fff;border:1px solid var(--line);box-shadow:0 24px 70px rgba(15,23,42,.22);border-radius:20px;padding:15px;width:min(980px,100%);max-height:94vh;overflow:auto}.modal-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--line)}.modal-head h2{font-size:17px;font-weight:900;color:#111827}.modal-head p{font-size:12px;color:var(--muted);margin-top:2px}.edit-modal-content{width:min(1050px,100%)}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.grid .full{grid-column:span 4}.grid .half{grid-column:span 2}.two-col{grid-template-columns:1fr 1fr}.order-form-row{display:grid;grid-template-columns:1.2fr 1fr 1fr 1fr;gap:10px;align-items:start}.order-form-row.address-row{grid-template-columns:2fr 1fr 1fr}.comment-row{display:grid;grid-template-columns:2fr 1fr;gap:10px}.product-picker{display:grid;grid-template-columns:minmax(240px,1fr) 110px;gap:8px;align-items:end;margin:10px 0}.product-search{margin-bottom:6px}.order-products-table{table-layout:fixed;width:100%;min-width:0!important}.order-products-table th,.order-products-table td{padding:7px 8px!important}.order-products-table .product-col{width:52%}.order-products-table .price-col{width:15%}.order-products-table .qty-col{width:11%}.order-products-table .total-col{width:14%}.order-products-table .action-col{width:8%;text-align:center}.product-cell{white-space:normal!important;text-align:left!important}.product-line{display:flex;align-items:center;gap:6px;flex-wrap:wrap;line-height:1.25}.product-line strong{background:#eef2ff;color:#3730a3;border-radius:999px;padding:3px 7px;font-size:11px;white-space:nowrap}.product-line span{font-weight:800;color:#1f2937}.product-line small{font-size:10px;color:var(--muted);font-weight:750;white-space:nowrap}.remove-btn{width:27px;height:27px;border:0;border-radius:8px;background:#fee2e2;color:#991b1b;font-weight:950;cursor:pointer;display:inline-grid;place-items:center}.remove-btn:hover{background:#ef4444;color:#fff}.totals{margin-left:auto;width:min(330px,100%);border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff}.total-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 11px;border-bottom:1px solid var(--line);font-weight:850}.total-row:last-child{border-bottom:0;background:#111827;color:#fff}.image-preview-wrap{display:grid;place-items:center;min-height:310px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:16px;overflow:hidden}.image-preview-wrap img{max-width:100%;max-height:70vh;border-radius:14px;object-fit:contain}
/* invoice */
.invoice-paper{width:148mm;min-height:210mm;background:white;padding:12mm;margin:auto;border-radius:8px;box-shadow:0 18px 45px rgba(15,23,42,.18);color:#111827}.invoice-head,.invoice-header{display:flex;justify-content:space-between;gap:14px;border-bottom:2px solid #111827;padding-bottom:12px;margin-bottom:12px}.invoice-head h1,.invoice-header h1{font-size:28px}.invoice-table{width:100%;border-collapse:collapse;margin:12px 0}.invoice-table th,.invoice-table td{border:1px solid #cbd5e1;padding:8px;position:static;white-space:normal;box-shadow:none;text-align:left}.invoice-total{width:270px;margin-left:auto;border:1px solid #cbd5e1;border-radius:10px;overflow:hidden;font-size:13px}.invoice-total-row{display:flex;justify-content:space-between;padding:9px 11px;border-bottom:1px solid #e2e8f0}.invoice-total-row:last-child{border-bottom:0;background:#111827;color:#fff;font-weight:900}.invoice-footer{margin-top:36px;display:flex;justify-content:space-between;align-items:flex-end;font-size:12px}.signature-line{width:160px;border-top:1px solid #111827;padding-top:6px;text-align:center}
@media print{body *{visibility:hidden}#invoicePrintArea,#invoicePrintArea *{visibility:visible}#invoicePrintArea{position:absolute;left:0;top:0;width:148mm}.invoice-paper{box-shadow:none;border-radius:0;width:148mm;min-height:210mm}@page{size:A5;margin:0}}
/* responsive */
@media(max-width:1100px){.topbar{grid-template-columns:1fr;align-items:start}.mini-nav{justify-content:flex-start}.userbox{justify-content:flex-start}.filter-grid,.live-filter,.products-filter,.returns-filter,.reports-filter,.sales-report-filter{grid-template-columns:1fr 1fr!important}.report-grid-2,.report-grid-3{grid-template-columns:1fr!important}.table-wrap{max-height:none;overflow-x:auto}table{min-width:900px}.cards{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.layout{padding:6px}.panel{border-radius:16px;padding:8px}.filter-grid,.live-filter,.products-filter,.returns-filter,.reports-filter,.grid,.two-col,.order-form-row,.order-form-row.address-row,.comment-row{grid-template-columns:1fr!important}.grid .full,.grid .half{grid-column:span 1}.toolbar-title,.page-head,.modal-head{align-items:flex-start;flex-direction:column}.same-action,.btn{width:100%}.cards{grid-template-columns:1fr}.product-picker{grid-template-columns:1fr}.invoice-paper{width:100%;min-height:auto;padding:14px}}

/* v39 final classic compact UI */
body{background:#f4f6f8!important}.layout{padding:6px!important}.panel{border-radius:14px!important;padding:8px!important}.topbar{margin-bottom:7px!important;padding:6px 8px!important;border-radius:12px!important}.brand{font-size:16px!important}.mini-nav{gap:4px!important}.mini-nav a{padding:5px 8px!important;font-size:11px!important;border-radius:9px!important}.userbox span{font-size:12px!important}.toolbar,.page-head{padding:7px!important;margin-bottom:7px!important;border-radius:12px!important}.filter-grid,.live-filter{gap:6px!important;align-items:end!important}.filter-grid label,.live-filter label,label{font-size:10px!important;margin-bottom:3px!important}input,select,textarea{border-radius:9px!important;padding:7px 8px!important;font-size:12px!important}.btn{border-radius:9px!important;padding:7px 10px!important;font-size:12px!important;box-shadow:none!important}.btn.small,.small{padding:5px 8px!important;font-size:11px!important}.same-action{height:34px!important;min-width:86px!important}.table-wrap{border-radius:12px!important;max-height:calc(100vh - 125px)!important}th,td{padding:6px 7px!important;vertical-align:middle!important;text-align:center!important}th{font-size:9.5px!important}.text-left,.address-cell,.last-update-cell{text-align:left!important}.view-btn,.view-img-btn,.invoice-chip{padding:5px 8px!important;font-size:10.5px!important}.badge,.free-pill,.locked-pill,.agent-use-pill{padding:4px 7px!important;font-size:9.5px!important}.modal-content{border-radius:14px!important;padding:11px!important}.modal-head{padding-bottom:7px!important;margin-bottom:8px!important}.modal-head h2{font-size:15px!important}.modal-head p{font-size:11px!important}.order-modal-content,.edit-modal-content{width:min(1040px,98vw)!important}.order-form-row{display:grid!important;grid-template-columns:1.12fr 1fr 1fr .9fr!important;gap:7px!important;align-items:start!important;margin-bottom:7px!important}.order-form-row.address-row{grid-template-columns:2.1fr 1fr 1fr!important}.order-form-row textarea{min-height:34px!important;resize:vertical!important}.customer-check-box{border:1px solid #e5e7eb;background:#f8fafc;border-radius:10px;padding:7px 9px;margin:-1px 0 7px;font-size:11.5px;color:#344054}.check-line{margin:2px 0}.muted-text{color:#667085}.classic-picker{grid-template-columns:minmax(280px,1fr) 70px!important;gap:7px!important;align-items:end!important;margin:7px 0!important}.classic-picker select{height:118px!important}.product-search{margin-bottom:5px!important}.aligned-add{height:34px!important;width:64px!important;margin-bottom:0!important}.product-table-wrap{max-height:230px!important;margin:6px 0!important}.order-products-table{table-layout:fixed!important}.order-products-table .product-col{width:56%!important}.order-products-table .price-col{width:14%!important}.order-products-table .qty-col{width:10%!important}.order-products-table .total-col{width:13%!important}.order-products-table .action-col{width:7%!important}.product-cell{text-align:left!important}.product-line{gap:5px!important}.product-line strong{font-size:10px!important;padding:2px 6px!important}.product-line span{font-size:12px!important}.product-line small{font-size:10px!important}.order-bottom-row{display:grid;grid-template-columns:1.4fr .9fr;gap:8px;align-items:start;margin-top:7px}.comment-card,.payment-card{border:1px solid #e5e7eb;background:#fff;border-radius:12px;padding:8px}.comment-card textarea{min-height:96px!important}.payment-card{display:grid;grid-template-columns:1fr 1fr;gap:7px}.payment-card .totals{grid-column:span 2;width:100%!important;margin:0!important}.compact-totals .total-row{padding:7px 9px!important}.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:9px}.compact-history{margin-top:8px;border:1px solid #e5e7eb;border-radius:12px;padding:8px;background:#fafafa}.compact-history h3{font-size:13px;margin-bottom:6px}.history-item{border-bottom:1px solid #e5e7eb;padding:5px 0}.history-item:last-child{border-bottom:0}.courier-headline{display:flex!important;align-items:center!important;justify-content:space-between!important}.courier-headline span{font-size:11px;color:#667085;margin-left:6px}.settings-card{padding:10px!important;border-radius:12px!important}.cards{gap:7px!important}.card{padding:9px!important;border-radius:12px!important}.card h3{font-size:18px!important}@media(max-width:900px){.order-form-row,.order-form-row.address-row,.order-bottom-row,.payment-card{grid-template-columns:1fr!important}.payment-card .totals{grid-column:span 1}.classic-picker{grid-template-columns:1fr!important}.aligned-add{width:100%!important}.table-wrap{overflow-x:auto!important}table{min-width:900px!important}}

/* v43 image-inspired classic POS order modal */
.pos-order-modal,.edit-modal-content{width:min(1080px,96vw)!important;padding:18px!important;border-radius:18px!important;background:#fff!important}.pos-edit-fragment{padding:0!important;background:#fff!important;border:0!important;box-shadow:none!important;min-height:auto!important}.pos-head{padding:0 0 14px!important;margin-bottom:14px!important;border-bottom:1px solid #e5e7eb!important}.pos-head h2{font-size:24px!important;font-weight:800!important;color:#172033!important;letter-spacing:-.5px!important}.pos-head p{font-size:12px!important;color:#667085!important}.modal-x{width:34px;height:34px;border:1px solid #d9dee8;background:#fff;color:#344054;border-radius:10px;font-size:24px;line-height:1;cursor:pointer;display:grid;place-items:center}.modal-x:hover{background:#f8fafc}.pos-shell{display:grid;grid-template-columns:330px 1fr;gap:14px;align-items:stretch}.pos-customer-panel,.pos-card{border:1px solid #e5e7eb;border-radius:12px;background:#fff;padding:12px}.pos-customer-panel h3,.pos-card h3{font-size:15px!important;color:#172033!important;margin:0 0 12px!important;font-weight:850!important}.pos-field{margin-bottom:12px}.pos-field label,.pos-card label{font-size:11px!important;color:#344054!important;text-transform:none!important;letter-spacing:0!important;font-weight:800!important;margin-bottom:6px!important}.pos-field input,.pos-field select,.pos-field textarea,.pos-card input,.pos-card select,.pos-card textarea{height:38px!important;border-radius:8px!important;border:1px solid #dfe4ea!important;background:#fff!important;padding:8px 10px!important;font-size:12px!important;box-shadow:none!important}.pos-field textarea{height:44px!important;min-height:44px!important}.phone-check-input{display:grid;grid-template-columns:1fr 62px;gap:8px}.phone-check-input .btn{height:38px!important;min-height:38px!important;border-radius:8px!important}.customer-check-box{font-size:11px!important;padding:8px!important;margin:-4px 0 10px!important;border-radius:8px!important}.pos-main-panel{display:grid;grid-template-rows:auto auto;gap:12px}.pos-products-card{min-height:320px}.pos-product-search{height:38px!important;margin-bottom:10px!important}.pos-product-list{border:1px solid #e5e7eb;border-radius:9px;overflow:auto;max-height:255px}.pos-product-list table{min-width:0!important;width:100%!important;font-size:12px!important}.pos-product-list th,.pos-product-list td{padding:7px 8px!important;text-align:left!important;white-space:nowrap!important}.pos-product-list th{font-size:10px!important;background:#f8fafc!important;color:#344054!important}.pos-product-list td:nth-child(3),.pos-product-list td:nth-child(4),.pos-product-list td:nth-child(5),.pos-product-list th:nth-child(3),.pos-product-list th:nth-child(4),.pos-product-list th:nth-child(5){text-align:center!important}.pos-prod-name{font-weight:700;color:#27364b;max-width:290px;overflow:hidden;text-overflow:ellipsis}.mini-add{height:28px;min-width:48px;border-radius:7px;border:1px solid #c7d2fe;background:#fff;color:#4f46e5;font-weight:850;font-size:11px;cursor:pointer}.mini-add:hover{background:#4f46e5;color:#fff}.pos-cart-card{padding-bottom:12px}.pos-cart-wrap{max-height:190px!important;border-radius:9px!important;box-shadow:none!important;margin:0!important}.pos-cart-table{min-width:0!important}.pos-cart-table th,.pos-cart-table td{padding:7px 8px!important}.pos-cart-table .product-col{width:50%!important}.pos-cart-table .price-col{width:14%!important}.pos-cart-table .qty-col{width:13%!important}.pos-cart-table .total-col{width:15%!important}.pos-cart-table .action-col{width:8%!important}.pos-summary-grid{display:grid;grid-template-columns:1fr 280px;gap:12px;border:1px solid #e5e7eb;border-radius:10px;margin-top:12px;overflow:hidden}.pos-payment-fields{padding:12px;display:grid;grid-template-columns:120px 1fr;gap:10px;align-items:center}.pos-payment-fields label{margin:0!important}.pos-payment-fields input{height:34px!important}.pos-totals{padding:12px;border-left:1px solid #e5e7eb}.pos-totals div{display:flex;justify-content:space-between;gap:10px;padding:5px 0;font-size:13px}.pos-totals .due{font-size:18px;color:#4f46e5;font-weight:900;border-top:1px solid #eef2f6;margin-top:6px;padding-top:8px}.pos-footer-row{display:grid;grid-template-columns:1fr 300px;gap:14px;margin-top:14px;align-items:stretch}.pos-comment-card textarea{height:58px!important;min-height:58px!important}.pos-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:12px;align-items:end}.pos-actions .btn{height:54px!important;border-radius:10px!important;font-size:14px!important}.pos-actions .btn.secondary{background:#fff!important}.product-line{display:block!important;line-height:1.25!important}.product-line strong{display:inline-block;margin-right:6px}.product-line span{display:inline!important}.product-line small{display:block;margin-top:2px}.remove-btn{font-size:15px!important;color:#dc2626!important;background:transparent!important;border:0!important}.remove-btn:hover{background:#fee2e2!important;color:#991b1b!important}.history-box.compact-history{margin-top:14px!important}.modal .table-wrap{overflow:auto!important}@media(max-width:980px){.pos-shell{grid-template-columns:1fr}.pos-summary-grid{grid-template-columns:1fr}.pos-totals{border-left:0;border-top:1px solid #e5e7eb}.pos-footer-row{grid-template-columns:1fr}.pos-actions{grid-template-columns:1fr 1fr}}@media(max-width:640px){.pos-payment-fields{grid-template-columns:1fr}.pos-actions{grid-template-columns:1fr}.pos-actions .btn{height:42px!important}.pos-head h2{font-size:20px!important}}

/* v44 compact POS modal refinements */
.pos-order-modal,.edit-modal-content{width:min(1040px,96vw)!important;max-height:92vh!important;padding:14px!important;border-radius:16px!important;}
.pos-head{padding:0 0 10px!important;margin-bottom:10px!important;}
.pos-head h2{font-size:20px!important;line-height:1.15!important;font-weight:800!important;}
.pos-head p{display:none!important;}
.modal-x{width:30px!important;height:30px!important;border-radius:8px!important;font-size:20px!important;}
.pos-shell{grid-template-columns:300px 1fr!important;gap:10px!important;}
.pos-customer-panel,.pos-card{padding:10px!important;border-radius:10px!important;}
.pos-customer-panel h3,.pos-card h3{font-size:13px!important;margin:0 0 8px!important;}
.pos-field{margin-bottom:8px!important;}
.pos-field label,.pos-card label{font-size:10.5px!important;margin-bottom:4px!important;}
.pos-field input,.pos-field select,.pos-field textarea,.pos-card input,.pos-card select,.pos-card textarea{height:34px!important;border-radius:7px!important;padding:7px 9px!important;font-size:12px!important;}
.pos-field textarea{height:38px!important;min-height:38px!important;}
.phone-check-input{display:block!important;}
.phone-check-input .btn{display:none!important;}
.customer-check-box{font-size:10.5px!important;padding:6px 7px!important;margin:-2px 0 8px!important;line-height:1.25!important;}
.pos-main-panel{gap:10px!important;}
.pos-products-card{min-height:0!important;}
.pos-product-search{height:34px!important;margin-bottom:7px!important;}
.pos-product-list{max-height:220px!important;border-radius:8px!important;}
.pos-product-list table{font-size:11.5px!important;}
.pos-product-list th,.pos-product-list td{padding:5px 7px!important;}
.pos-product-list th{font-size:9.5px!important;}
.pos-prod-name{max-width:320px!important;}
.mini-add{height:24px!important;min-width:42px!important;font-size:10.5px!important;border-radius:6px!important;}
.pos-cart-card{padding-bottom:10px!important;}
.pos-cart-wrap{max-height:155px!important;border-radius:8px!important;}
.pos-cart-table th,.pos-cart-table td{padding:5px 7px!important;font-size:11.5px!important;}
.pos-cart-table input{height:28px!important;padding:4px 6px!important;font-size:11.5px!important;}
.pos-cart-table .product-col{width:52%!important;}.pos-cart-table .price-col{width:13%!important;}.pos-cart-table .qty-col{width:12%!important;}.pos-cart-table .total-col{width:15%!important;}.pos-cart-table .action-col{width:8%!important;}
.remove-btn{font-size:14px!important;}
.pos-summary-grid{grid-template-columns:1fr 255px!important;gap:0!important;margin-top:9px!important;border-radius:8px!important;}
.pos-payment-fields{padding:9px!important;grid-template-columns:115px 1fr!important;gap:7px!important;}
.pos-payment-fields input{height:30px!important;}
.pos-totals{padding:9px!important;}.pos-totals div{padding:3px 0!important;font-size:12px!important;}.pos-totals .due{font-size:16px!important;margin-top:4px!important;padding-top:6px!important;}
.pos-footer-row{grid-template-columns:1fr 260px!important;gap:10px!important;margin-top:10px!important;}
.pos-comment-card textarea{height:48px!important;min-height:48px!important;}
.pos-actions{gap:9px!important;}.pos-actions .btn{height:46px!important;border-radius:9px!important;font-size:13px!important;}
.history-box.compact-history{margin-top:10px!important;max-height:105px!important;overflow:auto!important;}.history-item{padding:4px 0!important;}.history-item p{font-size:11.5px!important;line-height:1.25!important;}.history-item small{font-size:10px!important;}
@media(max-width:980px){.pos-order-modal,.edit-modal-content{max-height:94vh!important;}.pos-shell{grid-template-columns:1fr!important;}.pos-product-list{max-height:210px!important;}.pos-cart-wrap{max-height:170px!important;}.pos-summary-grid{grid-template-columns:1fr!important;}.pos-totals{border-left:0!important;border-top:1px solid #e5e7eb!important;}.pos-footer-row{grid-template-columns:1fr!important;}}

/* v45 final compact POS refinements */
.pos-product-list{
  max-height: 173px !important; /* show about 4 product rows, then scroll */
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.pos-product-list table{
  table-layout: fixed !important;
}
.pos-product-list th:nth-child(1), .pos-product-list td:nth-child(1){width: 42% !important;}
.pos-product-list th:nth-child(2), .pos-product-list td:nth-child(2){width: 22% !important;}
.pos-product-list th:nth-child(3), .pos-product-list td:nth-child(3){width: 13% !important;}
.pos-product-list th:nth-child(4), .pos-product-list td:nth-child(4){width: 10% !important;}
.pos-product-list th:nth-child(5), .pos-product-list td:nth-child(5){width: 13% !important;}
.pos-prod-name{
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.pos-cart-wrap{
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 170px !important;
}
.pos-cart-table{
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
.pos-cart-table th,
.pos-cart-table td{
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.pos-cart-table .product-col{width: 46% !important;}
.pos-cart-table .price-col{width: 14% !important;}
.pos-cart-table .qty-col{width: 16% !important;}
.pos-cart-table .total-col{width: 15% !important;}
.pos-cart-table .action-col{width: 9% !important;}
.pos-cart-table .product-cell,
.pos-cart-table .product-line,
.pos-cart-table .product-line span{
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  font-size: 10.5px !important;
  line-height: 1.25 !important;
}
.pos-cart-table .product-line strong{
  display: inline !important;
  font-size: 9px !important;
  padding: 1px 4px !important;
  margin-right: 4px !important;
}
.pos-cart-table .product-line small{
  display: none !important;
}
.pos-cart-table input[name="price[]"],
.pos-cart-table input[name="item_qty[]"]{
  height: 27px !important;
  padding: 3px 5px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}
.pos-comment-card{
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.pos-comment-card h3{
  margin-bottom: 6px !important;
}
.pos-comment-card textarea{
  height: 62px !important;
  min-height: 62px !important;
  border: 1px solid #dfe4ea !important;
  background: #fff !important;
}
.pos-footer-row{
  align-items: end !important;
}
.pos-actions{
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  align-items: end !important;
  height: 100% !important;
}
.pos-actions .btn{
  height: 44px !important;
  min-height: 44px !important;
  width: 100% !important;
  padding: 0 12px !important;
  margin: 0 !important;
  font-size: 13px !important;
  border-radius: 9px !important;
}
.customer-check-box{
  min-height: 30px !important;
}
@media(max-width:980px){
  .pos-product-list{max-height: 175px !important;}
  .pos-footer-row{grid-template-columns: 1fr !important;}
}

/* v46 refinements: cleaner customer panel, tighter POS products/card spacing, aligned footer */
.pos-customer-panel h3{display:none!important;}
.pos-customer-panel{padding-top:10px!important;}
.pos-products-card{min-height:0!important;padding-bottom:8px!important;margin-bottom:0!important;}
.pos-products-card h3{margin-bottom:6px!important;}
.pos-product-search{margin-bottom:6px!important;}
.pos-product-list{max-height:168px!important;margin-bottom:0!important;}
.pos-main-panel{grid-template-rows:auto 1fr!important;gap:8px!important;}
.pos-cart-card{margin-top:0!important;}
.pos-footer-row{align-items:end!important;grid-template-columns:1fr 260px!important;margin-top:8px!important;}
.pos-comment-card{border:0!important;background:transparent!important;padding:0!important;box-shadow:none!important;}
.pos-comment-card h3{margin-bottom:5px!important;font-size:12px!important;}
.pos-comment-card textarea{height:54px!important;min-height:54px!important;resize:vertical!important;}
.pos-actions{align-items:end!important;height:54px!important;}
.pos-actions .btn{height:54px!important;min-height:54px!important;margin:0!important;}
@media(max-width:980px){.pos-footer-row{grid-template-columns:1fr!important}.pos-actions{height:auto!important}.pos-actions .btn{height:44px!important;min-height:44px!important}}

/* v47 invoice A5 polish + bulk print */
.invoice-modal-content{width:min(760px,96vw)!important;background:#f7f8fb!important}
#invoicePrintArea{background:transparent!important;padding:0!important;box-shadow:none!important;border-radius:0!important;width:auto!important;min-height:0!important}
.invoice-paper{width:148mm!important;min-height:210mm!important;background:#fff!important;margin:0 auto!important;padding:10mm 11mm!important;border-radius:8px!important;box-shadow:0 18px 45px rgba(15,23,42,.16)!important;color:#111827!important;font-family:Arial,sans-serif!important;page-break-after:always!important;overflow:hidden!important}
.invoice-paper:last-child{page-break-after:auto!important}
.invoice-top{display:flex!important;justify-content:space-between!important;gap:16px!important;border-bottom:2px solid #111827!important;padding-bottom:9px!important;margin-bottom:9px!important}
.invoice-brand h1{font-size:26px!important;line-height:1!important;margin:0 0 5px!important;font-weight:900!important;letter-spacing:-.5px!important}
.invoice-brand p,.invoice-meta p,.invoice-customer p,.invoice-small{font-size:11px!important;line-height:1.45!important;color:#334155!important;margin:2px 0!important}
.invoice-meta{text-align:right!important;min-width:150px!important}
.invoice-title{text-align:center!important;font-size:16px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:1.2px!important;margin:9px 0!important}
.invoice-customer{border:1px solid #cbd5e1!important;border-radius:8px!important;padding:8px!important;margin-bottom:9px!important}
.invoice-customer h3{font-size:12px!important;text-transform:uppercase!important;margin:0 0 5px!important}
.invoice-table{width:100%!important;border-collapse:collapse!important;margin:9px 0!important;font-size:11px!important;table-layout:fixed!important}
.invoice-table th,.invoice-table td{border:1px solid #cbd5e1!important;padding:7px 8px!important;position:static!important;white-space:normal!important;box-shadow:none!important;text-align:left!important;vertical-align:top!important}
.invoice-table th{background:#f1f5f9!important;font-size:10px!important;text-transform:uppercase!important;color:#334155!important}
.invoice-products{width:58%!important}.invoice-qty{width:12%!important;text-align:center!important}.invoice-money{text-align:right!important}
.invoice-total{width:250px!important;margin-left:auto!important;border:1px solid #cbd5e1!important;border-radius:8px!important;overflow:hidden!important;font-size:12px!important}
.invoice-row{display:flex!important;justify-content:space-between!important;padding:7px 10px!important;border-bottom:1px solid #e2e8f0!important}
.invoice-row:last-child{border-bottom:0!important;background:#111827!important;color:#fff!important;font-weight:900!important}
.invoice-footer{margin-top:28px!important;display:flex!important;justify-content:space-between!important;align-items:flex-end!important;font-size:11px!important;color:#334155!important}
.signature-line{width:150px!important;border-top:1px solid #111827!important;padding-top:6px!important;text-align:center!important;color:#111827!important}
.bulk-print-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin:8px 0}
@media print{body *{visibility:hidden!important}#invoicePrintArea,#invoicePrintArea *{visibility:visible!important}#invoicePrintArea{position:absolute!important;left:0!important;top:0!important;width:148mm!important}.invoice-paper{box-shadow:none!important;border-radius:0!important;width:148mm!important;min-height:210mm!important;margin:0!important}@page{size:A5;margin:0}}
.check-line.fraud-ok{color:#166534;font-weight:700}.check-line.fraud-error{color:#b91c1c;font-weight:700}

/* Profit Calculation module */
.profit-hero{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:end;background:linear-gradient(135deg,#111827,#4338ca);color:#fff;border-radius:20px;padding:18px;margin-bottom:12px;box-shadow:var(--shadow)}
.profit-hero h1{font-size:28px;letter-spacing:-.8px;margin:0 0 4px;font-weight:950}.profit-hero p{color:#dbeafe;font-size:13px;max-width:760px}.profit-filter{display:grid;grid-template-columns:145px 145px 140px 96px 96px;gap:8px;align-items:end;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);padding:10px;border-radius:16px;backdrop-filter:blur(8px)}.profit-filter label{color:#e0e7ff}.profit-filter input{border-color:rgba(255,255,255,.25)}
.profit-kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:10px}.profit-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:#fff;box-shadow:var(--soft);min-height:115px}.profit-card span{display:block;font-size:11px;color:var(--muted);font-weight:950;text-transform:uppercase;letter-spacing:.35px}.profit-card strong{display:block;font-size:24px;letter-spacing:-.8px;margin:9px 0 4px;color:#111827}.profit-card small{color:var(--muted);font-size:11px;font-weight:750;line-height:1.35}.profit-card.blue{background:#eff6ff;border-color:#bfdbfe}.profit-card.green{background:#f0fdf4;border-color:#bbf7d0}.profit-card.purple{background:#f5f3ff;border-color:#ddd6fe}.profit-card.amber{background:#fffbeb;border-color:#fde68a}.profit-card.red{background:#fef2f2;border-color:#fecaca}.profit-card.dark{background:#111827;border-color:#111827}.profit-card.dark span,.profit-card.dark small{color:#cbd5e1}.profit-card.dark strong{color:#fff}
.profit-period-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}.profit-mini{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;box-shadow:var(--soft)}.profit-mini b{font-size:12px;color:#475467;text-transform:uppercase;letter-spacing:.35px}.profit-mini span{display:block;font-size:24px;font-weight:950;margin:5px 0;color:#111827}.profit-mini small{color:var(--muted);font-weight:750}
.profit-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.profit-box{background:#fff;border:1px solid var(--line);border-radius:18px;padding:13px;box-shadow:var(--soft);margin-bottom:10px}.profit-box h3{font-size:16px;margin-bottom:10px;letter-spacing:-.25px;color:#111827}.profit-form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:8px}.profit-box textarea{min-height:54px;margin-bottom:8px}.profit-summary-list{display:grid;gap:7px}.profit-summary-list div{display:flex;justify-content:space-between;align-items:center;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:9px 10px}.profit-summary-list span{font-size:12px;color:var(--muted);font-weight:850}.profit-summary-list b{font-size:14px;color:#111827}.profit-pos{color:#15803d}.profit-neg{color:#dc2626}.profit-box .table-wrap{max-height:420px}.notice{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534;font-weight:850;border-radius:14px;padding:10px 12px;margin-bottom:10px}.notice.error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
@media(max-width:1180px){.profit-kpis{grid-template-columns:repeat(3,1fr)}.profit-hero{grid-template-columns:1fr}.profit-filter{grid-template-columns:repeat(3,1fr) 96px 96px}}
@media(max-width:780px){.profit-kpis,.profit-period-grid,.profit-grid-2{grid-template-columns:1fr}.profit-filter,.profit-form-grid{grid-template-columns:1fr}.profit-hero h1{font-size:24px}}

.instant-edit-shell{padding:18px;background:#fff;border-radius:18px;min-height:90px}.instant-edit-shell p{margin:4px 0 0;color:#64748b}.edit-frame-modal.show{display:flex}.edit-modal-body{min-height:80px}


/* Website order source badge beside invoice number */
.invoice-source-cell{display:flex;align-items:center;gap:6px;justify-content:center;white-space:nowrap}
.source-logo{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;font-weight:800;font-size:12px;color:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18)}
.source-logo.shopify{background:#5e8e3e}
.source-logo.woocommerce{background:#7f54b3}
.integration-copy{font-family:monospace;background:#f7f7f7;border:1px solid #ddd;border-radius:8px;padding:10px;word-break:break-all}

/* Website product SKU matching */
.website-order-note{margin:6px 0 0;color:#64748b;font-size:13px}
.unmatched-order-alert{margin:0 0 12px 0;border-left:4px solid #ef4444;background:#fff1f2;color:#991b1b;padding:10px 12px;border-radius:10px;font-weight:600}
.unmatched-item-row{background:#fff7ed}
.unmatched-product-badge{display:inline-block;margin-top:5px;background:#fee2e2;color:#991b1b;border:1px solid #fecaca;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:700}
.blocked-save-pill{display:inline-block;background:#991b1b;color:#fff;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700}
/* Website unmatched SKU warning + readonly discount row */
.website-discount-row{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:6px 8px;color:#166534}
.unmatched-product-badge{display:inline-flex;align-items:center;gap:4px}
