@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');
*{box-sizing:border-box}body{margin:0;font-family:Arial,"Tahoma",sans-serif;background:#f5f8f6;color:#20352e}button,input,select{font-family:inherit}.sidebar{position:fixed;right:0;top:0;bottom:0;width:255px;background:#173f35;color:#eaf4ef;padding:24px 15px;display:flex;flex-direction:column;z-index:10}.brand{font-size:25px;font-weight:800;display:flex;align-items:center;gap:0;padding:0 12px}.brand-z{color:#e53935;font-weight:950;font-size:31px}.company{margin:28px 10px 18px;border-bottom:1px solid #356055;padding-bottom:16px;display:grid;gap:3px}.company small,.user small{color:#aac1b9;font-size:11px}nav{display:grid;gap:4px;overflow:auto}.nav-item{font-size:13px;color:#c4d7d0;border:0;background:transparent;text-align:right;padding:11px 12px;border-radius:9px;cursor:pointer}.nav-item span{margin-left:10px;font-size:16px}.nav-item:hover,.nav-item.active{background:#285448;color:#fff}.user{margin-top:auto;padding:13px 8px;display:flex;gap:10px;align-items:center;border-top:1px solid #356055}.avatar{background:#e6af4b;color:#173f35;width:35px;height:35px;border-radius:50%;display:grid;place-items:center;font-weight:bold}main{margin-right:255px;min-height:100vh;padding:0 34px 35px}header{height:92px;border-bottom:1px solid #e1e7e4;display:flex;align-items:center;justify-content:space-between}h1,h2,h3,p{margin:0}h1{font-size:23px}header p{color:#779088;font-size:12px;margin-top:4px}.head-actions{display:flex;align-items:center;gap:9px}.secondary,.date{border:1px solid #dce5e1;background:#fff;border-radius:8px;padding:8px 12px;color:#40564e;cursor:pointer}.primary{background:#1a805d;color:#fff;border:0;border-radius:8px;padding:10px 15px;cursor:pointer;font-weight:700}.menu{display:none;border:0;background:none;font-size:22px}.page{display:none;padding-top:24px}.page.active{display:block}.page-top,.products-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}.page-top h2,.products-bar h2{font-size:18px}.page-top p{color:#779088;font-size:12px;margin-top:3px}.panel{background:#fff;border:1px solid #e8eeeb;border-radius:12px;padding:16px;margin-bottom:18px}.products-bar{background:#fff;border:1px solid #e3ebe7;border-radius:12px;padding:11px 14px;position:sticky;top:0;z-index:2}.product-actions,.bar-sync{display:flex;align-items:center;gap:7px}.bar-sync{margin-right:auto}.bar-sync small,.last-sync{font-size:10px;color:#789087;white-space:nowrap}.product-tools{display:flex;align-items:center;gap:12px;margin-bottom:8px}.product-tools>input,.checkout-form input,.checkout-form select{border:1px solid #d8e2de;border-radius:8px;padding:9px;font:inherit}.product-tools>input{flex:1}.product-tools span{font-size:11px;color:#71877f}.page-size{font-size:11px;color:#71877f}.page-size select{padding:7px;border:1px solid #d8e2de;border-radius:7px}table{width:100%;border-collapse:collapse;text-align:right}th{color:#82958e;font-weight:500;font-size:11px;padding:10px;border-bottom:1px solid #e7ece9;white-space:nowrap}td{padding:8px 10px;border-bottom:1px solid #edf1ef;font-size:12px}.table-wrap{overflow:auto}.inline-price{width:92px;border:1px solid #dce6e1;border-radius:6px;padding:6px;background:#fff}.row-actions{white-space:nowrap}.icon-action{width:29px;height:29px;border:1px solid #d6e4de;background:#fff;border-radius:7px;cursor:pointer;margin-left:3px}.icon-action.danger{color:#c0392b}.profit-percent{font-weight:700}.stock-red{background:#fff0f0}.stock-yellow{background:#fff9df}.stock-green{background:#effaf3}.stock-pill{display:inline-block;padding:4px 8px;border-radius:15px;background:#fff}.stock-red .stock-pill{color:#c62828;background:#ffdcdc}.stock-yellow .stock-pill{color:#a87900;background:#ffefaa}.stock-green .stock-pill{color:#16804f;background:#dff4e8}.empty{text-align:center;color:#879991;padding:35px 10px}.pager{display:flex;justify-content:center;align-items:center;gap:12px;padding:13px}.pager button{border:1px solid #d8e2de;background:#fff;border-radius:7px;padding:6px 11px}.home-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:17px}.home-card{background:#fff;border:1px solid #e5ece8;border-radius:16px;min-height:145px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;cursor:pointer;box-shadow:0 3px 12px #173f3509;transition:.2s}.home-card:hover{transform:translateY(-3px);border-color:#1a805d}.home-card b{font-size:36px}.home-card strong{font-size:15px}.simple-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.category-card{border:1px solid #e4ece8;border-radius:11px;padding:18px;display:flex;flex-direction:column;gap:8px}.category-card b{font-size:25px}.category-card span{color:#7b9088;font-size:11px}.report-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}.report-cards article{background:#fff;border:1px solid #e8eeeb;padding:21px;border-radius:12px}.report-cards span{color:#789087;font-size:12px}.report-cards strong{font-size:23px;display:block;margin-top:9px}.settings-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:17px}.settings-grid label{display:grid;gap:6px;font-size:12px;color:#536860;margin-top:12px}.settings-grid input{border:1px solid #d8e2de;border-radius:8px;padding:9px}.setting-preview{font-size:25px;font-weight:bold;margin-top:16px}.pos-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(350px,.9fr);gap:18px;direction:rtl}.pos-catalog,.pos-cart{direction:rtl;border:1px solid #e5ece8;border-radius:13px;background:#fff;padding:15px}.pos-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.pos-top h3,.pos-cart-head h3{font-size:16px}.pos-top small{font-size:10px;color:#7b9088}.pos-search{position:relative;min-width:280px}.pos-search input{width:100%;border:1px solid #d8e2de;border-radius:8px;padding:10px 34px 10px 10px;font:inherit}.pos-search span{position:absolute;right:11px;top:8px;color:#80948d}.pos-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-height:560px;overflow:auto;padding:2px}.pos-product{border:1px solid #e1eae6;background:#fbfdfc;border-radius:9px;padding:12px;text-align:right;cursor:pointer;display:flex;flex-direction:column;gap:6px;min-height:86px;font:inherit}.pos-product:hover{border-color:#1a805d}.pos-product strong{font-size:12px;line-height:1.4}.pos-product span{font-size:11px;color:#16805c;font-weight:800}.pos-product em{font-style:normal;color:#8b6b12;font-size:10px}.pos-cart{display:flex;flex-direction:column;min-height:620px}.pos-cart-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;border-bottom:1px solid #edf1ef}.pos-count{font-size:10px;color:#16805c;background:#e5f5ee;padding:5px 8px;border-radius:15px}.party-field{display:grid;gap:5px;margin:12px 0;font-size:11px}.party-field input{border:1px solid #d8e2de;border-radius:8px;padding:9px}.pos-cart-items{flex:1;overflow:auto;padding:5px 0}.cart-line{display:grid;grid-template-columns:1fr auto auto;gap:7px;align-items:center;padding:9px;border-bottom:1px solid #edf1ef}.cart-line strong{font-size:11px}.cart-line small{display:block;color:#7b9088;font-size:9px;margin-top:3px}.cart-line-actions{display:flex;align-items:center;gap:4px;direction:ltr}.cart-line-actions button{width:25px;height:25px;border:1px solid #d6e4de;background:#fff;border-radius:6px;cursor:pointer}.cart-line-actions b{min-width:18px;text-align:center}.danger-icon{color:#bd5d5d}.cart-cost{width:80px;border:1px solid #d8e2de;border-radius:6px;padding:5px}.pos-summary,.pos-profit-row{display:flex;justify-content:space-between;align-items:center;padding:11px 0;border-top:1px solid #e8eeeb}.pos-summary strong{font-size:20px}.pos-profit-row{font-size:11px;color:#71877f}.pos-profit{color:#16805c}.pos-save{width:100%;margin-top:6px}.modal{position:fixed;inset:0;background:#112b2388;display:grid;place-items:center;padding:18px;z-index:50}.hidden{display:none}.modal-card{position:relative;background:#fff;width:min(680px,100%);border-radius:14px;padding:24px;max-height:90vh;overflow:auto}.modal-card h2{font-size:19px;margin-bottom:18px}.close{position:absolute;left:15px;top:10px;border:0;background:none;font-size:25px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.form-grid label{display:grid;gap:5px;font-size:12px;color:#50665e}.form-grid input,.form-grid select{border:1px solid #d8e2de;border-radius:7px;padding:9px;font:inherit}.form-submit{margin-top:20px;width:100%}.field-hint{display:block;color:#7b9088;font-size:9px;margin-top:2px}.checkout-lines{border:1px solid #e4ece8;border-radius:9px;padding:10px;margin-bottom:14px}.checkout-lines div{display:flex;justify-content:space-between;padding:8px;border-bottom:1px solid #edf1ef;font-size:12px}.checkout-form{display:grid;gap:12px}.checkout-form label{display:grid;gap:6px;font-size:12px}.checkout-total{background:#f4f8f6;padding:13px;border-radius:9px;display:grid;gap:6px}.checkout-total strong{font-size:19px}.checkout-total small{color:#71877f}.login{position:fixed;inset:0;background:#f5f8f6;display:grid;place-items:center;z-index:100}.login-card{width:min(430px,92%);background:#fff;border:1px solid #e4ece8;border-radius:16px;padding:28px;display:grid;gap:12px;box-shadow:0 10px 35px #173f3514}.login-card .brand{padding:0}.login-card h2{font-size:21px}.login-card p{color:#789087;font-size:12px}.login-card label{display:grid;gap:5px;font-size:12px}.login-card input{border:1px solid #d8e2de;border-radius:8px;padding:10px}.hide{display:none!important}.sync-status{font-size:10px;padding:6px 9px;border-radius:20px;background:#fff0db;color:#a36a17;white-space:nowrap}.sync-status.ok{background:#e0f3e9;color:#137954}.sync-btn{padding:7px 11px}@media(max-width:1050px){.home-grid{grid-template-columns:repeat(3,1fr)}.pos-layout{grid-template-columns:1fr 360px}.pos-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:850px){.sidebar{transform:translateX(100%);transition:.2s}.sidebar.open{transform:translateX(0)}main{margin:0;padding:0 17px 25px}.menu{display:block}.home-grid,.simple-grid,.settings-grid{grid-template-columns:repeat(2,1fr)}.pos-layout{grid-template-columns:1fr}.pos-cart{min-height:450px}.products-bar{flex-wrap:wrap;position:static}.bar-sync{margin-right:0}.product-actions{flex-wrap:wrap}}@media(max-width:550px){.home-grid,.simple-grid,.settings-grid,.report-cards{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.pos-grid{grid-template-columns:repeat(2,1fr)}.pos-top{flex-direction:column;align-items:stretch}.pos-search{min-width:0}.last-sync{display:none}}
.variant-title{margin:18px 0 8px;font-weight:700;font-size:13px;color:#40564e}.variant-row{display:grid;grid-template-columns:1.5fr 1.2fr .8fr 1fr 1fr;gap:7px;margin:7px 0}.variant-row input{border:1px solid #d8e2de;border-radius:7px;padding:8px;font:inherit}.variant-add{margin-top:6px}
.brand-logo{width:190px;height:64px;object-fit:contain;display:block}.login-logo{width:230px;height:90px;margin:auto}.branch-switch{display:grid;gap:5px;margin-top:6px}.branch-switch select{background:#214b40;color:#fff;border:1px solid #3d685d;border-radius:7px;padding:7px}.inventory-cards{grid-template-columns:repeat(4,1fr)}.inventory-tools{margin-bottom:12px}.account-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:18px}.account-card{background:#fff;border:1px solid #e4ece8;border-radius:13px;padding:20px;text-align:right;cursor:pointer;display:grid;gap:7px}.account-card:hover{border-color:#1a805d;transform:translateY(-2px)}.account-card b{font-size:28px}.account-card span{font-size:11px;color:#789087}.account-detail{min-height:200px}.account-filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:15px 0}.account-filters label{display:grid;gap:5px;font-size:11px}.account-filters input{border:1px solid #d8e2de;border-radius:7px;padding:8px}.account-person{display:flex;align-items:center;gap:15px;border-bottom:1px solid #edf1ef;padding:12px 5px}.account-person strong{margin-left:auto}.account-person span,.account-person b{font-size:12px}.perm-title{font-size:14px;margin:18px 0 9px}.permissions-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px;background:#f7faf8;border-radius:9px}.permissions-grid label,.party-choice label{font-size:11px}.user-active{display:block;margin-top:12px;font-size:11px}.branch-panel{margin-bottom:17px}.branch-list{display:flex;gap:8px;flex-wrap:wrap}.branch-item{border:1px solid #dfe9e5;padding:8px 12px;border-radius:8px;display:flex;gap:8px}.branch-item span{font-size:10px;color:#16805c}.barcode-inline{display:flex;align-items:center;gap:3px}.inline-barcode{width:120px;border:1px solid #dce6e1;border-radius:6px;padding:6px}.category-products-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.category-product{border:1px solid #e1eae6;border-radius:8px;padding:10px;display:grid;grid-template-columns:auto 1fr;gap:6px;align-items:center}.category-product small{grid-column:2;color:#81938d;font-size:9px}.party-choice{display:flex;gap:15px;padding:8px 0;align-items:center}.pos-search{padding-right:0}.add-purchase-product{margin-top:7px;width:100%}.pos-search{display:flex;flex-direction:column}.invoice-history{margin-top:18px}.history-filters{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.history-filters input{border:1px solid #d8e2de;border-radius:7px;padding:7px}.barcode-preview{text-align:center}.barcode-bars{height:80px;display:flex;justify-content:center;align-items:stretch;margin:18px auto 7px}.barcode-bars i{background:#111;display:block;margin:0 1px;height:100%}.barcode-number{font:16px monospace}.barcode-price{font-weight:800;font-size:18px;margin:8px}.account-detail table{margin-top:12px}@media(max-width:1050px){.account-grid{grid-template-columns:repeat(2,1fr)}.category-products-grid{grid-template-columns:repeat(3,1fr)}.inventory-cards{grid-template-columns:repeat(2,1fr)}.permissions-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:550px){.account-grid,.inventory-cards,.category-products-grid{grid-template-columns:1fr}.permissions-grid{grid-template-columns:1fr}.brand-logo{width:160px}}
.settings-logo{width:220px;max-height:90px;object-fit:contain}.invoice-detail-head{display:flex;gap:15px;flex-wrap:wrap;padding:10px;background:#f6faf8;border-radius:8px;margin-bottom:12px}.invoice-total-box{margin-top:12px;padding:13px;background:#f4f8f6;border-radius:8px;font-size:14px}.invoice-total-box strong{font-size:19px}
/* Final UI polish */
body,button,input,select,textarea{font-family:"Cairo","Segoe UI",Tahoma,Arial,sans-serif}
.sidebar-tool{width:100%;margin-top:7px;padding:8px 10px;border:1px solid #3c655a;background:#214b40;color:#fff;border-radius:7px;cursor:pointer;text-align:right;font:inherit;font-size:11px}.sidebar-tool:hover{background:#2b5b4e}.shift-btn{border-color:#8b6b12;background:#5a4820}
#products table{table-layout:fixed}#products th:nth-child(1),#products td:nth-child(1){width:7%}#products th:nth-child(2),#products td:nth-child(2){width:11%}#products th:nth-child(3),#products td:nth-child(3){width:23%}#products th:nth-child(4),#products td:nth-child(4){width:10%}#products th:nth-child(5),#products td:nth-child(5){width:9%}#products th:nth-child(6),#products td:nth-child(6),#products th:nth-child(7),#products td:nth-child(7){width:9%}#products th:nth-child(8),#products td:nth-child(8){width:8%}#products th:nth-child(9),#products td:nth-child(9){width:9%}#products th:nth-child(10),#products td:nth-child(10){width:7%}#products th:nth-child(11),#products td:nth-child(11){width:14%}
 .variant-box{margin-top:18px;border:1px solid #e2ebe7;border-radius:12px;background:#fbfdfc;overflow:hidden}.variant-head{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px 16px;background:#f3f8f5;border-bottom:1px solid #e2ebe7}.variant-head h3{font-size:15px;margin:0 0 4px;color:#20352e}.variant-head p{font-size:10px;color:#71877f;margin:0}.variant-add{margin:0;white-space:nowrap}.variant-table{overflow-x:auto}.variant-labels,.variant-row{display:grid;grid-template-columns:minmax(180px,1.7fr) minmax(145px,1.25fr) minmax(90px,.7fr) minmax(115px,1fr) minmax(115px,1fr) 36px;gap:8px;align-items:center;min-width:760px}.variant-labels{padding:10px 12px;background:#edf5f1;color:#627971;font-size:10px;font-weight:700}.variant-row{padding:9px 12px;border-top:1px solid #e8efec;background:#fff}.variant-cell{display:grid;gap:4px}.variant-cell label{display:none;font-size:9px;color:#82958e}.variant-row input{width:100%;min-width:0;border:1px solid #d7e3de;border-radius:7px;padding:9px 10px;background:#fff;font:inherit;font-size:12px}.variant-row input:focus{outline:2px solid #cfe8dd;border-color:#1a805d}.variant-remove{width:30px;height:30px;border:1px solid #ead5d5;background:#fff6f6;color:#c0392b;border-radius:7px;cursor:pointer;font-size:18px;line-height:1}.sync-check{display:flex!important;align-items:center;gap:7px;margin-top:13px!important;font-size:11px!important}.sync-check input{width:auto!important}.form-submit{margin-top:15px}.modal-card{width:min(760px,100%)}
.pos-cart-items{overflow:auto}.cart-table{width:100%;border-collapse:collapse;min-width:620px}.cart-table th,.cart-table td{border-bottom:1px solid #e8efec;padding:7px 6px;text-align:right;font-size:11px;vertical-align:middle}.cart-table th{background:#f5f9f7;color:#587067;position:sticky;top:0;z-index:1}.cart-table input{width:82px;border:1px solid #d5e1dc;border-radius:6px;padding:6px;font:inherit}.cart-table .cart-name{min-width:180px}.cart-table .cart-total{font-weight:800;white-space:nowrap}.cart-row-actions{display:flex;align-items:center;gap:3px}.cart-row-actions button{width:25px;height:25px;border:1px solid #d6e4de;background:#fff;border-radius:6px;cursor:pointer}.pos-cart{min-width:0}.pos-catalog{min-width:0}.quick-history{margin-top:18px}.history-actions{display:flex;gap:5px;align-items:center}
.detail-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.clickable-row{cursor:pointer}.clickable-row:hover{background:#f6faf8}
.transfer-grid,.shift-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.transfer-products{max-height:420px;overflow:auto;border:1px solid #e5ece8;border-radius:9px;margin-top:12px}.transfer-line{display:grid;grid-template-columns:auto 1fr 100px 100px;gap:8px;align-items:center;padding:8px;border-bottom:1px solid #edf1ef;font-size:11px}.transfer-line input{border:1px solid #d8e2de;border-radius:6px;padding:6px}.shift-box{background:#f5f9f7;border-radius:10px;padding:14px;display:grid;gap:8px}.shift-box strong{font-size:21px}.shift-open{color:#16805c}.shift-diff{font-size:18px;font-weight:800}.user-switch-list{display:grid;gap:8px}.user-switch-item{display:flex;justify-content:space-between;align-items:center;border:1px solid #dfe9e5;border-radius:9px;padding:10px}.user-switch-item small{display:block;color:#789087;margin-top:2px}
@media(max-width:700px){.transfer-grid,.shift-grid{grid-template-columns:1fr}.transfer-line{grid-template-columns:auto 1fr 85px}.transfer-line .transfer-available{display:none}}

/* Desktop readability / 90% visual density: keep text readable while fitting the full product grid at normal browser zoom. */
@media(min-width:851px){
  .sidebar{width:235px;padding:20px 12px}
  main{margin-right:235px;padding-left:24px;padding-right:24px}
  header{height:82px}
  .products-bar{padding:9px 12px}
  .panel{padding:14px}
  .product-tools{gap:9px}
  .product-tools>input{min-width:280px}
  .page-size select{min-width:62px}
}

/* Product table: fixed, readable columns instead of letting long codes squeeze the name. */
#products .table-wrap{width:100%;overflow-x:auto}
#products table{table-layout:fixed;min-width:0}
#products th,#products td{vertical-align:middle}
#products th:nth-child(1),#products td:nth-child(1){width:9%}
#products th:nth-child(2),#products td:nth-child(2){width:11%}
#products th:nth-child(3),#products td:nth-child(3){width:24%}
#products th:nth-child(4),#products td:nth-child(4){width:9%}
#products th:nth-child(5),#products td:nth-child(5){width:8%}
#products th:nth-child(6),#products td:nth-child(6){width:8%}
#products th:nth-child(7),#products td:nth-child(7){width:8%}
#products th:nth-child(8),#products td:nth-child(8){width:7%}
#products th:nth-child(9),#products td:nth-child(9){width:7%}
#products th:nth-child(10),#products td:nth-child(10){width:5%}
#products th:nth-child(11),#products td:nth-child(11){width:10%}
#products td:nth-child(1),#products td:nth-child(2),#products td:nth-child(4),#products td:nth-child(9){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#products td:nth-child(3){white-space:normal;overflow-wrap:anywhere;line-height:1.35}
#products td:nth-child(5),#products td:nth-child(6),#products td:nth-child(7),#products td:nth-child(8),#products td:nth-child(10),#products td:nth-child(11){white-space:nowrap}
#products .inline-price{width:100%;min-width:0}
#products .inline-barcode{max-width:100%}
#products .inline-barcode .inline-barcode{width:100%}
#products .row-actions{display:flex;justify-content:center;align-items:center;gap:3px}
#products .icon-action{margin-left:0;flex:0 0 28px}
#products .pager{min-height:50px}

/* Keep the page-size control reliable and obvious. */
#pageSize{min-width:64px;cursor:pointer;background:#fff}
#pagePager{direction:rtl}
#pagePager span{font-size:12px;color:#536860;white-space:nowrap}

/* Zain Flow final UI pass: readable at browser zoom 100%, with a compact professional header/sidebar. */
.brand{justify-content:center;padding:8px 6px 4px}.brand-text,.header-brand{font-family:"Cairo",Arial,sans-serif;font-weight:900;letter-spacing:.5px;color:#e53935}.brand-text{font-size:27px}.header-brand{font-size:28px;margin-inline:auto}.top-branch{display:flex;align-items:center;gap:7px;background:#fff;border:1px solid #dce5e1;border-radius:9px;padding:4px 8px;color:#587067;font-size:11px;white-space:nowrap}.top-branch select{border:0;outline:0;background:transparent;font:inherit;font-weight:700;color:#20352e;min-width:135px;padding:5px}.sidebar .company{margin-top:18px}.sidebar .company>.sidebar-tool{margin-top:2px}.sidebar .nav-item{display:flex;align-items:center;gap:9px;font-size:13px;padding:10px 12px;border:1px solid transparent}.sidebar .nav-item span{margin-left:0;width:25px;height:25px;display:grid;place-items:center;background:#204b40;border-radius:7px}.sidebar .nav-item:hover span,.sidebar .nav-item.active span{background:#e53935;color:#fff}.sidebar .nav-item.active{box-shadow:inset -3px 0 0 #e53935;background:#245247}.sidebar .sidebar-tool{border:1px solid #386358;background:#1d493e;color:#edf7f2;border-radius:8px;padding:9px 10px;cursor:pointer;font:inherit}.sidebar .sidebar-tool:hover{background:#28594c}.sidebar .shift-btn{border-color:#8b6a1a!important;background:#6c521b!important}.sidebar .user{padding-top:14px}.top-branch + .sync-status{margin-right:2px}
#products table{table-layout:fixed;min-width:1000px}
#products th:nth-child(1),#products td:nth-child(1){width:15%}
#products th:nth-child(2),#products td:nth-child(2){width:25%}
#products th:nth-child(3),#products td:nth-child(3){width:9%}
#products th:nth-child(4),#products td:nth-child(4){width:9%}
#products th:nth-child(5),#products td:nth-child(5){width:11%}
#products th:nth-child(6),#products td:nth-child(6){width:10%}
#products th:nth-child(7),#products td:nth-child(7){width:8%}
#products th:nth-child(8),#products td:nth-child(8){width:8%}
#products th:nth-child(9),#products td:nth-child(9){width:15%}
#products .product-name-cell{white-space:normal;overflow-wrap:anywhere;line-height:1.35;font-size:13px}
#products .barcode-inline{display:flex;align-items:center;gap:4px}.barcode-inline .inline-barcode{width:calc(100% - 33px);min-width:0}.barcode-inline .icon-action{flex:0 0 29px}
#products .row-actions{display:flex;justify-content:center;align-items:center;gap:4px;flex-wrap:nowrap}.pager-page.active{background:#1a805d!important;color:#fff;border-color:#1a805d!important;font-weight:800}.pager button:disabled{opacity:.45;cursor:not-allowed}
.cart-table{min-width:720px}.cart-table th,.cart-table td{font-size:12px;padding:9px 7px}.cart-table .cart-name{min-width:230px;font-size:13px}.cart-table input{font-size:12px}.pos-cart-items{max-height:460px}
@media(min-width:851px){header{height:82px}.header-brand{position:absolute;left:50%;transform:translateX(-50%)}.head-actions{margin-right:auto}.top-branch select{min-width:145px}.sidebar{width:245px}main{margin-right:245px}}

/* FINAL: Products page compact layout (~70% visual density) while keeping readable text and actions visible. */
#products .products-panel{padding:10px}
#products .product-tools{gap:8px;margin-bottom:7px}
#products .product-tools>input{padding:8px 10px;font-size:12px}
#products .page-size{font-size:11px}
#products .page-size select{padding:6px 8px}
#products .table-wrap{overflow-x:auto;width:100%}
#products table{table-layout:fixed;width:100%;min-width:1050px}
#products th{font-size:10px;padding:7px 5px}
#products td{font-size:11px;padding:5px 5px}
#products th:nth-child(1),#products td:nth-child(1){width:14%}
#products th:nth-child(2),#products td:nth-child(2){width:24%}
#products th:nth-child(3),#products td:nth-child(3){width:9%}
#products th:nth-child(4),#products td:nth-child(4){width:9%}
#products th:nth-child(5),#products td:nth-child(5){width:11%}
#products th:nth-child(6),#products td:nth-child(6){width:9%}
#products th:nth-child(7),#products td:nth-child(7){width:8%}
#products th:nth-child(8),#products td:nth-child(8){width:8%}
#products th:nth-child(9),#products td:nth-child(9){width:8%}
#products .product-name-cell{font-size:12px;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
#products .barcode-inline{gap:3px}
#products .barcode-inline .inline-barcode{width:calc(100% - 29px);height:28px;padding:4px 6px;font-size:10px}
#products .barcode-inline .icon-action{width:25px;height:25px;flex-basis:25px;font-size:13px}
#products .inline-price{height:28px;padding:4px 5px;font-size:10px}
#products .stock-pill{padding:3px 6px;font-size:10px}
#products .profit-percent{font-size:10px}
#products .profit-percent small{font-size:9px}
#products .row-actions{gap:2px}
#products .row-actions .icon-action{width:25px;height:25px;flex:0 0 25px;margin:0;padding:0;font-size:13px}
#products .pager{padding:9px;gap:6px;min-height:42px}
#products .pager button{padding:5px 9px;font-size:10px}
#products .pager-page{min-width:28px}
/* V5.1 — final compact products density + guaranteed visible action buttons */
#products .table-wrap{overflow-x:auto}
#products table{table-layout:fixed;width:100%;min-width:1050px}
#products th,#products td{vertical-align:middle}
#products th:nth-child(1),#products td:nth-child(1){width:12%}
#products th:nth-child(2),#products td:nth-child(2){width:22%}
#products th:nth-child(3),#products td:nth-child(3){width:9%}
#products th:nth-child(4),#products td:nth-child(4){width:9%}
#products th:nth-child(5),#products td:nth-child(5){width:11%}
#products th:nth-child(6),#products td:nth-child(6){width:9%}
#products th:nth-child(7),#products td:nth-child(7){width:8%}
#products th:nth-child(8),#products td:nth-child(8){width:7%}
#products th:nth-child(9),#products td:nth-child(9){width:13%}
#products .row-actions{display:flex!important;align-items:center;justify-content:center;gap:3px;white-space:nowrap;overflow:visible;min-width:128px}
#products .row-actions .icon-action{display:inline-flex!important;align-items:center;justify-content:center;width:25px!important;height:25px!important;min-width:25px!important;flex:0 0 25px!important;margin:0!important;padding:0!important;border:1px solid #cbdcd5!important;background:#fff!important;border-radius:6px!important;cursor:pointer!important;font-size:13px!important;line-height:1!important;visibility:visible!important;opacity:1!important}
#products .row-actions .icon-action:hover{transform:translateY(-1px);box-shadow:0 2px 6px rgba(23,63,53,.12)}
#products .row-actions .icon-action.danger{color:#c0392b!important}
#products .product-name-cell{font-size:12px!important;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
#products .inline-price{width:100%;max-width:86px;height:28px;padding:4px 5px;font-size:10px}
#products .inline-barcode{width:calc(100% - 29px);height:28px;padding:4px 6px;font-size:10px}
#products .barcode-inline{display:flex;align-items:center;gap:3px;min-width:0}
#products .barcode-inline .icon-action{width:25px!important;min-width:25px!important}
#products th{font-size:10px;padding:7px 5px}
#products td{font-size:11px;padding:5px}
#products .stock-pill{font-size:10px;padding:3px 6px}
#products .profit-percent{font-size:10px}

/* Mobile/PWA polish */
html,body{max-width:100%;overflow-x:hidden}
@media(max-width:850px){header{height:68px;gap:8px;position:sticky;top:0;background:#f5f8f6;z-index:8}.header-brand{font-size:15px;font-weight:900}.head-actions{gap:5px}.head-actions .top-branch span,.head-actions .last-sync{display:none}.top-branch select{max-width:92px;padding:7px 5px!important}.sync-btn{padding:7px 8px;font-size:11px}.page{padding-top:14px}.products-bar{padding:9px 10px}.product-tools{flex-wrap:wrap}.product-tools>input{min-width:0;width:100%;flex-basis:100%}.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.products-table{min-width:920px}.row-actions{min-width:175px}.icon-action{width:30px;height:30px;margin-left:2px}.pos-catalog,.pos-cart{padding:10px}.pos-grid{max-height:none}.pos-cart{min-height:420px}.menu{font-size:24px;padding:4px}.sidebar{width:min(285px,88vw)}}
@media(max-width:550px){main{padding:0 9px 18px}.home-card{min-height:115px}.home-card b{font-size:30px}.home-card strong{font-size:13px}.page-top h2,.products-bar h2{font-size:16px}.panel{padding:11px}.pos-product{padding:9px;min-height:78px}.pos-product strong{font-size:11px}.pos-search{min-width:0}.form-grid{gap:10px}.modal{padding:8px}.modal-card{padding:18px 13px;border-radius:12px}.install-hide{display:none!important}}
