/*
 * Hesaby Qt source visual parity — second layout batch (2026-11-18)
 * Reference (the attached offline RAR):
 *   ERPSYSTEM/modules/customers/views/customer_management_window.py
 *   ERPSYSTEM/modules/suppliers/views/suppliers_window.py
 *   ERPSYSTEM/modules/warehouses/views/warehouses_window.py
 *   ERPSYSTEM/modules/inventory/views/stock_window_main.py
 * Preserves all cloud-only actions, permission gates, data and business logic.
 * Scopes changes to logged-in Qt portal. Does not target Master Owner.
 */

/* Source customers/suppliers top bars: 62px, title to the right,
   physical LTR order of command buttons on the left. */
@media (min-width: 1151px) {
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-module-header{
  box-sizing:border-box;min-height:62px;height:62px;flex:0 0 62px;
  direction:ltr;flex-wrap:nowrap;align-items:center;gap:7px;
  padding:7px 12px 7px 10px;
  border:1px solid #d9e3ef;border-radius:8px;background:#fff
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-command-row{
  direction:ltr;gap:7px;flex-wrap:nowrap;overflow-x:auto;min-width:0;
  scrollbar-width:thin;align-items:center
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-module-heading{
  direction:rtl;min-width:300px;align-items:stretch;text-align:right;
  gap:0;flex:0 0 300px
 }
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-module-heading strong{
 font-size:18px;font-weight:900;color:#173e70;
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-module-heading small{
 font-size:10px;font-weight:600;color:#72839a;
}

/* Customer toolbar: original Qt precise widths:
   refresh 95; Excel 115; reports 100; statistics 105; messages 125. */
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action{
 box-sizing:border-box;height:38px;min-height:38px;flex:0 0 auto;
 padding:6px 11px;font-size:12px;border-radius:5px;
}
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action:nth-of-type(1){width:95px;min-width:95px}
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action:nth-of-type(2){width:115px;min-width:115px}
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action:nth-of-type(3){width:100px;min-width:100px}
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action:nth-of-type(4){width:105px;min-width:105px}
body.qt-desktop-mode .qt-native-customers .qt-native-command-row>.qt-native-action:nth-of-type(5){width:125px;min-width:125px}

/* Native compact 4-card customer/supplier summary, 76px not a big dashboard. */
@media (min-width: 1250px) {
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-summary{
  box-sizing:border-box;display:flex;direction:rtl;flex-wrap:nowrap;
  min-height:76px;height:76px;max-height:76px;gap:8px
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-summary-card{
  box-sizing:border-box;min-width:0;flex:1 1 0;height:76px;min-height:76px;
  border:1px solid #d9e3ef;border-radius:8px;padding:8px 12px 7px;gap:1px
 }
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-summary-card span{
 font-size:10px;font-weight:800;direction:rtl;text-align:right;
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-summary-card strong{
 font-size:18px;font-weight:900;direction:ltr;text-align:right;
}

/* Qt 68px filter strip. On narrower displays scroll the native row instead
   of silently reordering its controls or hiding cloud-only functionality. */
@media (min-width: 1151px) {
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters{
  box-sizing:border-box;min-height:68px;height:68px;max-height:68px;
  flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;
  direction:rtl;align-items:center;gap:7px;padding:8px 10px;
  border:1px solid #d9e3ef;border-radius:8px;background:#fff;
  scrollbar-width:thin
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters input[aria-label="بحث"]{
  box-sizing:border-box;min-width:330px;width:400px;max-width:470px;
  flex:2 0 330px;height:36px;min-height:36px;
 }
 body.qt-desktop-mode .qt-native-suppliers .qt-native-filters input[aria-label="بحث"]{
  min-width:360px;max-width:520px;flex-basis:360px
 }
 body.qt-desktop-mode .qt-native-customers .qt-native-filters select[aria-label="الحالة"],
 body.qt-desktop-mode .qt-native-customers .qt-native-filters select[aria-label="النوع"]{
  box-sizing:border-box;min-width:120px;width:120px;max-width:120px;flex:0 0 120px;
  height:36px;min-height:36px
 }
 body.qt-desktop-mode .qt-native-customers .qt-native-filters select[aria-label="تصنيفات العملاء"]{
  box-sizing:border-box;min-width:145px;width:145px;max-width:145px;
  flex:0 0 145px;height:36px;min-height:36px
 }
 body.qt-desktop-mode .qt-native-suppliers .qt-native-filters select[aria-label="الحالة"]{
  box-sizing:border-box;min-width:135px;width:135px;max-width:135px;
  flex:0 0 135px;height:36px;min-height:36px
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters>.qt-native-action{
  box-sizing:border-box;flex:0 0 auto;min-height:36px!important;height:36px!important;
  padding:6px 11px
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters>.qt-native-action:nth-of-type(1){
  width:100px;min-width:100px
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters>.qt-native-action:nth-of-type(2){
  width:95px;min-width:95px
 }
 body.qt-desktop-mode .qt-native-customers .qt-native-filters>.qt-native-action:nth-of-type(3){
  order:9;min-width:150px;background:#4a647f;border-color:#4a647f;
 }
 body.qt-desktop-mode .qt-native-customers .qt-native-filters>.qt-native-action:nth-of-type(4),
 body.qt-desktop-mode .qt-native-suppliers .qt-native-filters>.qt-native-action:last-of-type{
  width:120px;min-width:120px
 }
}

/* Offline customer's 10-column QTableWidget and supplier's 8-column list.
   Keep the standard Qt header (39px), body rows (40px), sticky header and
   the fixed edge columns; name/notes/email remain stretchable. */
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table-scroll{
 min-width:0;overflow:auto;background:#fff;
 border:1px solid #c8d5e4;border-radius:6px
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table{
 table-layout:fixed;min-width:100%;border-collapse:collapse;
 background:#fff;color:#173e70
}
body.qt-desktop-mode .qt-native-customers .qt-native-table{min-width:1220px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table{min-width:1050px}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table thead th{
 box-sizing:border-box;height:39px;min-height:39px;padding:7px 5px;
 background:#244875;color:#fff;border:0;border-inline-start:1px solid #3d5f89;
 font-weight:800;white-space:nowrap
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table tbody td{
 box-sizing:border-box;height:40px;padding:8px 6px;
 border:1px solid #dde5ef;color:#173e70;vertical-align:middle
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table tbody tr:nth-child(even){
 background:#f8fafd
}
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table tbody tr.selected,
body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-table tbody tr.selected td{
 background:#e5f1ff;color:#173e70
}
/* Original customer fixed widths: ID70, phone130, category105, type82,
   opening120, date110, status90, actions124. */
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(1){width:70px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(3){width:130px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(4){width:105px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(5){width:82px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(6){width:120px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(7){width:110px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(8){width:90px}
body.qt-desktop-mode .qt-native-customers .qt-native-table :is(th,td):nth-child(10){width:124px}
/* Original supplier fixed widths: ID70, phone130, city120, balance125,
   status90, actions124. */
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(1){width:70px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(4){width:130px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(5){width:120px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(6){width:125px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(7){width:90px}
body.qt-desktop-mode .qt-native-suppliers .qt-native-table :is(th,td):nth-child(8){width:124px}

/* Source pagination QFrame is 52px, left page-size select 72x34,
   center range label, right navigation. */
@media (min-width: 1151px) {
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-pagination{
  box-sizing:border-box;direction:ltr;align-items:center;flex-wrap:nowrap;
  min-height:52px;height:52px;max-height:52px;
  gap:7px;padding:6px 10px;background:#fff;
  border:1px solid #d9e3ef;border-radius:8px
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-page-size{
  display:flex;direction:ltr;align-items:center;gap:7px;margin-inline-end:auto
 }
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-page-size select{
  box-sizing:border-box;width:72px;min-width:72px;max-width:72px;
  height:34px;min-height:34px
 }
}

/* Original WarehousesWindow: compact, unrounded 38px toolbar actions and
   34px row entries. Extra cloud workflow buttons remain usable. */
body.qt-desktop-mode .qt-native-warehouses .qt-native-command-row{
 direction:rtl;gap:8px;align-items:center
}
body.qt-desktop-mode .qt-native-warehouses .qt-native-command-row>.qt-native-action{
 box-sizing:border-box;min-width:96px;min-height:38px;height:38px;
 font-size:10pt;border-radius:4px;padding:6px 14px
}
body.qt-desktop-mode .qt-native-warehouses .qt-native-table tbody td{
 height:34px;box-sizing:border-box;padding:6px
}

/* Original stock table: 13 fixed columns, horizontal scroll rather than
   collapsing item names or hiding stock figures. */
body.qt-desktop-mode .qt-native-products .qt-native-stock-table{
 width:max-content;min-width:100%;table-layout:fixed
}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(1){width:42px;min-width:42px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(2){width:48px;min-width:48px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(3){width:360px;min-width:360px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(4){width:170px;min-width:170px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(5){width:120px;min-width:120px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(6){width:82px;min-width:82px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(7){width:112px;min-width:112px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(8){width:130px;min-width:130px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(9){width:138px;min-width:138px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(10){width:165px;min-width:165px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(11){width:118px;min-width:118px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(12){width:96px;min-width:96px}
body.qt-desktop-mode .qt-native-products .qt-native-stock-table :is(th,td):nth-child(13){width:96px;min-width:96px}

/* On laptop/mobile viewports keep controls reachable, no forced desktop height. */
@media (max-width:1150px){
 body.qt-desktop-mode :is(.qt-native-customers,.qt-native-suppliers) .qt-native-filters{
  height:auto;max-height:none;overflow:visible
 }
}
