
:root{
  --bg:#f5f7fb; --panel:#fff; --line:#dce5f0; --text:#0f172a; --muted:#64748b;
  --nav:#0f172a; --blue:#2563eb; --green:#15803d; --red:#dc2626; --amber:#d97706;
  --shadow:0 12px 28px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,Segoe UI,Arial,sans-serif}
button,input,select,textarea{font:inherit}
button{border:0;border-radius:10px;padding:10px 14px;background:#edf2f7;cursor:pointer}
button.primary{background:var(--blue);color:white}
button.success{background:var(--green);color:white}
button.danger{background:var(--red);color:white}
button.ghost{background:white;border:1px solid var(--line)}
button.small{padding:7px 10px;font-size:13px}
input,select,textarea{border:1px solid var(--line);border-radius:10px;background:#fff;padding:10px 12px;width:100%}
textarea{min-height:110px}
label{font-size:12px;color:var(--muted);font-weight:700;display:block;margin-bottom:5px}
.hidden{display:none!important}.muted{color:var(--muted)}.right{text-align:right}

.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(135deg,#eff6ff,#f8fafc)}
.login-card{width:min(430px,96vw);background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:26px}
.brand{display:flex;align-items:center;gap:12px}.logo{width:46px;height:46px;border-radius:14px;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900}
.brand strong{display:block;font-size:20px}.brand span{display:block;font-size:12px;color:var(--muted)}
.login-note{margin-top:14px;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:12px;font-size:13px;color:var(--muted)}
.alert{padding:11px 12px;border-radius:12px;margin:12px 0;font-size:14px}
.alert.error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.alert.info{background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af}

.app{display:grid;grid-template-columns:220px 1fr;min-height:100vh}
.sidebar{background:var(--nav);color:#fff;padding:16px;display:flex;flex-direction:column;gap:16px}
.sidebar .brand{padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.09)}
.sidebar .brand span{color:#cbd5e1}
.userbox{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.09);border-radius:14px;padding:12px}
.userbox b{display:block}.userbox span{font-size:12px;color:#cbd5e1}
.nav{display:grid;gap:5px}
.nav button{background:transparent;color:#dbe4ee;text-align:left;border-radius:10px}
.nav button.active,.nav button:hover{background:rgba(255,255,255,.12);color:#fff}
.side-actions{margin-top:auto;display:grid;gap:8px}.side-actions button{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.1)}
.main{min-width:0}.topbar{height:66px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px}
.topbar h1{margin:0;font-size:24px}.topbar p{margin:2px 0 0;color:var(--muted)}
.badge{display:inline-block;padding:6px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:12px;font-weight:700}.badge.green{background:#dcfce7;color:#166534}.badge.orange{background:#fff7ed;color:#9a3412}
.content{padding:18px;display:grid;gap:14px}
.card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 4px 14px rgba(15,23,42,.04);padding:16px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.toolbar{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 20px rgba(15,23,42,.05);padding:12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.toolbar input{flex:1;min-width:260px}
.sales-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}
.sales-main{display:grid;gap:12px;min-width:0}
.channel-toggle{display:flex;background:#eef2f7;border-radius:12px;padding:4px;gap:4px}.channel-toggle button{background:transparent}.channel-toggle button.active{background:var(--blue);color:#fff}
.channel-note{font-size:13px;color:var(--muted);padding-left:4px;margin-top:-4px}
.filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.table-wrap{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:auto;max-width:100%}
table{border-collapse:separate;border-spacing:0;width:100%}
.stock-table{width:max-content;min-width:100%}
.stock-table th{background:#102a43;color:#fff;text-transform:uppercase;font-size:12px;letter-spacing:.035em;text-align:left;padding:12px 14px;white-space:nowrap;border-right:1px solid rgba(255,255,255,.12)}
.stock-table td{padding:12px 14px;border-bottom:1px solid #edf2f7;border-right:1px solid #edf2f7;background:#fff;white-space:nowrap;vertical-align:middle;font-size:13px}
.stock-table tr:nth-child(even) td{background:#f8fafc}.stock-table tr:hover td{background:#eef6ff}
.stock-table input.qty{width:74px;padding:8px 10px}
.color-dot{width:12px;height:12px;border-radius:999px;display:inline-block;margin-right:7px;border:1px solid #64748b;vertical-align:-1px}
.row-actions{display:flex;gap:6px}
.cart{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);min-height:calc(100vh - 115px);display:flex;flex-direction:column;overflow:hidden}
.cart-head,.cart-foot{padding:14px;border-bottom:1px solid var(--line)}.cart-foot{border-top:1px solid var(--line);border-bottom:0;margin-top:auto;background:#fbfdff}
.cart-body{padding:14px;display:grid;gap:10px;overflow:auto;flex:1}
.empty{padding:34px 16px;text-align:center;color:var(--muted)}
.cart-item{border:1px solid #e7eef7;border-radius:12px;padding:12px;background:#fbfdff}.cart-item-top{display:flex;justify-content:space-between;gap:8px}.cart-item b{font-size:14px}
.total-line{display:flex;justify-content:space-between;margin:7px 0}.total-line strong{font-size:18px}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.58);z-index:100;display:flex;align-items:center;justify-content:center;padding:18px}
.modal{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);width:min(920px,96vw);max-height:94vh;overflow:auto}
.modal.small{width:min(560px,96vw)}.modal-head,.modal-foot{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.modal-foot{border-top:1px solid var(--line);border-bottom:0;justify-content:flex-end;gap:10px}.modal-body{padding:18px}.modal h3{margin:0}
.check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.check-row,.imei-row{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px;background:#f8fafc}.check-row input,.imei-row input{width:auto}.imei-list{display:grid;gap:8px;max-height:360px;overflow:auto}.counter{display:inline-flex;gap:4px;background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;border-radius:999px;padding:8px 12px;margin-bottom:10px}
.invoice{width:210mm;min-height:297mm;background:#fff;margin:0 auto;padding:18mm;color:#111827}.invoice-preview{width:100%;min-height:auto;padding:18px;border:1px solid var(--line);border-radius:14px}
.invoice-header{display:flex;justify-content:space-between;border-bottom:2px solid #111827;padding-bottom:16px}.invoice-brand{display:flex;gap:12px;align-items:center}.invoice-logo{width:56px;height:56px;border-radius:12px;background:#1d4ed8;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900}.invoice h1,.invoice h2{margin:0}.invoice-muted{font-size:12px;color:#64748b}.invoice-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:22px 0}.invoice table{width:100%;border-collapse:collapse}.invoice th{background:#0f172a;color:#fff;padding:9px;text-align:left;font-size:12px}.invoice td{border-bottom:1px solid #e5e7eb;padding:9px;font-size:13px}.invoice-bottom{display:grid;grid-template-columns:1fr 260px;gap:22px;margin-top:20px}.invoice-totals{border:1px solid #e5e7eb;border-radius:12px;padding:10px}.invoice-totals div{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid #eef2f7}.invoice-totals .grand{font-weight:900;font-size:18px;border-top:2px solid #111827;margin-top:4px}.signatures{display:grid;grid-template-columns:1fr 1fr;gap:70px;text-align:center;margin-top:70px}.sig{height:1px;background:#111827;margin-bottom:8px}
@media print{ @page{size:A4;margin:0} body{background:#fff}.invoice{box-shadow:none;margin:0;border:0} }
@media(max-width:1200px){.sales-layout{grid-template-columns:1fr}.cart{min-height:auto}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.app{grid-template-columns:1fr}.form-grid,.form-grid.three,.filters,.check-grid{grid-template-columns:1fr}.topbar{height:auto;padding:12px;align-items:flex-start;flex-direction:column}}

.customer-row{display:flex;gap:8px;align-items:center}
.customer-row select{flex:1}
.customer-row button{white-space:nowrap}


/* V19 fixed-height layout: page does not scroll; only stock list scrolls */
html, body{
  height:100%;
  overflow:hidden;
}
#app,.app{
  height:100vh;
  min-height:100vh;
}
.main{
  height:100vh;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.content{
  flex:1;
  min-height:0;
  overflow:hidden;
}
.sales-layout{
  height:100%;
  min-height:0;
}
.sales-main{
  min-height:0;
  grid-template-rows:auto auto auto minmax(0,1fr);
}
.sales-main .table-wrap{
  min-height:0;
  height:100%;
  overflow:auto;
}
.cart{
  height:100%;
  min-height:0;
}
.cart-body{
  min-height:0;
}
@media(max-width:1200px){
  html,body{overflow:auto}
  .main,.content,#app,.app{height:auto;min-height:100vh}
  .sales-layout{height:auto}
  .sales-main .table-wrap{height:auto;max-height:60vh}
}


/* V20 hard fix: lock the app screen; scroll only the phone stock list */
html,
body{
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden !important;
}

#app{
  width:100%;
  height:100%;
  overflow:hidden !important;
}

.app{
  width:100%;
  height:100vh !important;
  min-height:100vh !important;
  overflow:hidden !important;
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
}

.sidebar{
  height:100vh;
  overflow:hidden;
}

.main{
  width:100%;
  min-width:0;
  height:100vh !important;
  overflow:hidden !important;
  display:flex;
  flex-direction:column;
}

.topbar{
  flex:0 0 66px;
}

.content{
  flex:1 1 auto;
  min-height:0;
  height:auto !important;
  overflow:hidden !important;
  padding:18px;
}

.sales-layout{
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden !important;
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:16px;
}

.sales-main{
  width:100%;
  min-width:0;
  height:100%;
  min-height:0;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column;
  gap:12px;
}

.sales-main > .toolbar,
.sales-main > .channel-note,
.sales-main > .card{
  flex:0 0 auto;
}

.sales-main > .table-wrap{
  flex:1 1 auto;
  min-height:0;
  height:auto !important;
  max-height:none !important;
  width:100%;
  max-width:100%;
  overflow:auto !important;
  overscroll-behavior:contain;
}

.stock-table{
  width:max-content !important;
  min-width:1250px;
}

.cart{
  height:100%;
  min-height:0 !important;
  max-height:100%;
  overflow:hidden !important;
  display:flex;
  flex-direction:column;
}

.cart-head,
.cart-foot{
  flex:0 0 auto;
}

.cart-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}

/* Keep horizontal and vertical scrollbars visible inside the stock list */
.sales-main > .table-wrap::-webkit-scrollbar{
  width:12px;
  height:12px;
}
.sales-main > .table-wrap::-webkit-scrollbar-thumb{
  background:#94a3b8;
  border-radius:999px;
}
.sales-main > .table-wrap::-webkit-scrollbar-track{
  background:#e5e7eb;
}

/* On smaller screens, still keep the table scroll inside its own box */
@media(max-width:1200px){
  html,body,#app,.app,.main{
    height:100vh !important;
    overflow:hidden !important;
  }
  .sales-layout{
    grid-template-columns:1fr;
  }
  .cart{
    max-height:260px;
  }
}


/* V21 separate stock list footer */
.stock-list-box{
  display:flex !important;
  flex-direction:column;
  min-height:0;
  overflow:hidden !important;
}

.table-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto !important;
  overscroll-behavior:contain;
}

.stock-list-footer{
  flex:0 0 auto;
  min-height:38px;
  padding:9px 14px;
  border-top:1px solid #dbe5f0;
  background:#f8fafc;
  color:#475569;
  font-size:13px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}

.table-scroll::-webkit-scrollbar{
  width:12px;
  height:12px;
}
.table-scroll::-webkit-scrollbar-thumb{
  background:#94a3b8;
  border-radius:999px;
}
.table-scroll::-webkit-scrollbar-track{
  background:#e5e7eb;
}

/* Override previous table-wrap scrolling so only .table-scroll scrolls */
.sales-main > .table-wrap{
  overflow:hidden !important;
}

.sales-main > .table-wrap.stock-list-box{
  flex:1 1 auto;
  min-height:0;
}


/* V22 clickable column filters and checkout sale type */
.cell-filter{
  background:transparent;
  border:0;
  padding:0;
  margin:0;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
  border-radius:4px;
}
.cell-filter:hover{
  color:#1d4ed8;
  text-decoration:underline;
}
.checkout-channel{
  width:100%;
}
.checkout-channel button{
  flex:1;
}


/* V23 sticky stock-list headers */
.table-scroll{
  position:relative;
}

.stock-table thead th{
  position:sticky;
  top:0;
  z-index:5;
  box-shadow:0 1px 0 rgba(15,23,42,.18);
}

/* Keep header above cells during vertical scrolling */
.stock-table thead{
  position:relative;
  z-index:6;
}

/* Optional: keep first column visible during left/right scrolling */
.stock-table th:first-child,
.stock-table td:first-child{
  position:sticky;
  left:0;
  z-index:4;
}

.stock-table th:first-child{
  z-index:7;
}

.stock-table td:first-child{
  background:#fff;
}

.stock-table tr:nth-child(even) td:first-child{
  background:#f8fafc;
}

.stock-table tr:hover td:first-child{
  background:#eef6ff;
}


/* V24 cart quantity stepper */
.qty-stepper{
  display:grid;
  grid-template-columns:34px 1fr 34px;
  gap:6px;
  align-items:center;
}
.qty-stepper input{
  text-align:center;
  padding:8px 6px;
}
.qty-stepper button{
  padding:8px 0;
}
.qty-stepper button:disabled{
  opacity:.45;
  cursor:not-allowed;
}


/* V25 restored Admin Settings */
.settings-layout{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  gap:16px;
  height:100%;
  min-height:0;
}
.settings-nav{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  display:grid;
  gap:6px;
  align-self:start;
}
.settings-nav button{
  text-align:left;
  background:transparent;
}
.settings-nav button.active{
  background:#eef2ff;
  color:#1d4ed8;
  font-weight:800;
}
.settings-pane{
  min-width:0;
  overflow:auto;
}
.section-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:14px;
}
.section-head h3,.card h3{
  margin:0 0 4px;
}
.section-head p{
  margin:0;
  color:var(--muted);
}
.role-card{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  margin-top:10px;
  background:#fbfdff;
}
.role-card b{
  display:block;
  margin-bottom:8px;
}
@media(max-width:900px){
  .settings-layout{grid-template-columns:1fr}
}


/* V28 sortable headers */
.sortable-th{
  cursor:pointer;
  user-select:none;
}
.sortable-th:hover{
  background:#1d3b5a !important;
}


/* V30 compact one-row Sales filters */
.sales-main{
  gap:8px !important;
}

.sales-main > .card{
  padding:10px 12px !important;
  border-radius:14px;
}

.filters{
  display:grid !important;
  grid-template-columns:repeat(7, minmax(120px, 1fr)) !important;
  gap:8px !important;
  align-items:end;
}

.filters label{
  font-size:11px;
  margin-bottom:4px;
}

.filters select{
  padding:8px 9px !important;
  height:38px;
  border-radius:9px;
  font-size:13px;
}

.toolbar{
  padding:10px 12px !important;
  border-radius:14px;
}

.toolbar input{
  padding:9px 11px !important;
  height:40px;
}

.toolbar button{
  padding:9px 13px !important;
}

.channel-note{
  margin-top:-2px !important;
  margin-bottom:-2px !important;
  font-size:12px !important;
}

.stock-list-box{
  margin-top:0 !important;
}

/* Give the phone list more vertical space */
.sales-main > .table-wrap.stock-list-box{
  flex:1 1 auto;
}

/* Keep filters usable on smaller screens */
@media(max-width:1400px){
  .filters{
    grid-template-columns:repeat(4, minmax(150px, 1fr)) !important;
  }
}

@media(max-width:950px){
  .filters{
    grid-template-columns:repeat(2, minmax(150px, 1fr)) !important;
  }
}

@media(max-width:600px){
  .filters{
    grid-template-columns:1fr !important;
  }
}


/* V33 responsive autosize layout */

/* Desktop default: keep app fixed, but never let panels disappear */
.app{
  grid-template-columns:220px minmax(0,1fr) !important;
}

.main,
.content,
.sales-layout,
.sales-main{
  min-width:0 !important;
}

/* Cart becomes narrower when screen is not wide enough */
@media(max-width:1500px){
  .sales-layout{
    grid-template-columns:minmax(0,1fr) 330px !important;
    gap:12px !important;
  }
  .cart{
    min-width:0;
  }
}

/* Medium laptop / tablet landscape */
@media(max-width:1200px){
  html,
  body{
    overflow:auto !important;
    height:auto !important;
  }

  #app,
  .app{
    height:auto !important;
    min-height:100vh !important;
    overflow:visible !important;
  }

  .app{
    grid-template-columns:72px minmax(0,1fr) !important;
  }

  .sidebar{
    width:72px;
    height:100vh;
    position:sticky;
    top:0;
    overflow:hidden;
    padding:10px 8px;
  }

  .sidebar .brand div:not(.logo),
  .userbox,
  .side-actions button,
  .nav button{
    font-size:0;
  }

  .nav button{
    text-align:center;
    padding:12px 8px;
  }

  .nav button::first-letter{
    font-size:18px;
  }

  .side-actions{
    display:none;
  }

  .main{
    height:auto !important;
    min-height:100vh !important;
    overflow:visible !important;
  }

  .content{
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
    padding:12px;
  }

  .sales-layout{
    height:auto !important;
    grid-template-columns:1fr !important;
  }

  .sales-main{
    height:auto !important;
    overflow:visible !important;
  }

  .sales-main > .table-wrap.stock-list-box{
    height:55vh !important;
    min-height:380px !important;
  }

  .cart{
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
  }

  .cart-body{
    max-height:320px;
  }

  .toolbar{
    flex-wrap:wrap;
  }

  .toolbar input{
    min-width:240px;
  }

  .filters{
    grid-template-columns:repeat(4, minmax(130px, 1fr)) !important;
  }

  .settings-layout{
    height:auto;
  }
}

/* Tablet portrait */
@media(max-width:850px){
  .app{
    display:block !important;
  }

  .sidebar{
    position:relative;
    width:100%;
    height:auto;
    display:block;
    padding:10px;
  }

  .sidebar .brand{
    display:flex;
    justify-content:flex-start;
    padding-bottom:10px;
  }

  .sidebar .brand div:not(.logo){
    display:block;
  }

  .sidebar .brand div:not(.logo) strong,
  .sidebar .brand div:not(.logo) span{
    font-size:initial;
  }

  .nav{
    display:grid;
    grid-template-columns:repeat(5, minmax(0,1fr));
    gap:6px;
  }

  .nav button{
    font-size:12px;
    text-align:center;
    padding:10px 6px;
  }

  .topbar{
    height:auto !important;
    flex:0 0 auto;
    align-items:flex-start;
    gap:8px;
    padding:12px;
  }

  .topbar h1{
    font-size:21px;
  }

  .toolbar{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .toolbar input{
    grid-column:1/-1;
    min-width:0;
    width:100%;
  }

  .toolbar button{
    width:100%;
  }

  .filters{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }

  .sales-main > .table-wrap.stock-list-box{
    height:50vh !important;
    min-height:320px !important;
  }

  .stock-table{
    min-width:1050px !important;
  }

  .cart-body{
    max-height:260px;
  }

  .form-grid,
  .form-grid.three{
    grid-template-columns:1fr !important;
  }

  .invoice{
    width:100% !important;
    min-height:auto !important;
    padding:14px !important;
  }

  .modal{
    width:96vw !important;
  }
}

/* Phone */
@media(max-width:520px){
  body{
    font-size:14px;
  }

  .content{
    padding:8px;
  }

  .nav{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }

  .nav button{
    font-size:11px;
  }

  .topbar h1{
    font-size:19px;
  }

  .topbar p{
    font-size:12px;
  }

  .toolbar{
    grid-template-columns:1fr;
  }

  .filters{
    grid-template-columns:1fr !important;
  }

  .sales-main > .table-wrap.stock-list-box{
    height:48vh !important;
    min-height:280px !important;
  }

  .stock-list-footer{
    flex-direction:column;
    align-items:flex-start;
    gap:3px;
    font-size:12px;
  }

  .cart-foot .form-grid{
    grid-template-columns:1fr !important;
  }

  .channel-toggle{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .modal-backdrop{
    padding:8px;
    align-items:flex-start;
    overflow:auto;
  }

  .modal{
    max-height:none !important;
  }

  .invoice-header,
  .invoice-grid,
  .invoice-bottom,
  .signatures{
    grid-template-columns:1fr !important;
    display:grid !important;
    gap:14px !important;
  }

  .invoice-header{
    text-align:left;
  }

  .invoice .right{
    text-align:left;
  }
}

/* Wide screens: use more space cleanly */
@media(min-width:1800px){
  .sales-layout{
    grid-template-columns:minmax(0,1fr) 420px !important;
  }
  .filters{
    grid-template-columns:repeat(7, minmax(150px, 1fr)) !important;
  }
}


/* V34 professional responsive repair */

/* General */
html, body{
  width:100%;
  height:100%;
  margin:0;
}

#app{
  width:100%;
  height:100%;
}

/* Normal desktop and laptop: stable app frame */
.app{
  grid-template-columns:200px minmax(0,1fr) !important;
  height:100vh !important;
  min-height:100vh !important;
  overflow:hidden !important;
}

.sidebar{
  width:auto !important;
  min-width:0;
}

.main{
  min-width:0 !important;
  height:100vh !important;
  overflow:hidden !important;
}

.content{
  min-width:0 !important;
  min-height:0 !important;
  overflow:hidden !important;
}

/* Sales layout: keep cart on right on desktop/laptop */
.sales-layout{
  grid-template-columns:minmax(0,1fr) 300px !important;
  gap:12px !important;
  min-width:0 !important;
}

.cart{
  min-width:0 !important;
  width:100%;
}

/* Make filters compact and closer to the list */
.sales-main{
  gap:8px !important;
  min-width:0 !important;
}

.sales-main > .card{
  padding:10px 12px !important;
}

.filters{
  grid-template-columns:repeat(7, minmax(95px, 1fr)) !important;
  gap:8px !important;
}

.filters label{
  font-size:11px !important;
  margin-bottom:3px !important;
}

.filters select{
  height:36px !important;
  padding:7px 8px !important;
  font-size:13px !important;
}

/* Phone list should use available width. Default columns should not force horizontal scroll. */
.stock-list-box{
  min-width:0 !important;
}

.table-scroll{
  min-width:0 !important;
  overflow:auto !important;
}

/* Default sales columns fit to table width */
.stock-table.default-cols{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.stock-table.default-cols th,
.stock-table.default-cols td{
  padding:9px 10px !important;
  font-size:12.5px !important;
  white-space:normal !important;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Useful default column sizing */
.stock-table.default-cols th:nth-child(1),
.stock-table.default-cols td:nth-child(1){width:19%}
.stock-table.default-cols th:nth-child(2),
.stock-table.default-cols td:nth-child(2){width:10%}
.stock-table.default-cols th:nth-child(3),
.stock-table.default-cols td:nth-child(3){width:14%}
.stock-table.default-cols th:nth-child(4),
.stock-table.default-cols td:nth-child(4){width:8%}
.stock-table.default-cols th:nth-child(5),
.stock-table.default-cols td:nth-child(5){width:10%}
.stock-table.default-cols th:nth-child(6),
.stock-table.default-cols td:nth-child(6){width:7%}
.stock-table.default-cols th:nth-child(7),
.stock-table.default-cols td:nth-child(7){width:8%}
.stock-table.default-cols th:nth-child(8),
.stock-table.default-cols td:nth-child(8){width:8%}
.stock-table.default-cols th:nth-child(9),
.stock-table.default-cols td:nth-child(9){width:8%}
.stock-table.default-cols th:nth-child(10),
.stock-table.default-cols td:nth-child(10){width:8%}

.stock-table.default-cols input.qty{
  width:54px !important;
  padding:6px 7px !important;
}

.stock-table.default-cols .row-actions{
  gap:4px !important;
}

.stock-table.default-cols .row-actions button{
  padding:6px 7px !important;
  font-size:12px !important;
}

/* Extra columns still get horizontal scroll */
.stock-table.wide-cols{
  width:max-content !important;
  min-width:1250px !important;
}

/* Sticky first column should not create visual mess */
.stock-table.default-cols th:first-child,
.stock-table.default-cols td:first-child{
  position:static !important;
}

.stock-table.wide-cols th:first-child,
.stock-table.wide-cols td:first-child{
  position:sticky;
  left:0;
}

/* Medium laptop/tablet landscape */
@media(max-width:1250px){
  .app{
    grid-template-columns:170px minmax(0,1fr) !important;
  }

  .sales-layout{
    grid-template-columns:minmax(0,1fr) 270px !important;
  }

  .filters{
    grid-template-columns:repeat(4, minmax(120px, 1fr)) !important;
  }

  .stock-table.default-cols th,
  .stock-table.default-cols td{
    padding:8px 8px !important;
    font-size:12px !important;
  }

  .stock-table.default-cols .row-actions{
    flex-direction:column;
  }
}

/* Tablet: stack cart below only when needed, but keep everything visible */
@media(max-width:980px){
  html, body{
    height:auto !important;
    overflow:auto !important;
  }

  #app,.app{
    height:auto !important;
    min-height:100vh !important;
    overflow:visible !important;
  }

  .app{
    grid-template-columns:150px minmax(0,1fr) !important;
  }

  .main{
    height:auto !important;
    min-height:100vh !important;
    overflow:visible !important;
  }

  .content{
    overflow:visible !important;
    padding:10px !important;
  }

  .sales-layout{
    grid-template-columns:1fr !important;
    height:auto !important;
  }

  .sales-main > .table-wrap.stock-list-box{
    height:52vh !important;
    min-height:360px !important;
  }

  .cart{
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
  }

  .cart-body{
    max-height:260px;
  }

  .toolbar{
    display:grid !important;
    grid-template-columns:1fr auto auto auto !important;
    gap:8px !important;
  }

  .toolbar input{
    min-width:0 !important;
    width:100% !important;
  }

  .filters{
    grid-template-columns:repeat(3, minmax(120px, 1fr)) !important;
  }

  .stock-table.default-cols{
    min-width:900px !important;
    width:max-content !important;
    table-layout:auto !important;
  }

  .stock-table.default-cols th,
  .stock-table.default-cols td{
    white-space:nowrap !important;
  }
}

/* Phone / small tablet: use top navigation style */
@media(max-width:720px){
  .app{
    display:block !important;
  }

  .sidebar{
    position:relative !important;
    width:100% !important;
    height:auto !important;
    padding:10px !important;
  }

  .sidebar .brand{
    display:flex !important;
    padding-bottom:8px !important;
  }

  .sidebar .brand div:not(.logo){
    display:block !important;
    font-size:initial !important;
  }

  .userbox,
  .side-actions{
    display:none !important;
  }

  .nav{
    display:grid !important;
    grid-template-columns:repeat(5, minmax(0,1fr)) !important;
    gap:6px !important;
  }

  .nav button{
    font-size:12px !important;
    text-align:center !important;
    padding:9px 4px !important;
  }

  .topbar{
    height:auto !important;
    padding:10px !important;
    align-items:flex-start !important;
    gap:8px !important;
  }

  .topbar h1{
    font-size:20px !important;
  }

  .toolbar{
    grid-template-columns:1fr 1fr !important;
  }

  .toolbar input{
    grid-column:1/-1 !important;
  }

  .filters{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }

  .stock-table.default-cols{
    min-width:860px !important;
  }
}

/* Small phone */
@media(max-width:480px){
  .filters{
    grid-template-columns:1fr !important;
  }

  .toolbar{
    grid-template-columns:1fr !important;
  }

  .nav{
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
  }

  .sales-main > .table-wrap.stock-list-box{
    min-height:300px !important;
    height:48vh !important;
  }
}

/* Wide screens */
@media(min-width:1600px){
  .sales-layout{
    grid-template-columns:minmax(0,1fr) 340px !important;
  }

  .filters{
    grid-template-columns:repeat(7, minmax(130px, 1fr)) !important;
  }
}


/* V35 fix Action column layout */
.stock-table.default-cols th:nth-child(9),
.stock-table.default-cols td:nth-child(9){
  width:8% !important;
}

.stock-table.default-cols th:nth-child(10),
.stock-table.default-cols td:nth-child(10){
  width:13% !important;
  min-width:118px !important;
}

.stock-table.default-cols .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  gap:6px !important;
  align-items:center !important;
  justify-content:flex-start !important;
  white-space:nowrap !important;
}

.stock-table.default-cols .row-actions button{
  min-width:48px !important;
  padding:7px 9px !important;
  font-size:12px !important;
  line-height:1.1 !important;
}

.stock-table.default-cols td{
  height:54px !important;
  vertical-align:middle !important;
}

/* On narrower screens, keep action buttons side by side and allow table scroll instead */
@media(max-width:1250px){
  .stock-table.default-cols{
    min-width:980px !important;
    width:max-content !important;
    table-layout:auto !important;
  }

  .stock-table.default-cols .row-actions{
    flex-direction:row !important;
  }
}


/* V36 fix Manufacturer header width on large screens */
.stock-table.default-cols th:nth-child(2),
.stock-table.default-cols td:nth-child(2){
  width:12% !important;
  min-width:125px !important;
}

.stock-table.default-cols th:nth-child(1),
.stock-table.default-cols td:nth-child(1){
  width:18% !important;
}

.stock-table.default-cols th:nth-child(3),
.stock-table.default-cols td:nth-child(3){
  width:13% !important;
}

/* Header text should not truncate on normal/wide screens */
@media(min-width:1260px){
  .stock-table.default-cols th{
    white-space:nowrap !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }
}


/* V37 cart quantity control fix */
.cart-controls{
  display:grid;
  grid-template-columns:112px minmax(90px, 1fr) auto;
  gap:10px;
  align-items:end;
  margin-top:10px;
}

.qty-control,
.price-control{
  min-width:0;
}

.qty-stepper{
  display:grid !important;
  grid-template-columns:30px 42px 30px !important;
  gap:5px !important;
  align-items:center;
}

.qty-stepper button{
  width:30px !important;
  height:36px !important;
  min-width:30px !important;
  padding:0 !important;
  font-size:16px !important;
  line-height:1 !important;
  border-radius:9px !important;
}

.qty-stepper input{
  width:42px !important;
  min-width:42px !important;
  height:36px !important;
  padding:0 !important;
  text-align:center !important;
  border-radius:9px !important;
  font-weight:700;
}

.price-control input{
  height:36px;
  padding:7px 9px;
}

.remove-btn{
  height:36px;
  padding:0 13px !important;
  white-space:nowrap;
}

@media(max-width:420px){
  .cart-controls{
    grid-template-columns:1fr;
  }
  .remove-btn{
    width:100%;
  }
}


/* V38 fix: remove sticky first column.
   Only the table header stays sticky. Item # cells now scroll normally with the row. */
.stock-table th:first-child,
.stock-table td:first-child,
.stock-table.default-cols th:first-child,
.stock-table.default-cols td:first-child,
.stock-table.wide-cols th:first-child,
.stock-table.wide-cols td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
}

.stock-table td:first-child,
.stock-table.default-cols td:first-child,
.stock-table.wide-cols td:first-child{
  background:inherit !important;
}

/* Keep only the header sticky during vertical scroll */
.stock-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:10 !important;
}


/* V39 restored Customers UI */
.customer-page{
  display:grid;
  gap:14px;
  min-height:0;
}
.customer-toolbar{
  justify-content:flex-start;
}
.customer-toolbar input{
  max-width:520px;
}
.customer-card h2{
  margin:0 0 18px;
}
.customer-table-wrap{
  box-shadow:none;
}
.customer-table{
  min-width:1050px;
}
.customer-form{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:14px;
}
.customer-form .full{
  grid-column:1/-1;
}
.customer-form input,
.customer-form select{
  height:36px;
  border-radius:3px;
}
.customer-form label{
  margin-bottom:3px;
}
@media(max-width:900px){
  .customer-form{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:560px){
  .customer-form{
    grid-template-columns:1fr;
  }
  .customer-form .full{
    grid-column:auto;
  }
}


/* V40 professional Customers page */
.clean-customer-page{
  display:grid;
  gap:14px;
  height:100%;
  min-height:0;
  grid-template-rows:auto auto minmax(0,1fr);
}

.customer-summary{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
}

.summary-card{
  background:#fff;
  border:1px solid #dfe7f2;
  border-radius:16px;
  padding:14px 16px;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.summary-card span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
}

.summary-card b{
  font-size:24px;
}

.customer-toolbar-pro{
  background:#fff;
  border:1px solid #dfe7f2;
  border-radius:16px;
  padding:14px 16px;
  display:flex;
  align-items:end;
  gap:12px;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.customer-toolbar-pro .search-wrap{
  flex:1;
  max-width:620px;
}

.customer-toolbar-pro input{
  height:40px;
}

.customer-toolbar-pro button{
  height:40px;
  min-width:130px;
}

.customer-card-pro{
  background:#fff;
  border:1px solid #dfe7f2;
  border-radius:16px;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
  padding:16px;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.customer-section-head{
  margin-bottom:14px;
}

.customer-section-head h2{
  margin:0;
  font-size:22px;
}

.customer-section-head p{
  margin:4px 0 0;
  color:#64748b;
  font-size:13px;
}

.customer-table-wrap{
  flex:1;
  min-height:0;
  overflow:auto;
  border-radius:14px;
  box-shadow:none;
}

.professional-customer-table{
  width:100%;
  min-width:1050px;
  table-layout:auto;
}

.professional-customer-table th{
  background:#102a43;
  color:#fff;
  padding:12px 14px;
}

.professional-customer-table td{
  padding:13px 14px;
  vertical-align:middle;
}

.customer-name-cell{
  display:grid;
  gap:3px;
}

.customer-name-cell span{
  color:#64748b;
  font-size:12px;
}

.customer-type{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  font-weight:800;
}

.customer-type.b2b{
  background:#eff6ff;
  color:#1d4ed8;
}

.customer-type.b2c{
  background:#ecfdf5;
  color:#047857;
}

.customer-actions{
  display:flex;
  gap:8px;
  white-space:nowrap;
}

.customer-actions button{
  min-width:76px;
}

/* Override old customer toolbar/card rules */
.customer-page .toolbar,
.customer-card{
  display:none !important;
}

@media(max-width:1200px){
  .customer-summary{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:1000px){
  .customer-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .clean-customer-page{
    height:auto;
  }

  .customer-card-pro{
    min-height:420px;
  }
}

@media(max-width:560px){
  .customer-summary{
    grid-template-columns:1fr;
  }

  .customer-toolbar-pro{
    display:grid;
    grid-template-columns:1fr;
  }

  .customer-toolbar-pro .search-wrap{
    max-width:none;
  }

  .customer-toolbar-pro button{
    width:100%;
  }
}


/* V41 B2B invoice/payment tracking */
.due-badge{
  background:#f97316;
  color:#fff;
  border-radius:999px;
  padding:7px 11px;
  font-size:12px;
  font-weight:800;
  margin-right:8px;
}
.status-pill{
  display:inline-flex;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  background:#e0f2fe;
  color:#0369a1;
}
.status-pill.overdue{
  background:#fee2e2;
  color:#991b1b;
}
.status-pill.due{
  background:#ffedd5;
  color:#9a3412;
}
.status-pill.open{
  background:#eef2ff;
  color:#3730a3;
}
.reports-page{
  display:grid;
  gap:14px;
}


/* V43 customer modal form fix */
.customer-form{
  grid-template-columns:1fr 1fr 1fr 1fr !important;
  gap:12px !important;
}

.customer-form input,
.customer-form select{
  width:100% !important;
  height:42px !important;
  min-height:42px !important;
  padding:9px 12px !important;
  line-height:20px !important;
  font-size:15px !important;
  border-radius:8px !important;
  box-sizing:border-box !important;
}

.customer-form select{
  appearance:auto !important;
  -webkit-appearance:menulist !important;
  overflow:visible !important;
  text-overflow:clip !important;
  white-space:nowrap !important;
}

.customer-form label{
  font-size:12px !important;
  margin-bottom:5px !important;
}

.customer-form .full{
  grid-column:1/-1 !important;
}

@media(max-width:800px){
  .customer-form{
    grid-template-columns:1fr 1fr !important;
  }
}

@media(max-width:520px){
  .customer-form{
    grid-template-columns:1fr !important;
  }
}


/* V44 B2B checkout balance + cart layout cleanup */
.cart{
  overflow:hidden !important;
}

.cart-body{
  overflow-y:auto !important;
  overflow-x:hidden !important;
}

.cart-item{
  overflow:hidden !important;
}

.cart-item-top{
  align-items:flex-start;
}

.cart-item-top > div:first-child{
  min-width:0;
}

.cart-item-top b{
  white-space:nowrap;
}

.cart-item .muted{
  word-break:break-word;
}

.checkout-payment-box{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  border-radius:14px;
  padding:10px 12px;
  display:grid;
  gap:7px;
  margin:10px 0 12px;
}

.checkout-payment-box div{
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.checkout-payment-box span{
  color:#64748b;
  font-size:13px;
}

.checkout-payment-box b{
  font-size:15px;
}

.checkout-payment-box .remaining{
  border-top:1px solid #e5edf7;
  padding-top:7px;
}

.checkout-payment-box .remaining b{
  color:#b91c1c;
  font-size:17px;
}

.checkout-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.checkout-fields .due-date-field{
  grid-column:1/-1;
}

.checkout-fields input{
  height:42px;
}

.cart-controls{
  grid-template-columns:112px minmax(82px, 1fr) auto !important;
}

.price-control input{
  min-width:0;
}

.remove-btn{
  min-width:88px;
}

@media(max-width:420px){
  .checkout-fields{
    grid-template-columns:1fr;
  }
}


/* V45 payment balance display */
.negative-money{
  color:#b91c1c;
  font-weight:900;
}

.payment-summary-card{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  border-radius:16px;
  padding:16px;
  display:grid;
  gap:14px;
  margin-bottom:14px;
}

.payment-summary-card h3{
  margin:0;
}

.payment-summary-card p{
  margin:4px 0 0;
}

.payment-lines{
  display:grid;
  gap:8px;
}

.payment-lines div,
.payment-preview div{
  display:flex;
  justify-content:space-between;
  gap:14px;
}

.payment-lines span,
.payment-preview span{
  color:#64748b;
}

.payment-lines b,
.payment-preview b{
  font-size:16px;
}

.payment-lines .remaining-line{
  border-top:1px solid #e5edf7;
  padding-top:8px;
}

.payment-form-grid .full-row{
  grid-column:1/-1;
}

.payment-preview{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  border-radius:14px;
  padding:12px 14px;
  display:grid;
  gap:8px;
  margin-top:12px;
}

.payment-receipt-totals .negative-money{
  color:#b91c1c;
}


/* V46 customer balance warning + cart text overlap fix */
.customer-balance-warning{
  margin-top:10px;
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
  border-radius:12px;
  padding:10px 12px;
  display:grid;
  gap:3px;
  font-size:13px;
}

.customer-balance-warning b{
  font-size:13px;
}

.customer-balance-warning .negative-money{
  color:#b91c1c;
  font-weight:900;
}

.cart-item-top{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:start;
}

.cart-item-info{
  min-width:0;
  overflow:hidden;
}

.cart-item-name{
  display:block;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.25;
  padding-right:4px;
}

.cart-line-total{
  white-space:nowrap;
  text-align:right;
  font-size:14px;
  line-height:1.25;
  padding-top:1px;
}

.cart-item .muted{
  overflow-wrap:anywhere;
  line-height:1.3;
}

.cart-item{
  padding:12px !important;
}

.cart-controls{
  grid-template-columns:105px minmax(82px,1fr) auto !important;
  gap:9px !important;
}

@media(max-width:380px){
  .cart-item-top{
    grid-template-columns:1fr;
  }
  .cart-line-total{
    text-align:left;
  }
}


/* V47 customer selection clarity */
.cart-head select option[value=""]{
  color:#64748b;
}


/* V48 cart item readability fix */
.cart-body{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:12px !important;
  gap:10px !important;
}

.cart-item{
  min-height:auto !important;
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
  padding:12px !important;
  border-radius:14px !important;
}

.cart-item-top{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:10px !important;
  align-items:start !important;
}

.cart-item-info{
  min-width:0 !important;
  overflow:visible !important;
}

.cart-item-name{
  display:block !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  line-height:1.25 !important;
  max-height:none !important;
}

.cart-line-total{
  white-space:nowrap !important;
  align-self:start !important;
  padding-top:0 !important;
}

.cart-item .muted{
  display:block !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  line-height:1.35 !important;
  max-height:none !important;
}

.cart-controls{
  margin-top:12px !important;
  align-items:end !important;
}

/* Remove any row-height restrictions inherited from table/cart fixes */
.cart-item,
.cart-item *{
  max-height:none;
}

/* Keep the cart panel usable and readable */
.cart{
  min-width:300px;
}

@media(max-width:980px){
  .cart{
    min-width:0;
  }
}


/* V50 compact checkout typography */
.cart{
  font-size:13px !important;
}

.cart-head{
  padding:12px !important;
}

.cart-head label,
.cart-foot label{
  font-size:11px !important;
}

.cart-head select{
  height:38px !important;
  font-size:14px !important;
}

.customer-balance-warning{
  padding:8px 10px !important;
  font-size:12px !important;
  gap:2px !important;
}

.customer-balance-warning b{
  font-size:12px !important;
}

.cart-body{
  padding:10px !important;
  gap:8px !important;
}

.cart-item{
  padding:10px !important;
  border-radius:12px !important;
}

.cart-item-name{
  font-size:13px !important;
  line-height:1.22 !important;
}

.cart-line-total{
  font-size:13px !important;
  min-width:72px;
}

.cart-item .muted{
  font-size:12px !important;
  line-height:1.25 !important;
}

.cart-controls{
  grid-template-columns:98px minmax(75px, 1fr) auto !important;
  gap:7px !important;
  margin-top:9px !important;
}

.qty-stepper{
  grid-template-columns:28px 38px 28px !important;
  gap:4px !important;
}

.qty-stepper button{
  width:28px !important;
  height:34px !important;
  min-width:28px !important;
  font-size:14px !important;
}

.qty-stepper input{
  width:38px !important;
  min-width:38px !important;
  height:34px !important;
  font-size:13px !important;
}

.price-control input{
  height:34px !important;
  font-size:13px !important;
  padding:6px 8px !important;
}

.remove-btn{
  height:34px !important;
  min-width:76px !important;
  padding:0 10px !important;
  font-size:13px !important;
}

.cart-foot{
  padding:12px !important;
}

.channel-toggle button{
  padding:9px 8px !important;
  font-size:13px !important;
}

.total-line{
  margin:5px 0 !important;
  font-size:13px !important;
}

.total-line strong,
.total-line b{
  font-size:14px !important;
}

.checkout-payment-box{
  padding:9px 10px !important;
  border-radius:12px !important;
  gap:5px !important;
  margin:8px 0 10px !important;
}

.checkout-payment-box span{
  font-size:12px !important;
}

.checkout-payment-box b{
  font-size:14px !important;
}

.checkout-payment-box .remaining b{
  font-size:15px !important;
}

.checkout-fields{
  gap:8px !important;
}

.checkout-fields input{
  height:38px !important;
  font-size:14px !important;
  padding:8px 10px !important;
}

.cart-foot .alert{
  padding:9px 10px !important;
  font-size:12px !important;
  line-height:1.35 !important;
}

.cart-foot button.success{
  height:46px !important;
  font-size:16px !important;
  margin-top:10px !important;
}

/* Give checkout a little more width on desktop while still staying compact */
@media(min-width:1200px){
  .sales-layout{
    grid-template-columns:minmax(0,1fr) 320px !important;
  }
}

@media(min-width:1600px){
  .sales-layout{
    grid-template-columns:minmax(0,1fr) 350px !important;
  }
}


/* V51 checkout space + compact payment fields */

/* Give added items more usable space */
.cart-body{
  min-height:190px !important;
  max-height:none !important;
  flex:1 1 auto !important;
  padding:10px !important;
}

.cart-item{
  padding:9px 10px !important;
}

.cart-item-top{
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:8px !important;
}

.cart-item-name{
  font-size:12.5px !important;
  line-height:1.18 !important;
}

.cart-item .muted{
  font-size:11.5px !important;
  line-height:1.2 !important;
}

.cart-line-total{
  font-size:12.5px !important;
  min-width:64px !important;
}

/* Make item controls shorter */
.cart-controls{
  grid-template-columns:92px 78px auto !important;
  gap:7px !important;
  margin-top:7px !important;
}

.qty-stepper{
  grid-template-columns:26px 34px 26px !important;
}

.qty-stepper button{
  width:26px !important;
  height:31px !important;
  min-width:26px !important;
}

.qty-stepper input{
  width:34px !important;
  min-width:34px !important;
  height:31px !important;
}

.price-control input{
  height:31px !important;
  width:78px !important;
}

.remove-btn{
  height:31px !important;
  min-width:70px !important;
  padding:0 8px !important;
  font-size:12.5px !important;
}

/* Compact totals/payment area so items get more room */
.cart-foot{
  padding:10px !important;
  flex:0 0 auto !important;
}

.channel-toggle button{
  padding:8px 6px !important;
}

.total-line{
  margin:3px 0 !important;
  line-height:1.2 !important;
}

.checkout-payment-box{
  padding:7px 9px !important;
  gap:4px !important;
  margin:7px 0 8px !important;
}

.checkout-payment-box div{
  line-height:1.2 !important;
}

.checkout-fields{
  display:grid !important;
  grid-template-columns:96px 96px 1fr !important;
  gap:8px !important;
  align-items:end !important;
}

.checkout-fields label{
  font-size:10.5px !important;
  line-height:1.15 !important;
  min-height:24px;
}

.checkout-fields input{
  height:34px !important;
  padding:6px 8px !important;
  font-size:13px !important;
}

.checkout-fields .due-date-field{
  grid-column:auto !important;
}

.checkout-fields .due-date-field input{
  width:100% !important;
}

.cart-foot .alert{
  padding:7px 9px !important;
  font-size:11.5px !important;
  line-height:1.25 !important;
  margin:8px 0 !important;
}

.cart-foot button.success{
  height:44px !important;
  margin-top:8px !important;
}

/* On narrow checkout panel, keep payment fields usable */
@media(max-width:1350px){
  .checkout-fields{
    grid-template-columns:1fr 1fr !important;
  }

  .checkout-fields .due-date-field{
    grid-column:1/-1 !important;
  }

  .checkout-fields .due-date-field input{
    max-width:180px;
  }
}

@media(max-width:420px){
  .checkout-fields{
    grid-template-columns:1fr !important;
  }

  .checkout-fields .due-date-field input{
    max-width:none;
  }
}


/* V52 customer lookup by name / phone / Tazkira */
.cart-head input#customerLookup{
  height:38px !important;
  font-size:14px !important;
}

.professional-customer-table{
  min-width:1180px !important;
}

.customer-form{
  grid-template-columns:repeat(5, minmax(0,1fr)) !important;
}

.customer-form .full{
  grid-column:1/-1 !important;
}

@media(max-width:1050px){
  .customer-form{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }
}

@media(max-width:560px){
  .customer-form{
    grid-template-columns:1fr !important;
  }
}


/* V53 proper customer search selector */
.customer-search-box{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) 58px;
  gap:7px;
  align-items:start;
}

.customer-search-box input{
  height:38px !important;
  font-size:14px !important;
}

.customer-search-box button.small{
  height:38px;
  padding:0 8px !important;
  white-space:nowrap;
}

.customer-search-results{
  position:absolute;
  left:0;
  right:65px;
  top:43px;
  z-index:40;
  background:#fff;
  border:1px solid #dbe7f5;
  border-radius:12px;
  box-shadow:0 14px 28px rgba(15,23,42,.16);
  max-height:230px;
  overflow:auto;
}

.customer-search-results:empty{
  display:none;
}

.customer-search-results button{
  width:100%;
  display:grid;
  gap:3px;
  text-align:left;
  background:#fff;
  border-radius:0;
  padding:10px 12px;
  border-bottom:1px solid #eef2f7;
}

.customer-search-results button:hover{
  background:#eff6ff;
}

.customer-search-results button b{
  font-size:13px;
}

.customer-search-results button span{
  color:#64748b;
  font-size:12px;
}

.no-results{
  padding:10px 12px;
  color:#64748b;
  font-size:12px;
}

.selected-customer-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  border:1px solid #dbe7f5;
  background:#fff;
  border-radius:12px;
  padding:9px 10px;
}

.selected-customer-box div{
  min-width:0;
  display:grid;
  gap:2px;
}

.selected-customer-box b{
  font-size:14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.selected-customer-box span{
  color:#64748b;
  font-size:11.5px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.selected-customer-box button{
  height:32px;
  padding:0 10px !important;
}


/* V54 customer selector shows names and supports search */
.customer-search-results button b{
  font-size:13.5px;
}

.customer-search-results button span{
  font-size:11.5px;
}


/* V55 remove customer helper text and give cart more room */
.cart-head{
  padding-bottom:10px !important;
}

.cart-head .muted{
  display:none !important;
}

.customer-search-box{
  margin-bottom:0 !important;
}

.customer-balance-warning{
  margin-top:8px !important;
}


/* V57 professional retail reports */
.professional-reports{
  display:grid;
  gap:14px;
  min-height:0;
}

.report-controls{
  display:grid;
  gap:12px;
  padding:14px !important;
}

.report-range{
  display:grid;
  grid-template-columns:150px 150px minmax(220px,1fr);
  gap:12px;
  align-items:end;
}

.report-range input{
  height:38px;
}

.report-search input{
  width:100%;
}

.report-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.report-buttons button{
  height:36px;
  padding:0 12px !important;
}

.report-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.report-table-wrap{
  max-height:46vh;
  overflow:auto;
  border-radius:14px;
}

.report-table{
  min-width:1350px;
}

.report-table th{
  position:sticky;
  top:0;
  z-index:5;
}

.status-pill.closed{
  background:#dcfce7;
  color:#166534;
}

.invoice-detail-head{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:12px;
  margin-bottom:12px;
  background:#f8fbff;
}

.invoice-detail-head div{
  display:grid;
  gap:3px;
}

.invoice-detail-head span{
  color:#64748b;
  font-size:12px;
}

.detail-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.detail-summary-grid div{
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:10px;
  background:#fff;
  display:grid;
  gap:5px;
}

.detail-summary-grid span{
  color:#64748b;
  font-size:12px;
}

.detail-summary-grid b{
  font-size:17px;
}

.detail-table{
  min-width:900px;
}

.report-print{
  padding:24px;
}

.report-print h1{
  margin:0 0 6px;
}

@media(max-width:1100px){
  .report-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .report-range{
    grid-template-columns:1fr 1fr;
  }
  .report-search{
    grid-column:1/-1;
  }
}

@media(max-width:560px){
  .report-kpis,
  .detail-summary-grid,
  .invoice-detail-head,
  .report-range{
    grid-template-columns:1fr;
  }
}


/* V59 reports search fix */
.report-search-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:8px;
  align-items:center;
}

.report-search-row input{
  width:100%;
}

.report-search-row button{
  height:38px;
  padding:0 14px !important;
}

@media(max-width:720px){
  .report-search-row{
    grid-template-columns:1fr;
  }
}


/* V60 checkout customer type + reports layout fix */
.professional-reports{
  height:100%;
  min-height:0;
  overflow:hidden;
  grid-template-rows:auto auto minmax(0,1.25fr) minmax(180px,.75fr);
}

.report-controls{
  flex:0 0 auto;
}

.report-kpis{
  flex:0 0 auto;
}

.professional-reports > .card{
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.professional-reports .section-head{
  flex:0 0 auto;
}

.report-scroll-box{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  border:1px solid #dbe7f5;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  background:#fff;
}

.report-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}

.report-table-footer{
  flex:0 0 auto;
  min-height:34px;
  padding:8px 12px;
  background:#f8fafc;
  border-top:1px solid #e2e8f0;
  color:#64748b;
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
}

.report-table{
  min-width:1350px;
  width:max-content;
}

.report-table th{
  position:sticky !important;
  top:0 !important;
  z-index:6;
}

.open-invoices .report-table{
  min-width:1050px;
}

.report-card-small h2{
  font-size:22px;
}

/* Make report page usable on smaller screens */
@media(max-width:980px){
  .professional-reports{
    height:auto;
    overflow:visible;
    grid-template-rows:none;
  }

  .professional-reports > .card{
    min-height:360px;
  }

  .report-scroll-box{
    min-height:300px;
  }
}


/* V61 fix broken first column/header alignment */

/* No table first column should detach from the row */
.stock-table th:first-child,
.stock-table td:first-child,
.stock-table.default-cols th:first-child,
.stock-table.default-cols td:first-child,
.stock-table.wide-cols th:first-child,
.stock-table.wide-cols td:first-child,
.report-table th:first-child,
.report-table td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
  background:inherit !important;
}

/* Keep header row sticky only as a normal full row */
.stock-table thead th,
.report-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:8 !important;
  background:#102a43 !important;
  color:#fff !important;
}

/* Make table layout consistent so first column header aligns with first column cells */
.stock-table,
.report-table{
  border-collapse:separate !important;
  border-spacing:0 !important;
}

.stock-table th,
.stock-table td,
.report-table th,
.report-table td{
  box-sizing:border-box !important;
  vertical-align:middle !important;
}

/* Sales default table: force proper Item # column width and header visibility */
.sales-main .stock-table.default-cols{
  width:100% !important;
  table-layout:fixed !important;
  min-width:0 !important;
}

.sales-main .stock-table.default-cols th:nth-child(1),
.sales-main .stock-table.default-cols td:nth-child(1){
  width:17% !important;
  min-width:140px !important;
}

.sales-main .stock-table.default-cols th:nth-child(2),
.sales-main .stock-table.default-cols td:nth-child(2){
  width:12% !important;
  min-width:120px !important;
}

.sales-main .stock-table.default-cols th:nth-child(3),
.sales-main .stock-table.default-cols td:nth-child(3){
  width:14% !important;
  min-width:130px !important;
}

.sales-main .stock-table.default-cols th:nth-child(10),
.sales-main .stock-table.default-cols td:nth-child(10){
  width:12% !important;
  min-width:125px !important;
}

/* If screen is not wide enough, table scrolls normally instead of breaking columns */
@media(max-width:1280px){
  .sales-main .stock-table.default-cols{
    width:max-content !important;
    min-width:1050px !important;
    table-layout:auto !important;
  }
}

/* Reports tables: prevent first invoice column from floating separately */
.report-scroll{
  overflow:auto !important;
}

.report-table{
  width:max-content !important;
  min-width:1350px !important;
  table-layout:auto !important;
}

.report-table th:first-child,
.report-table td:first-child{
  min-width:130px !important;
}

.open-invoices .report-table{
  min-width:1050px !important;
}

/* Fix accidental black blank area from overflowing report cards */
.professional-reports{
  background:#f3f6fb !important;
}

.professional-reports > .card{
  background:#fff !important;
}


/* V62 Reports layout repair */

/* Let the Reports page breathe vertically instead of forcing compressed grid rows */
.professional-reports{
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  gap:14px !important;
  background:#f3f6fb !important;
}

/* Controls and KPI area should not shrink */
.report-controls,
.report-kpis{
  flex:0 0 auto !important;
}

/* Report cards */
.professional-reports > .card{
  background:#fff !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

/* Invoice Register gets the larger area */
.professional-reports > .card:nth-of-type(1){
  flex:1 1 48% !important;
  min-height:300px !important;
}

/* Due/Open invoices gets its own visible area */
.professional-reports > .card:nth-of-type(2){
  flex:1 1 34% !important;
  min-height:240px !important;
}

.professional-reports .section-head{
  flex:0 0 auto !important;
  margin-bottom:12px !important;
}

/* Table containers */
.report-scroll-box{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
  overflow:hidden !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  background:#fff !important;
  display:flex !important;
  flex-direction:column !important;
}

/* Actual table scrolling happens here */
.report-scroll{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:100% !important;
  overflow:auto !important;
  background:#fff !important;
}

/* Footer always visible below table scroll */
.report-table-footer{
  flex:0 0 34px !important;
  min-height:34px !important;
  padding:8px 12px !important;
  background:#f8fafc !important;
  border-top:1px solid #e2e8f0 !important;
  color:#64748b !important;
  display:flex !important;
  justify-content:space-between !important;
  gap:12px !important;
  font-size:12px !important;
}

/* Tables should not collapse */
.report-table{
  width:max-content !important;
  min-width:1350px !important;
  table-layout:auto !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}

.open-invoices .report-table{
  min-width:1100px !important;
}

.report-table th,
.report-table td{
  padding:12px 14px !important;
  white-space:nowrap !important;
  vertical-align:middle !important;
  box-sizing:border-box !important;
  height:48px !important;
  min-height:48px !important;
}

/* Sticky table header only */
.report-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:10 !important;
  background:#102a43 !important;
  color:#fff !important;
}

/* First column should NOT be sticky or detached */
.report-table th:first-child,
.report-table td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
}

/* Action buttons stay on one row and do not crush table height */
.report-table .row-actions{
  display:flex !important;
  flex-direction:row !important;
  gap:6px !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}

.report-table .row-actions button{
  height:34px !important;
  padding:0 10px !important;
  white-space:nowrap !important;
}

/* Prevent the page bottom from disappearing */
.main,
.content{
  min-height:0 !important;
}

.content{
  overflow:hidden !important;
}

/* Smaller screens: allow page scroll, but keep tables readable */
@media(max-width:1100px){
  .professional-reports{
    height:auto !important;
    overflow:visible !important;
  }

  .content{
    overflow:visible !important;
  }

  .professional-reports > .card:nth-of-type(1),
  .professional-reports > .card:nth-of-type(2){
    flex:none !important;
    min-height:360px !important;
  }

  .report-scroll-box{
    min-height:280px !important;
  }
}


/* V63 Reports full repair: restore normal readable tables */

/* Reports page should scroll as a page, not squash cards into tiny strips */
.content{
  overflow:auto !important;
}

.professional-reports{
  height:auto !important;
  min-height:100% !important;
  overflow:visible !important;
  display:grid !important;
  grid-template-rows:none !important;
  gap:14px !important;
  background:#f3f6fb !important;
}

/* Remove forced flex compression from report cards */
.professional-reports > .card,
.professional-reports > .card:nth-of-type(1),
.professional-reports > .card:nth-of-type(2){
  display:block !important;
  flex:none !important;
  min-height:auto !important;
  height:auto !important;
  overflow:visible !important;
  background:#fff !important;
}

/* Report controls should not have huge empty height */
.report-controls{
  min-height:0 !important;
  height:auto !important;
  display:grid !important;
  gap:12px !important;
  padding:14px !important;
}

/* KPI cards normal */
.report-kpis{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:12px !important;
}

/* Invoice register table area */
.report-scroll-box{
  display:flex !important;
  flex-direction:column !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:hidden !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  background:#fff !important;
}

/* Make rows visible; table scrolls inside this fixed-height viewport */
.report-scroll{
  height:360px !important;
  min-height:360px !important;
  max-height:360px !important;
  overflow:auto !important;
  background:#fff !important;
}

/* Open invoice table gets a slightly smaller viewport */
.open-invoices .report-scroll{
  height:260px !important;
  min-height:260px !important;
  max-height:260px !important;
}

/* Footer below scroll area */
.report-table-footer{
  height:36px !important;
  min-height:36px !important;
  padding:8px 12px !important;
  background:#f8fafc !important;
  border-top:1px solid #e2e8f0 !important;
  color:#64748b !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  font-size:12px !important;
}

/* Table must have a normal header and visible first column */
.report-table{
  width:max-content !important;
  min-width:1380px !important;
  table-layout:auto !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}

.open-invoices .report-table{
  min-width:1120px !important;
}

/* Restore all report table cells */
.report-table th,
.report-table td{
  position:static !important;
  box-sizing:border-box !important;
  padding:12px 14px !important;
  height:50px !important;
  min-height:50px !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  vertical-align:middle !important;
  background:#fff;
  border-bottom:1px solid #e8eef6;
}

/* Header row sticky, including Invoice # */
.report-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:20 !important;
  background:#102a43 !important;
  color:#fff !important;
  font-weight:800 !important;
  border-bottom:0 !important;
}

/* First column specifically: no sticky, no clipping, real width */
.report-table th:first-child,
.report-table td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
  min-width:140px !important;
  width:140px !important;
  background:inherit !important;
}

/* Prevent first column from becoming blank due to previous overrides */
.report-table thead th:first-child{
  background:#102a43 !important;
  color:#fff !important;
}

/* Keep buttons visible without increasing row height too much */
.report-table .row-actions{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
}

.report-table .row-actions button{
  height:34px !important;
  padding:0 10px !important;
  white-space:nowrap !important;
}

/* Restore sales table first column too */
.sales-main .stock-table.default-cols th:first-child,
.sales-main .stock-table.default-cols td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
  min-width:140px !important;
  background:inherit !important;
}

.sales-main .stock-table.default-cols thead th:first-child{
  background:#102a43 !important;
  color:#fff !important;
}

/* Smaller screens */
@media(max-width:1100px){
  .report-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .report-scroll{
    height:330px !important;
    min-height:330px !important;
    max-height:330px !important;
  }

  .open-invoices .report-scroll{
    height:260px !important;
    min-height:260px !important;
    max-height:260px !important;
  }
}

@media(max-width:560px){
  .report-kpis{
    grid-template-columns:1fr !important;
  }
}


/* V64 final table header fix + settings repair */

/* IMPORTANT:
   Body first column must scroll normally.
   Header first column must stay sticky with the rest of the header row.
*/

/* Body cells in first column: normal scrolling, no sticky/floating */
.stock-table tbody td:first-child,
.report-table tbody td:first-child,
.sales-main .stock-table.default-cols tbody td:first-child{
  position:static !important;
  left:auto !important;
  top:auto !important;
  z-index:auto !important;
  background:inherit !important;
}

/* ALL header cells, including first header cell, stay sticky at the top */
.stock-table thead th,
.stock-table thead th:first-child,
.report-table thead th,
.report-table thead th:first-child,
.sales-main .stock-table.default-cols thead th,
.sales-main .stock-table.default-cols thead th:first-child{
  position:sticky !important;
  top:0 !important;
  left:auto !important;
  z-index:50 !important;
  background:#102a43 !important;
  color:#fff !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
}

/* Remove old conflicting first-column sticky rules */
.stock-table th:first-child,
.report-table th:first-child,
.stock-table.default-cols th:first-child,
.stock-table.wide-cols th:first-child{
  left:auto !important;
}

/* Sales table header/rows alignment */
.sales-main .stock-table.default-cols{
  border-collapse:separate !important;
  border-spacing:0 !important;
}

.sales-main .stock-table.default-cols th,
.sales-main .stock-table.default-cols td{
  box-sizing:border-box !important;
  vertical-align:middle !important;
}

/* Reports table header/rows alignment */
.report-table{
  border-collapse:separate !important;
  border-spacing:0 !important;
}

.report-table th,
.report-table td{
  box-sizing:border-box !important;
  vertical-align:middle !important;
}

/* Settings/Admin portal repair after Reports overflow overrides */
body:has(.settings-layout) .content,
.settings-layout{
  overflow:auto !important;
}

.settings-layout{
  display:grid !important;
  grid-template-columns:240px minmax(0,1fr) !important;
  gap:16px !important;
  height:100% !important;
  min-height:0 !important;
}

.settings-nav{
  align-self:start !important;
  position:sticky !important;
  top:0 !important;
  z-index:2;
}

.settings-pane{
  min-width:0 !important;
  overflow:auto !important;
  padding-bottom:18px !important;
}

.settings-pane .card{
  overflow:visible !important;
}

/* When screen is small, settings stacks cleanly */
@media(max-width:900px){
  .settings-layout{
    grid-template-columns:1fr !important;
    height:auto !important;
  }

  .settings-nav{
    position:static !important;
  }
}


/* V65 clarify Collections section */
.report-card-small{
  border-left:4px solid #f97316 !important;
}

.report-card-small .section-head p{
  max-width:720px;
}


/* V66 fixed Reports module: no page scroll, only data scrolls */
.content{overflow:hidden !important;}
.reports-fixed{height:100%;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:12px;}
.reports-fixed .report-controls{min-height:0 !important;height:auto !important;padding:12px 14px !important;}
.report-tabs{display:flex;gap:8px;flex-wrap:wrap;}
.report-tabs button{background:#fff;border:1px solid #dbe7f5;color:#102a43;border-radius:12px;height:40px;padding:0 16px;font-weight:800;}
.report-tabs button.active{background:#2563eb;color:#fff;border-color:#2563eb;}
.report-active-panel{min-height:0;overflow:hidden;display:flex;}
.report-active-panel>*{width:100%;}

/* Dashboard */
.reports-dashboard{min-height:0;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;}
.main-kpis{display:grid !important;grid-template-columns:repeat(6,minmax(0,1fr)) !important;gap:10px !important;}
.main-kpis .summary-card{padding:11px 13px !important;}
.summary-card small{display:block;color:#64748b;font-size:11px;margin-top:4px;}
.dashboard-grid{min-height:0;overflow:hidden;display:grid;grid-template-columns:1.2fr .8fr;gap:12px;}
.dashboard-panel{min-height:0;overflow:auto;}
.dashboard-panel h2{margin:0 0 12px;}
.mini-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.mini-metrics div,.alert-row{border:1px solid #dbe7f5;border-radius:12px;padding:12px;background:#f8fbff;}
.mini-metrics span,.alert-row span{color:#64748b;font-size:12px;}
.mini-metrics b,.alert-row b{display:block;font-size:20px;margin-top:4px;}
.alert-list{display:grid;gap:10px;}
.alert-row.ok{background:#f0fdf4;border-color:#bbf7d0;}
.alert-row.warn{background:#fffbeb;border-color:#fde68a;}
.alert-row.danger{background:#fef2f2;border-color:#fecaca;}

/* Invoice and collection tab panels */
.report-module-card{height:100% !important;min-height:0 !important;overflow:hidden !important;display:grid !important;grid-template-rows:auto minmax(0,1fr) !important;background:#fff !important;}
.report-module-card .section-head{margin-bottom:10px !important;}
.report-scroll-box{min-height:0 !important;height:100% !important;overflow:hidden !important;display:grid !important;grid-template-rows:minmax(0,1fr) 36px !important;border:1px solid #dbe7f5 !important;border-radius:14px !important;}
.report-scroll{height:auto !important;min-height:0 !important;max-height:none !important;overflow:auto !important;}
.report-table-footer{height:36px !important;min-height:36px !important;}
.report-table{width:max-content !important;min-width:1380px !important;table-layout:auto !important;}
.collections-table{min-width:1120px !important;}
.report-table thead th{position:sticky !important;top:0 !important;z-index:50 !important;background:#102a43 !important;color:#fff !important;}
.report-table tbody td:first-child{position:static !important;}

@media(max-width:1500px){.main-kpis{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}}
@media(max-width:1100px){.reports-fixed{overflow:auto;}.main-kpis{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}.dashboard-grid{grid-template-columns:1fr;}.report-active-panel{min-height:520px;}}
@media(max-width:560px){.main-kpis,.mini-metrics{grid-template-columns:1fr !important;}}


/* V67: Stop Reports layout from breaking Settings and other modules */

/* Default app content should be usable for normal modules */
.content{
  overflow:auto !important;
  min-height:0 !important;
}

/* Fixed-screen behavior applies ONLY to Reports */
.content.reports-content{
  overflow:hidden !important;
  height:100% !important;
  min-height:0 !important;
}

/* Settings/Admin portal must scroll normally and keep its layout */
.content.settings-content{
  overflow:auto !important;
  height:100% !important;
  min-height:0 !important;
}

.settings-layout{
  display:grid !important;
  grid-template-columns:240px minmax(0,1fr) !important;
  gap:16px !important;
  min-height:0 !important;
  height:auto !important;
  overflow:visible !important;
}

.settings-nav{
  position:sticky !important;
  top:0 !important;
  align-self:start !important;
  z-index:2 !important;
}

.settings-pane{
  min-width:0 !important;
  overflow:visible !important;
  padding-bottom:24px !important;
}

.settings-pane .card,
.settings-layout .card{
  overflow:visible !important;
}

/* Reports still uses its own fixed module inside reports-content */
.reports-content .reports-fixed{
  height:100% !important;
  overflow:hidden !important;
}

/* Prevent report-only rules from forcing non-report pages */
.content:not(.reports-content) .reports-fixed{
  height:auto !important;
  overflow:visible !important;
}

@media(max-width:900px){
  .settings-layout{
    grid-template-columns:1fr !important;
  }
  .settings-nav{
    position:static !important;
  }
}


/* V69 Settings/Admin portal repair */
.content.settings-content{
  overflow:auto !important;
  height:100% !important;
  min-height:0 !important;
}

.settings-layout{
  display:grid !important;
  grid-template-columns:240px minmax(0,1fr) !important;
  gap:16px !important;
  height:auto !important;
  min-height:100% !important;
  overflow:visible !important;
}

.settings-nav{
  background:#fff !important;
  border:1px solid #dbe7f5 !important;
  border-radius:16px !important;
  padding:10px !important;
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
  position:sticky !important;
  top:0 !important;
  align-self:start !important;
  z-index:5 !important;
}

.settings-nav button{
  width:100% !important;
  text-align:left !important;
  border:0 !important;
  background:#f8fafc !important;
  color:#102a43 !important;
  border-radius:12px !important;
  padding:11px 12px !important;
  font-weight:800 !important;
}

.settings-nav button.active{
  background:#2563eb !important;
  color:#fff !important;
}

.settings-pane{
  min-width:0 !important;
  overflow:visible !important;
  padding-bottom:24px !important;
}

.settings-pane .card{
  background:#fff !important;
  border:1px solid #dbe7f5 !important;
  border-radius:16px !important;
  padding:16px !important;
  overflow:visible !important;
}

.settings-pane .table-wrap{
  max-height:60vh !important;
  overflow:auto !important;
  border-radius:14px !important;
}

.role-card{
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:12px;
  margin-top:10px;
  background:#f8fbff;
}

@media(max-width:900px){
  .settings-layout{
    grid-template-columns:1fr !important;
  }
  .settings-nav{
    position:static !important;
  }
}


/* V70 Sales cells are plain text, not link-like */
.sales-main .stock-table td,
.sales-main .stock-table td *,
.purchase-table td,
.purchase-table td *{
  cursor:default !important;
}

.sales-main .stock-table button,
.sales-main .stock-table button *,
.purchase-table button,
.purchase-table button *{
  cursor:pointer !important;
}

/* Remove browser/link style from accidental clickable cells */
.clickable-cell,
.stock-table td.clickable-cell,
.stock-table td[onclick],
.stock-table td[role="button"]{
  cursor:default !important;
  color:inherit !important;
  text-decoration:none !important;
}

/* V70 Purchase page proper layout */
.purchase-page{
  height:100%;
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:14px;
}

.purchase-toolbar{
  display:grid !important;
  grid-template-columns:minmax(260px,1fr) auto auto auto !important;
  gap:10px !important;
  align-items:end !important;
  min-height:0 !important;
  height:auto !important;
  padding:14px !important;
}

.purchase-toolbar input{
  height:40px;
}

.purchase-toolbar button{
  height:40px;
  white-space:nowrap;
}

.purchase-search label{
  display:block;
  margin-bottom:5px;
  font-size:12px;
  font-weight:800;
  color:#52637a;
}

.purchase-list-card{
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  padding:16px !important;
}

.purchase-list-card .section-head{
  margin-bottom:12px;
}

.purchase-list-card h2{
  margin:0;
}

.purchase-list-card p{
  margin:4px 0 0;
  color:#64748b;
}

.stock-list-box{
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:minmax(0,1fr) 36px !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  box-shadow:none !important;
}

.stock-list-box .table-scroll{
  min-height:0 !important;
  overflow:auto !important;
}

.purchase-table{
  min-width:1250px !important;
  width:max-content !important;
}

.purchase-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:20 !important;
  background:#102a43 !important;
  color:#fff !important;
}

.stock-list-footer{
  height:36px !important;
  min-height:36px !important;
  padding:8px 12px !important;
  background:#f8fafc !important;
  border-top:1px solid #e2e8f0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  color:#64748b !important;
  font-size:12px !important;
}

/* On smaller screens, the toolbar wraps cleanly */
@media(max-width:1050px){
  .purchase-toolbar{
    grid-template-columns:1fr 1fr !important;
  }
  .purchase-search{
    grid-column:1/-1;
  }
}

@media(max-width:560px){
  .purchase-toolbar{
    grid-template-columns:1fr !important;
  }
}


/* V71 remove clickable/link behavior from Sales stock list */
.sales-main .cell-filter{
  all:unset !important;
  display:inline !important;
  cursor:default !important;
  color:inherit !important;
  text-decoration:none !important;
  font:inherit !important;
  font-weight:inherit !important;
  pointer-events:none !important;
}

.sales-main table.stock-table tbody tr,
.sales-main table.stock-table tbody td,
.sales-main table.stock-table tbody td b,
.sales-main table.stock-table tbody td span,
.sales-main table.stock-table tbody td div{
  cursor:default !important;
  color:inherit !important;
  text-decoration:none !important;
  user-select:text !important;
}

.sales-main table.stock-table tbody tr:hover,
.sales-main table.stock-table tbody tr:hover td{
  background:inherit !important;
}

.sales-main table.stock-table tbody button:not(.cell-filter),
.sales-main table.stock-table tbody button:not(.cell-filter) *{
  cursor:pointer !important;
  user-select:none !important;
}


/* V74 customer balance drill-down */
.balance-link{
  all:unset;
  cursor:pointer;
  font-weight:900;
  display:inline-block;
}

.balance-link:hover{
  text-decoration:underline;
}

.negative-money{
  color:#dc2626 !important;
  font-weight:900 !important;
}

.balance-modal-summary{
  display:grid;
  grid-template-columns:1fr 150px 220px;
  gap:10px;
  margin-bottom:14px;
}

.balance-modal-summary div{
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:12px;
  background:#f8fbff;
  display:grid;
  gap:4px;
}

.balance-modal-summary span{
  color:#64748b;
  font-size:12px;
}

.balance-modal-summary b{
  font-size:18px;
}

.balance-invoice-wrap{
  max-height:52vh;
  overflow:auto;
  border-radius:14px;
}

.balance-invoice-table{
  min-width:1050px;
}

.balance-invoice-table thead th{
  position:sticky;
  top:0;
  z-index:10;
  background:#102a43;
  color:#fff;
}

.balance-invoice-table .row-actions{
  display:flex;
  gap:6px;
  flex-wrap:nowrap;
}

@media(max-width:720px){
  .balance-modal-summary{
    grid-template-columns:1fr;
  }
}


/* V75 Collections filters */
.collections-card.report-module-card{
  grid-template-rows:auto auto auto minmax(0,1fr) !important;
}

.collections-filter-bar{
  display:grid;
  grid-template-columns:1.2fr 1fr .8fr 1fr .9fr auto;
  gap:10px;
  align-items:end;
  margin-bottom:10px;
}

.collections-filter-bar label{
  display:block;
  margin-bottom:4px;
  font-size:12px;
  font-weight:800;
  color:#52637a;
}

.collections-filter-bar input,
.collections-filter-bar select{
  height:38px;
  width:100%;
}

.collection-filter-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.collection-filter-actions button{
  height:38px;
  padding:0 12px !important;
}

.collection-filter-summary{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  background:#f8fbff;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:9px 12px;
  margin-bottom:10px;
  color:#52637a;
  font-size:13px;
}

.collection-filter-summary b{
  color:#0f172a;
}

@media(max-width:1300px){
  .collections-filter-bar{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .collection-filter-actions{
    grid-column:1/-1;
  }
}

@media(max-width:760px){
  .collections-filter-bar{
    grid-template-columns:1fr;
  }

  .collection-filter-summary{
    display:grid;
  }
}


/* V76 professional Collections redesign */
.pro-collections.report-module-card{
  grid-template-rows:auto auto auto minmax(0,1fr) !important;
  gap:12px !important;
  padding:16px !important;
}

.collections-header-pro{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}

.collections-header-pro h2{
  margin:0;
  font-size:24px;
}

.collections-header-pro p{
  margin:6px 0 0;
  color:#64748b;
}

.collections-header-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.collections-header-actions button{
  height:36px;
  padding:0 12px !important;
}

.collection-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.collection-metrics div{
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#f8fbff;
  padding:12px 14px;
}

.collection-metrics span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}

.collection-metrics b{
  font-size:20px;
}

.collections-filter-panel{
  border:1px solid #dbe7f5;
  background:#ffffff;
  border-radius:16px;
  padding:12px;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}

.collections-filter-grid{
  display:grid;
  grid-template-columns:1.25fr 1fr 1fr .95fr .95fr auto;
  gap:10px;
  align-items:end;
}

.collections-filter-grid label{
  display:block;
  margin-bottom:5px;
  font-size:12px;
  font-weight:900;
  color:#334155;
}

.collections-filter-grid input,
.collections-filter-grid select{
  height:40px;
  width:100%;
  border:1px solid #dbe7f5;
  border-radius:10px;
  padding:0 10px;
  background:#fff;
}

.collections-filter-grid input:focus,
.collections-filter-grid select:focus{
  outline:2px solid rgba(37,99,235,.18);
  border-color:#2563eb;
}

.collection-filter-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}

.collection-filter-actions button{
  height:40px;
  white-space:nowrap;
  padding:0 14px !important;
}

.active-filter-line{
  margin-top:10px;
  color:#64748b;
  font-size:12px;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:10px;
  padding:8px 10px;
}

.pro-collections .report-scroll-box{
  border-radius:16px !important;
  overflow:hidden !important;
}

.pro-collections .collections-table{
  min-width:1180px !important;
  width:100% !important;
}

.pro-collections .collections-table th,
.pro-collections .collections-table td{
  padding:13px 14px !important;
}

.pro-collections .collections-table th{
  font-size:12px;
  letter-spacing:.02em;
}

.pro-collections .row-actions{
  display:flex !important;
  gap:8px !important;
  flex-wrap:nowrap !important;
}

@media(max-width:1450px){
  .collections-filter-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .collection-filter-actions{
    justify-content:flex-start;
  }
}

@media(max-width:900px){
  .collections-header-pro{
    display:grid;
  }

  .collections-header-actions{
    justify-content:flex-start;
  }

  .collection-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .collections-filter-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:560px){
  .collection-metrics{
    grid-template-columns:1fr;
  }
}


/* V77 auto filters + returns + stock expenses */
.collection-filter-actions .primary{display:none !important;}

.returns-page{
  height:100%;
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  gap:14px;
}

.returns-help{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px !important;
}

.returns-help h2{margin:0 0 6px}
.returns-help p{margin:0;color:#64748b}

.returns-rules{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.returns-rules span{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.return-invoice-card{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.return-invoice-card div,
.expense-stock-card{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  border-radius:12px;
  padding:10px 12px;
}

.return-invoice-card span,
.expense-stock-card span{
  display:block;
  color:#64748b;
  font-size:12px;
  margin-top:3px;
}

.return-items{
  max-height:38vh;
  overflow:auto;
  border:1px solid #dbe7f5;
  border-radius:14px;
  margin-top:12px;
}

.return-table{
  min-width:850px;
}

.return-table thead th{
  position:sticky;
  top:0;
  background:#102a43;
  color:#fff;
}

.mini-expense-table{
  min-width:650px;
  font-size:12px;
}

.expense-stock-card{
  display:grid;
  gap:4px;
  margin-bottom:12px;
}

.purchase-table .row-actions{
  display:flex;
  gap:6px;
  flex-wrap:nowrap;
}

@media(max-width:900px){
  .returns-help,
  .return-invoice-card{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* V78 Purchase list cleanup: no expense column and no horizontal scroll */
.purchase-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.purchase-table th,
.purchase-table td{
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  padding:11px 12px !important;
}

.purchase-table th:nth-child(1),
.purchase-table td:nth-child(1){width:18% !important;}

.purchase-table th:nth-child(2),
.purchase-table td:nth-child(2){width:10% !important;}

.purchase-table th:nth-child(3),
.purchase-table td:nth-child(3){width:16% !important;}

.purchase-table th:nth-child(4),
.purchase-table td:nth-child(4){width:8% !important;}

.purchase-table th:nth-child(5),
.purchase-table td:nth-child(5){width:10% !important;}

.purchase-table th:nth-child(6),
.purchase-table td:nth-child(6){width:6% !important;}

.purchase-table th:nth-child(7),
.purchase-table td:nth-child(7){width:8% !important;}

.purchase-table th:nth-child(8),
.purchase-table td:nth-child(8){width:8% !important;}

.purchase-table th:nth-child(9),
.purchase-table td:nth-child(9){width:8% !important;}

.purchase-table th:nth-child(10),
.purchase-table td:nth-child(10){width:14% !important;}

.stock-list-box .table-scroll{
  overflow-y:auto !important;
  overflow-x:hidden !important;
}

.purchase-table .row-actions{
  display:flex !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
}

.purchase-table .row-actions button{
  padding:0 10px !important;
  height:32px !important;
}

/* V82 returns workflow repair */
.returns-split{min-height:0;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:14px}
.return-queue-table{min-width:900px}
.exchange-box{border:1px solid #bfdbfe;background:#eff6ff;border-radius:14px;padding:12px;margin:12px 0}
.exchange-box h3{margin:0 0 10px}
.imei-required{min-width:170px}
.return-table{min-width:1100px !important}
.return-table input,.return-table select{height:36px}
@media(max-width:1050px){.returns-split{grid-template-rows:auto auto;overflow:auto}}


/* V83 Returns page cleanup */
.returns-page{
  grid-template-rows:auto minmax(0,1fr) !important;
  gap:12px !important;
}

.returns-help{
  display:none !important;
}

.returns-toolbar{
  display:grid !important;
  grid-template-columns:minmax(320px,1fr) auto !important;
  align-items:end !important;
  min-height:0 !important;
  padding:12px 14px !important;
}

.returns-toolbar-note{
  color:#64748b;
  font-size:13px;
  padding:0 2px 8px;
  max-width:620px;
}

.returns-split{
  grid-template-rows:minmax(210px,.82fr) minmax(210px,1fr) !important;
  gap:12px !important;
}

.returns-page .purchase-list-card{
  padding:14px !important;
}

.returns-page .section-head{
  margin-bottom:8px !important;
}

.returns-page .section-head h2{
  font-size:22px !important;
  margin:0 !important;
}

.returns-page .section-head p{
  margin:4px 0 0 !important;
}

.returns-page .stock-list-box{
  border-radius:12px !important;
}

.returns-page .stock-list-box .table-scroll{
  overflow:auto !important;
}

.returns-page .purchase-table th,
.returns-page .purchase-table td,
.returns-page .return-queue-table th,
.returns-page .return-queue-table td{
  padding:10px 12px !important;
  height:42px !important;
}

.returns-page .return-queue-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.returns-page .return-queue-table th:nth-child(1),
.returns-page .return-queue-table td:nth-child(1){width:11%}
.returns-page .return-queue-table th:nth-child(2),
.returns-page .return-queue-table td:nth-child(2){width:14%}
.returns-page .return-queue-table th:nth-child(3),
.returns-page .return-queue-table td:nth-child(3){width:25%}
.returns-page .return-queue-table th:nth-child(4),
.returns-page .return-queue-table td:nth-child(4){width:16%}
.returns-page .return-queue-table th:nth-child(5),
.returns-page .return-queue-table td:nth-child(5){width:13%}
.returns-page .return-queue-table th:nth-child(6),
.returns-page .return-queue-table td:nth-child(6){width:21%}

.returns-page .return-queue-table .row-actions{
  display:flex !important;
  gap:6px !important;
  flex-wrap:wrap !important;
}

.returns-page .return-queue-table .row-actions button{
  height:30px !important;
  padding:0 8px !important;
  font-size:12px !important;
}

@media(max-width:900px){
  .returns-toolbar{
    grid-template-columns:1fr !important;
  }

  .returns-toolbar-note{
    padding-top:6px;
  }

  .returns-split{
    grid-template-rows:auto auto !important;
  }
}


/* V84 compact returned stock queue + dropdown action */
.returns-page .return-queue-table th,
.returns-page .return-queue-table td{
  padding:6px 10px !important;
  height:34px !important;
  line-height:1.25 !important;
  vertical-align:middle !important;
}

.returns-page .return-queue-table td b{
  line-height:1.2 !important;
}

.returns-page .return-queue-table .muted{
  font-size:11px !important;
  margin-top:2px !important;
  line-height:1.15 !important;
}

.returns-page .status-pill{
  padding:4px 8px !important;
  font-size:11px !important;
}

.return-action-control{
  display:grid !important;
  grid-template-columns:minmax(150px,1fr) auto !important;
  gap:6px !important;
  align-items:center !important;
  max-width:310px;
}

.return-action-control select{
  height:30px !important;
  min-width:0 !important;
  border:1px solid #dbe7f5;
  border-radius:8px;
  padding:0 8px;
  background:#fff;
  font-size:12px;
}

.return-action-control button{
  height:30px !important;
  padding:0 10px !important;
  font-size:12px !important;
}

.returns-page .return-queue-table th:nth-child(1),
.returns-page .return-queue-table td:nth-child(1){width:10% !important;}
.returns-page .return-queue-table th:nth-child(2),
.returns-page .return-queue-table td:nth-child(2){width:13% !important;}
.returns-page .return-queue-table th:nth-child(3),
.returns-page .return-queue-table td:nth-child(3){width:26% !important;}
.returns-page .return-queue-table th:nth-child(4),
.returns-page .return-queue-table td:nth-child(4){width:15% !important;}
.returns-page .return-queue-table th:nth-child(5),
.returns-page .return-queue-table td:nth-child(5){width:12% !important;}
.returns-page .return-queue-table th:nth-child(6),
.returns-page .return-queue-table td:nth-child(6){width:24% !important;}


/* V85 simplified professional return modal */
.return-top-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.return-top-summary div,
.return-panel{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  border-radius:14px;
  padding:12px;
}

.return-top-summary span{
  display:block;
  color:#64748b;
  font-size:12px;
  margin-bottom:4px;
}

.return-top-summary b{
  font-size:16px;
}

.return-main-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.return-panel h3,
.return-item-list h3{
  margin:0 0 10px;
  font-size:16px;
}

.compact-form{
  gap:10px !important;
}

.return-item-list{
  margin-top:12px;
  display:grid;
  gap:8px;
}

.return-item-card{
  display:grid;
  grid-template-columns:42px minmax(190px,1fr) 100px minmax(210px,1fr) 145px;
  gap:10px;
  align-items:center;
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:10px;
  background:#fff;
}

.return-check{
  display:flex;
  justify-content:center;
}

.return-check input{
  width:24px;
  height:24px;
}

.return-phone span{
  display:block;
  color:#64748b;
  font-size:12px;
  margin-top:3px;
}

.return-item-card label{
  display:block;
  font-size:11px;
  font-weight:900;
  color:#52637a;
  margin-bottom:4px;
}

.return-item-card label em{
  color:#dc2626;
  font-style:normal;
}

.return-item-card input{
  height:36px;
  width:100%;
}

.exchange-preview{
  margin-top:10px;
  background:#fff;
  border:1px dashed #bfdbfe;
  border-radius:10px;
  padding:8px 10px;
  font-size:13px;
  color:#475569;
}

.return-receipt h3{
  margin:14px 0 8px;
}

.professional-settlement{
  margin-top:14px;
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:10px;
  background:#f8fbff;
}

.signature-line{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:30px;
  margin-top:36px;
}

.signature-line span{
  border-top:1px solid #0f172a;
  padding-top:8px;
  color:#475569;
}

@media(max-width:980px){
  .return-top-summary{
    grid-template-columns:1fr 1fr;
  }

  .return-item-card{
    grid-template-columns:32px 1fr;
  }

  .return-item-card > div:not(.return-check):not(.return-phone){
    grid-column:2;
  }
}

@media(max-width:620px){
  .return-top-summary{
    grid-template-columns:1fr;
  }
}


/* V86 compact tables globally */
.stock-table th,
.stock-table td,
.report-table th,
.report-table td{
  padding:7px 10px !important;
  height:34px !important;
  min-height:34px !important;
  line-height:1.25 !important;
}

.stock-table .muted,
.report-table .muted{
  font-size:11px !important;
  line-height:1.15 !important;
}

.status-pill,
.customer-type{
  padding:3px 7px !important;
  font-size:11px !important;
}

.small{
  height:30px !important;
  padding:0 9px !important;
  font-size:12px !important;
}

/* Returned stock queue: hide completed and make rows compact */
.returns-page .return-queue-table th,
.returns-page .return-queue-table td{
  padding:5px 9px !important;
  height:32px !important;
}

/* Returns report */
.returns-report-card{
  grid-template-rows:auto auto auto minmax(0,1fr) !important;
  gap:12px !important;
}

.return-report-summary{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  background:#f8fbff;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:9px 12px;
  color:#64748b;
  font-size:13px;
}

.returns-report-table{
  min-width:1350px !important;
}

/* A4 professional document styling */
.a4-doc{
  width:210mm;
  min-height:297mm;
  max-width:100%;
  margin:0 auto;
  background:#fff;
  padding:18mm;
  box-sizing:border-box;
  color:#0f172a;
  font-size:12px;
}

.a4-header{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:flex-start;
  border-bottom:2px solid #0f172a;
  padding-bottom:12px;
  margin-bottom:16px;
}

.a4-header h1{
  margin:0;
  font-size:28px;
}

.a4-header h2{
  margin:0;
  font-size:20px;
  letter-spacing:.03em;
}

.a4-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin:14px 0 16px;
}

.a4-doc h3{
  margin:18px 0 8px;
  font-size:15px;
}

.a4-table,
.a4-doc table{
  width:100%;
  border-collapse:collapse;
  margin-bottom:12px;
}

.a4-table th,
.a4-doc table th{
  background:#102a43 !important;
  color:#fff !important;
  padding:8px 9px !important;
  text-align:left;
  font-size:11px;
}

.a4-table td,
.a4-doc table td{
  border-bottom:1px solid #e2e8f0;
  padding:8px 9px !important;
  vertical-align:top;
  height:auto !important;
  min-height:0 !important;
}

.a4-doc .right{
  text-align:right;
}

.professional-settlement{
  margin-left:auto;
  width:50%;
  min-width:320px;
  background:#f8fbff;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:10px 12px;
}

.professional-settlement div{
  display:flex;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid #e2e8f0;
  padding:7px 0;
}

.professional-settlement div:last-child{
  border-bottom:0;
}

.terms-box{
  margin-top:14px;
  border:1px solid #dbe7f5;
  background:#f8fafc;
  padding:10px 12px;
  border-radius:10px;
  color:#475569;
}

@page{
  size:A4;
  margin:12mm;
}

@media print{
  body *{
    visibility:hidden !important;
  }
  .modal,
  .modal *,
  .a4-doc,
  .a4-doc *{
    visibility:visible !important;
  }
  .modal{
    position:static !important;
    inset:auto !important;
    background:#fff !important;
  }
  .modal-card,
  .modal-body{
    box-shadow:none !important;
    border:0 !important;
    width:auto !important;
    max-width:none !important;
    padding:0 !important;
  }
  .modal-head,
  .modal-foot{
    display:none !important;
  }
  .a4-doc{
    width:auto !important;
    min-height:auto !important;
    padding:0 !important;
    margin:0 !important;
    page-break-after:auto;
  }
}


/* V87 Returns page fixes: compact both tables, search typing, sortable headers */
.returns-page .purchase-table th,
.returns-page .purchase-table td,
.returns-page .return-queue-table th,
.returns-page .return-queue-table td{
  padding:5px 9px !important;
  height:32px !important;
  min-height:32px !important;
  line-height:1.2 !important;
  vertical-align:middle !important;
}

.returns-page .purchase-table td b,
.returns-page .return-queue-table td b{
  line-height:1.15 !important;
}

.returns-page .purchase-table .customer-type,
.returns-page .return-queue-table .status-pill{
  padding:3px 7px !important;
  font-size:10.5px !important;
}

.returns-page .purchase-table button,
.returns-page .return-queue-table button{
  height:28px !important;
  padding:0 8px !important;
  font-size:12px !important;
}

.returns-page .purchase-table thead th[onclick],
.returns-page .return-queue-table thead th[onclick]{
  cursor:pointer !important;
  user-select:none !important;
}

.returns-page .purchase-table thead th[onclick]:hover,
.returns-page .return-queue-table thead th[onclick]:hover{
  background:#173a5c !important;
}

.returns-page .purchase-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.returns-page .purchase-table th:nth-child(1),
.returns-page .purchase-table td:nth-child(1){width:21% !important;}
.returns-page .purchase-table th:nth-child(2),
.returns-page .purchase-table td:nth-child(2){width:12% !important;}
.returns-page .purchase-table th:nth-child(3),
.returns-page .purchase-table td:nth-child(3){width:18% !important;}
.returns-page .purchase-table th:nth-child(4),
.returns-page .purchase-table td:nth-child(4){width:9% !important;}
.returns-page .purchase-table th:nth-child(5),
.returns-page .purchase-table td:nth-child(5){width:11% !important;}
.returns-page .purchase-table th:nth-child(6),
.returns-page .purchase-table td:nth-child(6){width:9% !important;}
.returns-page .purchase-table th:nth-child(7),
.returns-page .purchase-table td:nth-child(7){width:11% !important;}
.returns-page .purchase-table th:nth-child(8),
.returns-page .purchase-table td:nth-child(8){width:9% !important;}

.returns-page .stock-list-box .table-scroll{
  overflow-y:auto !important;
  overflow-x:hidden !important;
}


/* V88 stable typed sorting for Returns tables */
.returns-page th.sortable{
  cursor:pointer !important;
  user-select:none !important;
  position:relative;
}

.returns-page th.sortable:hover{
  background:#173a5c !important;
}

.returns-page th.sortable::after{
  content:'';
  opacity:.65;
}


/* V89 returned phone repair cost workflow */
.expense-stock-card + .form-grid{
  margin-top:12px;
}

.expense-stock-card span b{
  color:#0f172a;
}

.return-action-control select option[value="restock"]{
  font-weight:700;
}


/* V90 columns popup repair */
.modal-card.medium{
  max-width:560px !important;
  width:min(560px,calc(100vw - 32px)) !important;
}

.columns-panel{
  display:grid;
  gap:12px;
}

.columns-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.column-check{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:10px 12px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#f8fbff;
  font-weight:800;
  color:#102a43;
}

.column-check input{
  width:18px;
  height:18px;
}

.column-check span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

@media(max-width:560px){
  .columns-grid{
    grid-template-columns:1fr;
  }
}

/* V90 make cost/profit risk visible */
.stock-table td .cost-warning{
  color:#dc2626;
  font-weight:900;
}


/* V91 search typing and mixed IMEI sales */
.imei-list .empty{
  padding:12px;
  color:#64748b;
  background:#f8fafc;
  border:1px solid #dbe7f5;
  border-radius:10px;
}


/* V93 search fields are passive while typing */
.toolbar{
  grid-template-columns:minmax(280px,1fr) auto auto auto auto !important;
}

.returns-toolbar{
  grid-template-columns:minmax(320px,1fr) auto minmax(260px,auto) !important;
}

.purchase-toolbar{
  grid-template-columns:minmax(260px,1fr) auto auto auto auto !important;
}

@media(max-width:1050px){
  .toolbar,
  .purchase-toolbar,
  .returns-toolbar{
    grid-template-columns:1fr 1fr !important;
  }
  .toolbar input,
  .purchase-search,
  .returns-toolbar .purchase-search{
    grid-column:1/-1;
  }
}


/* V94 search fix: plain inputs, neutral toolbar buttons */
.toolbar .ghost,
.purchase-toolbar .ghost,
.returns-toolbar .ghost{
  background:#fff !important;
  color:#0f172a !important;
  border:1px solid #dbe7f5 !important;
}

.toolbar .ghost:hover,
.purchase-toolbar .ghost:hover,
.returns-toolbar .ghost:hover{
  background:#f8fafc !important;
}

.toolbar input,
.purchase-toolbar input,
.returns-toolbar input{
  pointer-events:auto !important;
  user-select:text !important;
}


/* V95 Sales search final fix: no live search while typing */
.sales-main .toolbar input#search{
  pointer-events:auto !important;
  user-select:text !important;
  -webkit-user-select:text !important;
  cursor:text !important;
  background:#fff !important;
}

/* V95 Sales table: default fits; extra columns get horizontal scrollbar */
.sales-main .stock-list-box{
  min-height:0 !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:minmax(0,1fr) 36px !important;
}

.sales-main .stock-list-box .table-scroll{
  min-height:0 !important;
  overflow-y:auto !important;
}

.sales-main .stock-list-box.default-table-wrap .table-scroll{
  overflow-x:hidden !important;
}

.sales-main .stock-list-box.wide-table-wrap .table-scroll{
  overflow-x:auto !important;
}

.sales-main .stock-table.default-cols{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.sales-main .stock-table.wide-cols{
  width:max-content !important;
  min-width:1350px !important;
  table-layout:auto !important;
}

.sales-main .stock-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:30 !important;
  background:#102a43 !important;
  color:#fff !important;
  white-space:nowrap !important;
}

.sales-main .stock-table.default-cols th,
.sales-main .stock-table.default-cols td{
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.sales-main .stock-table.wide-cols th,
.sales-main .stock-table.wide-cols td{
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  min-width:120px !important;
}

.sales-main .stock-table.wide-cols th:first-child,
.sales-main .stock-table.wide-cols td:first-child{
  min-width:210px !important;
}

.sales-main .stock-table.wide-cols th:last-child,
.sales-main .stock-table.wide-cols td:last-child{
  min-width:150px !important;
}

/* Show horizontal scrollbar clearly for extra columns */
.sales-main .wide-table-wrap .table-scroll::-webkit-scrollbar{
  height:12px;
  width:12px;
}
.sales-main .wide-table-wrap .table-scroll::-webkit-scrollbar-thumb{
  background:#94a3b8;
  border-radius:999px;
}
.sales-main .wide-table-wrap .table-scroll::-webkit-scrollbar-track{
  background:#e2e8f0;
}


/* V96 Sales wide-column fix */
.sales-main .stock-table.wide-cols th:first-child,
.sales-main .stock-table.wide-cols td:first-child,
.stock-table.wide-cols th:first-child,
.stock-table.wide-cols td:first-child{
  position:static !important;
  left:auto !important;
  z-index:auto !important;
}

.sales-main .stock-table.wide-cols thead th:first-child,
.stock-table.wide-cols thead th:first-child{
  position:sticky !important;
  top:0 !important;
  z-index:30 !important;
  background:#102a43 !important;
  color:#fff !important;
}

.sales-main .wide-table-wrap .table-scroll{
  overflow-x:auto !important;
  overflow-y:auto !important;
}

.sales-main .stock-table.wide-cols{
  min-width:1500px !important;
  width:max-content !important;
}

.sales-main .stock-table.wide-cols th,
.sales-main .stock-table.wide-cols td{
  min-width:130px !important;
}

.sales-main .stock-table.wide-cols th:first-child,
.sales-main .stock-table.wide-cols td:first-child{
  min-width:240px !important;
}

/* Search should auto-filter without blocking typing */
.sales-main #search{
  pointer-events:auto !important;
  user-select:text !important;
  cursor:text !important;
}


/* V97 all search boxes: auto-filter without blocking typing */
input[id$="Search"],
#search,
#stockQ,
#returnSearch,
#customerSearch,
#reportSearch,
#collectionCustomerFilter,
#collectionInvoiceFilter,
#collectionMinBalance{
  pointer-events:auto !important;
  user-select:text !important;
  -webkit-user-select:text !important;
  cursor:text !important;
}


/* V98 Purchase unit cost + lot details */
.purchase-table{
  width:100% !important;
  min-width:1180px !important;
  table-layout:auto !important;
}

.purchase-table .row-actions{
  display:flex !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
}

.purchase-table .row-actions button{
  white-space:nowrap !important;
}

.lot-detail-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.lot-detail-summary div{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  border-radius:12px;
  padding:10px 12px;
}

.lot-detail-summary span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:800;
  margin-bottom:4px;
}

.lot-detail-summary b{
  color:#0f172a;
}

.lot-details-grid{
  display:grid;
  gap:16px;
}

.lot-section h3{
  margin:0 0 8px;
}

.lot-table-wrap{
  border:1px solid #dbe7f5;
  border-radius:14px;
  overflow:auto;
  max-height:300px;
}

.lot-phone-table,
.lot-expense-table{
  min-width:980px;
}

.lot-phone-table th,
.lot-phone-table td,
.lot-expense-table th,
.lot-expense-table td{
  padding:7px 10px !important;
  height:34px !important;
}

@media(max-width:900px){
  .lot-detail-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:560px){
  .lot-detail-summary{
    grid-template-columns:1fr;
  }
}


/* V99 suggested prices + compact Purchase price columns */
.price-hint{
  margin-top:4px;
  color:#94a3b8;
  font-size:12px;
  font-weight:700;
}

.purchase-table{
  min-width:1080px !important;
  width:100% !important;
  table-layout:fixed !important;
}

.purchase-table th,
.purchase-table td{
  padding:7px 9px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.purchase-table th:nth-child(1), .purchase-table td:nth-child(1){width:17% !important;}
.purchase-table th:nth-child(2), .purchase-table td:nth-child(2){width:9% !important;}
.purchase-table th:nth-child(3), .purchase-table td:nth-child(3){width:15% !important;}
.purchase-table th:nth-child(4), .purchase-table td:nth-child(4){width:7% !important;}
.purchase-table th:nth-child(5), .purchase-table td:nth-child(5){width:8% !important;}
.purchase-table th:nth-child(6), .purchase-table td:nth-child(6){width:6% !important;}
.purchase-table th:nth-child(7), .purchase-table td:nth-child(7){width:7% !important;}
.purchase-table th:nth-child(8), .purchase-table td:nth-child(8){width:8% !important;}
.purchase-table th:nth-child(9), .purchase-table td:nth-child(9){width:7% !important;}
.purchase-table th:nth-child(10), .purchase-table td:nth-child(10){width:8% !important;}
.purchase-table th:nth-child(11), .purchase-table td:nth-child(11){width:16% !important;}

.purchase-table .row-actions{
  justify-content:flex-start !important;
}


/* V100 price suggestion correction */
.price-cell{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.15;
}

.price-cell span{
  color:#0f172a;
}

.price-cell small{
  color:#94a3b8;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}

.purchase-table th:nth-child(9),
.purchase-table td:nth-child(9),
.purchase-table th:nth-child(10),
.purchase-table td:nth-child(10){
  width:9% !important;
  min-width:105px !important;
}

.purchase-table th:nth-child(11),
.purchase-table td:nth-child(11){
  width:15% !important;
}


/* V101 actual retail/wholesale prices only */
.price-cell small{
  display:none !important;
}

#stRetail[readonly],
#stWholesale[readonly]{
  background:#f8fafc !important;
  color:#0f172a !important;
  font-weight:800;
}


/* V105 Purchase table focuses on inventory + landed cost */
.purchase-table{
  min-width:920px !important;
  width:100% !important;
  table-layout:fixed !important;
}

.purchase-table th:nth-child(1), .purchase-table td:nth-child(1){width:18% !important;}
.purchase-table th:nth-child(2), .purchase-table td:nth-child(2){width:10% !important;}
.purchase-table th:nth-child(3), .purchase-table td:nth-child(3){width:17% !important;}
.purchase-table th:nth-child(4), .purchase-table td:nth-child(4){width:8% !important;}
.purchase-table th:nth-child(5), .purchase-table td:nth-child(5){width:9% !important;}
.purchase-table th:nth-child(6), .purchase-table td:nth-child(6){width:7% !important;}
.purchase-table th:nth-child(7), .purchase-table td:nth-child(7){width:8% !important;}
.purchase-table th:nth-child(8), .purchase-table td:nth-child(8){width:10% !important;}
.purchase-table th:nth-child(9), .purchase-table td:nth-child(9){width:13% !important;}

.purchase-table .row-actions{
  display:flex !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
}


/* V106 Lot Details modal cleanup */
.lot-detail-summary{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

.lot-table-wrap{
  max-height:220px !important;
  overflow:auto !important;
  border:1px solid #dbe7f5 !important;
  border-radius:12px !important;
}

.lot-phone-table,
.lot-expense-table{
  width:100% !important;
  min-width:760px !important;
  table-layout:fixed !important;
}

.lot-phone-table th,
.lot-phone-table td,
.lot-expense-table th,
.lot-expense-table td{
  padding:6px 8px !important;
  height:32px !important;
  line-height:1.2 !important;
  vertical-align:middle !important;
}

.lot-phone-table th:nth-child(1), .lot-phone-table td:nth-child(1){width:5% !important;}
.lot-phone-table th:nth-child(2), .lot-phone-table td:nth-child(2){width:16% !important;}
.lot-phone-table th:nth-child(3), .lot-phone-table td:nth-child(3){width:8% !important;}
.lot-phone-table th:nth-child(4), .lot-phone-table td:nth-child(4){width:11% !important;}
.lot-phone-table th:nth-child(5), .lot-phone-table td:nth-child(5){width:7% !important;}
.lot-phone-table th:nth-child(6), .lot-phone-table td:nth-child(6){width:10% !important;}
.lot-phone-table th:nth-child(7), .lot-phone-table td:nth-child(7){width:16% !important;}
.lot-phone-table th:nth-child(8), .lot-phone-table td:nth-child(8){width:15% !important;}
.lot-phone-table th:nth-child(9), .lot-phone-table td:nth-child(9){width:5% !important;}
.lot-phone-table th:nth-child(10), .lot-phone-table td:nth-child(10){width:7% !important;}

.lot-expense-table{
  min-width:820px !important;
}

.lot-expense-table th:nth-child(6),
.lot-expense-table td:nth-child(6){
  width:30% !important;
  white-space:normal !important;
}

@media(max-width:900px){
  .lot-detail-summary{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


/* V108 Lot Details table polish */
.lot-detail-summary{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

.lot-table-wrap{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-height:240px !important;
}

.lot-phone-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.lot-phone-table th,
.lot-phone-table td{
  padding:7px 9px !important;
  height:34px !important;
  line-height:1.2 !important;
  vertical-align:middle !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.lot-phone-table th:nth-child(1), .lot-phone-table td:nth-child(1){width:5% !important;}
.lot-phone-table th:nth-child(2), .lot-phone-table td:nth-child(2){width:17% !important;}
.lot-phone-table th:nth-child(3), .lot-phone-table td:nth-child(3){width:9% !important;}
.lot-phone-table th:nth-child(4), .lot-phone-table td:nth-child(4){width:12% !important;}
.lot-phone-table th:nth-child(5), .lot-phone-table td:nth-child(5){width:7% !important;}
.lot-phone-table th:nth-child(6), .lot-phone-table td:nth-child(6){width:20% !important;}
.lot-phone-table th:nth-child(7), .lot-phone-table td:nth-child(7){width:15% !important;}
.lot-phone-table th:nth-child(8), .lot-phone-table td:nth-child(8){width:6% !important;text-align:center !important;}
.lot-phone-table th:nth-child(9), .lot-phone-table td:nth-child(9){width:9% !important;}

.lot-subtext{
  display:block;
  font-size:12px;
  color:#334155;
  line-height:1.25;
  white-space:normal;
}

.lot-phone-table .status-pill{
  display:inline-flex !important;
  max-width:100% !important;
  padding:3px 8px !important;
  font-size:11px !important;
  white-space:nowrap !important;
  line-height:1.1 !important;
}

.lot-expense-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.lot-expense-table th,
.lot-expense-table td{
  padding:7px 9px !important;
  height:34px !important;
}

.lot-expense-table th:nth-child(1), .lot-expense-table td:nth-child(1){width:14% !important;}
.lot-expense-table th:nth-child(2), .lot-expense-table td:nth-child(2){width:14% !important;}
.lot-expense-table th:nth-child(3), .lot-expense-table td:nth-child(3){width:14% !important;}
.lot-expense-table th:nth-child(4), .lot-expense-table td:nth-child(4){width:14% !important;}
.lot-expense-table th:nth-child(5), .lot-expense-table td:nth-child(5){width:16% !important;}
.lot-expense-table th:nth-child(6), .lot-expense-table td:nth-child(6){width:28% !important;white-space:normal !important;}

@media(max-width:900px){
  .lot-phone-table,
  .lot-expense-table{
    min-width:760px !important;
  }
}


/* V110 required field marker */
.required{
  color:#dc2626;
  font-weight:900;
}


/* V111 Lot settlement test layer */
.lot-settlement{
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:12px;
  margin:12px 0 16px;
  background:#ffffff;
}

.lot-settlement-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}

.lot-settlement-head h3{
  margin:0;
}

.lot-settlement-head p{
  margin:4px 0 0;
  color:#64748b;
  font-size:13px;
}

.settlement-pill{
  background:#eef6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:999px;
  padding:6px 10px;
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
}

.settlement-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}

.settlement-grid div{
  background:#f8fbff;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:9px 10px;
}

.settlement-grid span{
  display:block;
  color:#64748b;
  font-weight:900;
  font-size:12px;
  margin-bottom:4px;
}

.settlement-grid b{
  display:block;
  font-size:16px;
}

.settlement-grid small{
  color:#64748b;
  display:block;
  margin-top:3px;
  font-size:11px;
}

.negative{
  color:#dc2626 !important;
}

.positive{
  color:#15803d !important;
}

.lot-expense-table th:nth-child(1), .lot-expense-table td:nth-child(1){width:11% !important;}
.lot-expense-table th:nth-child(2), .lot-expense-table td:nth-child(2){width:12% !important;}
.lot-expense-table th:nth-child(3), .lot-expense-table td:nth-child(3){width:17% !important;}
.lot-expense-table th:nth-child(4), .lot-expense-table td:nth-child(4){width:12% !important;}
.lot-expense-table th:nth-child(5), .lot-expense-table td:nth-child(5){width:10% !important;}
.lot-expense-table th:nth-child(6), .lot-expense-table td:nth-child(6){width:12% !important;}
.lot-expense-table th:nth-child(7), .lot-expense-table td:nth-child(7){width:26% !important;white-space:normal !important;}

@media(max-width:900px){
  .settlement-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:560px){
  .settlement-grid{
    grid-template-columns:1fr;
  }
  .lot-settlement-head{
    flex-direction:column;
  }
}


/* V112 separate Settlement view */
.purchase-table th:nth-child(9),
.purchase-table td:nth-child(9){
  width:18% !important;
}

.purchase-table .row-actions{
  flex-wrap:wrap !important;
  gap:6px !important;
}

.settlement-clean{
  display:grid;
  gap:14px;
}

.settlement-title-card{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#f8fbff;
}

.settlement-title-card span,
.settlement-clean-grid span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  margin-bottom:4px;
}

.settlement-title-card b{
  display:block;
  font-size:18px;
}

.settlement-title-card small,
.settlement-clean-grid small{
  display:block;
  color:#64748b;
  margin-top:4px;
  font-size:12px;
}

.settlement-status{
  background:#eef6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:999px;
  padding:7px 12px;
  font-weight:900;
  white-space:nowrap;
}

.settlement-section{
  border:1px solid #dbe7f5;
  border-radius:14px;
  padding:12px;
  background:#ffffff;
}

.settlement-section h3{
  margin:0;
}

.settlement-section p{
  margin:4px 0 10px;
  color:#64748b;
  font-size:13px;
}

.settlement-clean-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.settlement-clean-grid div{
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#f8fbff;
  padding:10px 12px;
}

.settlement-clean-grid b{
  display:block;
  font-size:18px;
}

.neutral-loss{
  color:#475569 !important;
}

.settlement-note{
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
}

@media(max-width:900px){
  .settlement-clean-grid{
    grid-template-columns:1fr;
  }

  .settlement-title-card{
    flex-direction:column;
  }
}


/* V113 Add Lots workspace */
.add-lots-page .panel-head{
  align-items:flex-start;
}

.lot-blueprint{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:14px 0;
}

.blueprint-card{
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#f8fbff;
  padding:14px;
}

.blueprint-card h3{
  margin:0 0 6px;
  font-size:15px;
}

.blueprint-card p{
  margin:0;
  color:#64748b;
  font-size:13px;
  line-height:1.35;
}

@media(max-width:1100px){
  .lot-blueprint{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:640px){
  .lot-blueprint{
    grid-template-columns:1fr;
  }
}


/* V114 Add Lots page cleanup + import */
.add-lots-page{
  max-width:100% !important;
}

.add-lots-page .panel-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:12px;
}

.lot-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.lot-import-help{
  background:#eef6ff;
  border:1px solid #bfdbfe;
  color:#1e3a8a;
  border-radius:12px;
  padding:10px 12px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin:10px 0 14px;
  font-size:13px;
}

.lot-blueprint.compact{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin:10px 0 14px;
}

.lot-blueprint.compact .blueprint-card{
  padding:12px;
}

.lot-draft-table-wrap{
  width:100%;
  overflow-x:auto;
  border-radius:14px;
}

.lot-draft-table{
  width:100% !important;
  min-width:1050px;
  table-layout:fixed;
}

.lot-draft-table th,
.lot-draft-table td{
  padding:9px 10px;
  vertical-align:middle;
}

.lot-draft-table th:nth-child(1), .lot-draft-table td:nth-child(1){width:13%;}
.lot-draft-table th:nth-child(2), .lot-draft-table td:nth-child(2){width:13%;}
.lot-draft-table th:nth-child(3), .lot-draft-table td:nth-child(3){width:24%;}
.lot-draft-table th:nth-child(4), .lot-draft-table td:nth-child(4){width:7%;text-align:center;}
.lot-draft-table th:nth-child(5), .lot-draft-table td:nth-child(5){width:11%;}
.lot-draft-table th:nth-child(6), .lot-draft-table td:nth-child(6){width:12%;}
.lot-draft-table th:nth-child(7), .lot-draft-table td:nth-child(7){width:12%;}
.lot-draft-table th:nth-child(8), .lot-draft-table td:nth-child(8){width:8%;}
.lot-draft-table th:nth-child(9), .lot-draft-table td:nth-child(9){width:8%;}

@media(max-width:900px){
  .add-lots-page .panel-head{
    flex-direction:column;
  }
  .lot-actions{
    justify-content:flex-start;
  }
}


/* V115 Add Lots import/table fix */
.lot-draft-table{
  min-width:1350px !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  line-height:1.25 !important;
}

.lot-draft-table th:nth-child(1), .lot-draft-table td:nth-child(1){width:11% !important;}
.lot-draft-table th:nth-child(2), .lot-draft-table td:nth-child(2){width:10% !important;}
.lot-draft-table th:nth-child(3), .lot-draft-table td:nth-child(3){width:31% !important;}
.lot-draft-table th:nth-child(4), .lot-draft-table td:nth-child(4){width:6% !important;text-align:center !important;}
.lot-draft-table th:nth-child(5), .lot-draft-table td:nth-child(5){width:10% !important;text-align:right !important;}
.lot-draft-table th:nth-child(6), .lot-draft-table td:nth-child(6){width:10% !important;text-align:right !important;}
.lot-draft-table th:nth-child(7), .lot-draft-table td:nth-child(7){width:11% !important;text-align:right !important;}
.lot-draft-table th:nth-child(8), .lot-draft-table td:nth-child(8){width:8% !important;text-align:center !important;}
.lot-draft-table th:nth-child(9), .lot-draft-table td:nth-child(9){width:7% !important;text-align:center !important;}

.lot-desc-cell{
  white-space:normal !important;
  word-break:break-word !important;
}

.lot-qty-cell{
  font-size:15px !important;
  text-align:center !important;
}

.lot-draft-table-wrap{
  overflow-x:auto !important;
}


/* V116 Add Lots clear/import correction */
.danger-soft{
  color:#b91c1c !important;
  border-color:#fecaca !important;
  background:#fff7f7 !important;
}
.danger-soft:hover{
  background:#fee2e2 !important;
}


/* V117 Add Lots Unit Cost + Edit */
.lot-draft-table{
  min-width:1450px !important;
}

.lot-draft-table th:nth-child(1), .lot-draft-table td:nth-child(1){width:11% !important;}
.lot-draft-table th:nth-child(2), .lot-draft-table td:nth-child(2){width:9% !important;}
.lot-draft-table th:nth-child(3), .lot-draft-table td:nth-child(3){width:29% !important;}
.lot-draft-table th:nth-child(4), .lot-draft-table td:nth-child(4){width:5% !important;text-align:center !important;}
.lot-draft-table th:nth-child(5), .lot-draft-table td:nth-child(5){width:10% !important;text-align:right !important;}
.lot-draft-table th:nth-child(6), .lot-draft-table td:nth-child(6){width:10% !important;text-align:right !important;}
.lot-draft-table th:nth-child(7), .lot-draft-table td:nth-child(7){width:10% !important;text-align:right !important;}
.lot-draft-table th:nth-child(8), .lot-draft-table td:nth-child(8){width:9% !important;text-align:right !important;}
.lot-draft-table th:nth-child(9), .lot-draft-table td:nth-child(9){width:8% !important;text-align:center !important;}
.lot-draft-table th:nth-child(10), .lot-draft-table td:nth-child(10){width:9% !important;text-align:center !important;}

.lot-draft-table .row-actions{
  justify-content:center;
  flex-wrap:wrap;
  gap:6px;
}


/* V118 Add Lots columns + scrollbar */
.lot-table-shell{
  width:100%;
  border:1px solid #dbe7f5;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}

.lot-draft-table-wrap{
  width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  border-radius:0 !important;
  padding-bottom:6px;
}

.lot-draft-table-wrap::-webkit-scrollbar{
  height:12px;
}

.lot-draft-table{
  width:max-content !important;
  min-width:100% !important;
  table-layout:auto !important;
  border-radius:0 !important;
}

.lot-draft-table th,
.lot-draft-table td{
  white-space:normal !important;
  vertical-align:middle !important;
  line-height:1.25 !important;
  padding:10px 12px !important;
}

.lot-draft-table .lot-col-lotNo{min-width:150px;}
.lot-draft-table .lot-col-supplier{min-width:120px;}
.lot-draft-table .lot-col-description{min-width:430px;max-width:520px;}
.lot-draft-table .lot-col-qty{min-width:70px;text-align:center !important;}
.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance,
.lot-draft-table .lot-col-totalLanded,
.lot-draft-table .lot-col-unitCost,
.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  min-width:130px;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{min-width:130px;text-align:center !important;}
.lot-draft-table .lot-col-actions{min-width:150px;text-align:center !important;}
.lot-draft-table .lot-col-notes{min-width:260px;max-width:360px;}
.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{min-width:110px;}

.columns-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.checkline{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:10px;
  background:#fff;
  font-weight:800;
}

.checkline.locked{
  background:#f8fbff;
  color:#475569;
}

.checkline small{
  color:#64748b;
  font-weight:700;
}

@media(max-width:800px){
  .columns-grid{
    grid-template-columns:1fr;
  }
}


/* V119 confine Add Lots horizontal scroll to table only */
html,
body,
#app{
  max-width:100% !important;
  overflow-x:hidden !important;
}

.app,
.main,
.content,
.add-lots-page{
  min-width:0 !important;
  max-width:100% !important;
  overflow-x:hidden !important;
}

.add-lots-page .panel-head,
.lot-import-help,
.lot-blueprint,
.lot-blueprint.compact{
  max-width:100% !important;
  overflow-x:hidden !important;
}

.lot-table-shell{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.lot-draft-table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  overscroll-behavior-x:contain !important;
  box-sizing:border-box !important;
  padding-bottom:10px !important;
}

.lot-draft-table{
  width:max-content !important;
  min-width:1180px !important;
  max-width:none !important;
}

.lot-draft-table-wrap::-webkit-scrollbar{
  height:12px;
}

.lot-draft-table-wrap::-webkit-scrollbar-track{
  background:#eef2f7;
  border-radius:999px;
}

.lot-draft-table-wrap::-webkit-scrollbar-thumb{
  background:#94a3b8;
  border-radius:999px;
}

.lot-draft-table-wrap::-webkit-scrollbar-thumb:hover{
  background:#64748b;
}


/* V120 Add Lots focused workflow */
.add-lots-page .lot-blueprint,
.add-lots-page .blueprint-card{
  display:none !important;
}

.lot-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:12px 0;
}

.lot-toolbar input{
  width:min(680px,100%);
  height:42px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  padding:0 12px;
  font-size:14px;
  background:#fff;
}

.lot-import-help{
  justify-content:flex-start !important;
  margin:8px 0 12px !important;
}

.lot-draft-table .lot-col-actions{
  min-width:220px !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  justify-content:center;
  flex-wrap:wrap;
  gap:6px;
}

@media(max-width:900px){
  .lot-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
}


/* V121 Add Lots column selector cleanup */
.add-lots-page .danger-soft[onclick*="clearLotDrafts"]{
  display:none !important;
}

.columns-grid .checkline{
  justify-content:flex-start !important;
}

.columns-grid .checkline input{
  flex:0 0 auto;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  gap:6px !important;
}

.lot-draft-table .lot-col-actions{
  min-width:260px !important;
}


/* V122 Add Lots auto-fit table sizing */
.lot-draft-table-wrap{
  overflow-x:auto !important;
  max-width:100% !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  padding:8px 10px !important;
  line-height:1.25 !important;
  vertical-align:middle !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.lot-draft-table .lot-col-lotNo{
  width:10% !important;
  min-width:0 !important;
}

.lot-draft-table .lot-col-supplier{
  width:8% !important;
  min-width:0 !important;
}

.lot-draft-table .lot-col-description{
  width:31% !important;
  min-width:0 !important;
  max-width:none !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
}

.lot-draft-table .lot-col-qty{
  width:5% !important;
  min-width:0 !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance,
.lot-draft-table .lot-col-totalLanded,
.lot-draft-table .lot-col-unitCost{
  width:9% !important;
  min-width:0 !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:9% !important;
  min-width:0 !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:10% !important;
  min-width:0 !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:center !important;
  gap:5px !important;
}

.lot-draft-table .lot-col-actions button{
  width:100% !important;
  padding:6px 7px !important;
  font-size:12px !important;
}

.lot-draft-table .status-pill{
  max-width:100% !important;
  white-space:normal !important;
  line-height:1.1 !important;
  padding:4px 7px !important;
}

/* When optional columns are enabled, allow local table scrolling only */
.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  min-width:1300px !important;
  table-layout:auto !important;
}

@supports not selector(:has(*)){
  .lot-draft-table{
    width:100% !important;
  }
}

@media(max-width:1200px){
  .lot-draft-table{
    min-width:1100px !important;
  }
}


/* V123 Add Lots compact column sizing */
.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  padding:6px 8px !important;
  height:34px !important;
  line-height:1.15 !important;
  font-size:12px !important;
  vertical-align:middle !important;
}

.lot-draft-table th{
  white-space:nowrap !important;
  letter-spacing:.02em !important;
}

.lot-draft-table .lot-col-lotNo{
  width:10% !important;
}

.lot-draft-table .lot-col-supplier{
  width:7% !important;
}

.lot-draft-table .lot-col-description{
  width:36% !important;
  white-space:normal !important;
  overflow:hidden !important;
  display:table-cell !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  line-height:1.2 !important;
}

.lot-draft-table .lot-col-qty{
  width:4% !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-usCost{
  width:7.5% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-partnerAdvance{
  width:7.5% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:7.5% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:6.5% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:8% !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:6% !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  gap:3px !important;
}

.lot-draft-table .lot-col-actions button{
  width:100% !important;
  padding:4px 5px !important;
  font-size:11px !important;
  min-height:24px !important;
}

.lot-draft-table .status-pill{
  font-size:10.5px !important;
  padding:3px 6px !important;
  line-height:1.05 !important;
  white-space:normal !important;
}

.lot-draft-table b{
  font-size:12px !important;
}

/* Optional columns still scroll locally if user turns on many columns */
.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  min-width:1180px !important;
  table-layout:fixed !important;
}

.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  width:8% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-notes{
  width:16% !important;
  white-space:normal !important;
}

.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{
  width:8% !important;
}


/* V124 Add Lots requested headers + inline actions */
.lot-draft-table .lot-col-usCost{
  width:8% !important;
}

.lot-draft-table .lot-col-partnerAdvance{
  width:8.5% !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:7% !important;
}

.lot-draft-table .lot-col-unitCost{
  width:6% !important;
}

.lot-draft-table .lot-col-actions{
  width:13% !important;
  min-width:185px !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:4px !important;
}

.lot-draft-table .lot-col-actions button{
  width:auto !important;
  min-width:0 !important;
  height:24px !important;
  min-height:24px !important;
  padding:3px 6px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:32px !important;
  padding-top:5px !important;
  padding-bottom:5px !important;
}


/* V125 Add Lots proper compact table + local bottom scrollbar */
.add-lots-page,
.add-lots-page .panel-head,
.lot-toolbar,
.lot-import-help{
  max-width:100% !important;
  overflow-x:hidden !important;
}

.lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  background:#fff !important;
}

.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:scroll !important;
  overflow-y:hidden !important;
  padding-bottom:10px !important;
  box-sizing:border-box !important;
  border-radius:0 !important;
}

.lot-draft-table-wrap::-webkit-scrollbar{
  height:12px !important;
}

.lot-draft-table-wrap::-webkit-scrollbar-track{
  background:#eef2f7 !important;
  border-radius:999px !important;
}

.lot-draft-table-wrap::-webkit-scrollbar-thumb{
  background:#94a3b8 !important;
  border-radius:999px !important;
}

.lot-draft-table{
  width:max-content !important;
  min-width:1420px !important;
  max-width:none !important;
  table-layout:fixed !important;
  border-radius:0 !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:5px 7px !important;
  font-size:12px !important;
  line-height:1.12 !important;
  vertical-align:middle !important;
  overflow:hidden !important;
}

.lot-draft-table th{
  white-space:nowrap !important;
  text-overflow:ellipsis !important;
}

.lot-draft-table .lot-col-lotNo{width:105px !important;min-width:105px !important;}
.lot-draft-table .lot-col-supplier{width:90px !important;min-width:90px !important;}
.lot-draft-table .lot-col-description{width:315px !important;min-width:315px !important;}
.lot-draft-table .lot-col-qty{width:48px !important;min-width:48px !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance,
.lot-draft-table .lot-col-totalLanded,
.lot-draft-table .lot-col-unitCost,
.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  width:86px !important;
  min-width:86px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:88px !important;
  min-width:88px !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-notes{
  width:140px !important;
  min-width:140px !important;
}

.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{
  width:82px !important;
  min-width:82px !important;
}

.lot-draft-table .lot-col-actions{
  width:190px !important;
  min-width:190px !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.15 !important;
}

.lot-draft-table .status-pill{
  font-size:10px !important;
  padding:3px 5px !important;
  line-height:1.05 !important;
  white-space:normal !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:4px !important;
}

.lot-draft-table .lot-col-actions button{
  width:auto !important;
  min-width:auto !important;
  height:23px !important;
  min-height:23px !important;
  padding:3px 6px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}


/* V126 Add Lots scroll containment + default auto width */
html,
body,
#app{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
}

.app,
.main,
.content,
.panel,
.add-lots-page{
  min-width:0 !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  box-sizing:border-box !important;
}

.lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  background:#fff !important;
}

.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  box-sizing:border-box !important;
  padding-bottom:10px !important;
  border-radius:0 !important;
  overscroll-behavior-x:contain !important;
}

.lot-draft-table-wrap::-webkit-scrollbar{
  height:12px !important;
}

.lot-draft-table-wrap::-webkit-scrollbar-track{
  background:#eef2f7 !important;
  border-radius:999px !important;
}

.lot-draft-table-wrap::-webkit-scrollbar-thumb{
  background:#94a3b8 !important;
  border-radius:999px !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
  border-radius:0 !important;
}

.lot-draft-table th,
.lot-draft-table td{
  box-sizing:border-box !important;
  height:30px !important;
  padding:5px 7px !important;
  font-size:12px !important;
  line-height:1.12 !important;
  vertical-align:middle !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-lotNo{width:9% !important;min-width:0 !important;}
.lot-draft-table .lot-col-supplier{width:7% !important;min-width:0 !important;}
.lot-draft-table .lot-col-description{width:31% !important;min-width:0 !important;}
.lot-draft-table .lot-col-qty{width:4% !important;min-width:0 !important;text-align:center !important;}
.lot-draft-table .lot-col-usCost{width:8% !important;min-width:0 !important;text-align:right !important;white-space:nowrap !important;}
.lot-draft-table .lot-col-partnerAdvance{width:8% !important;min-width:0 !important;text-align:right !important;white-space:nowrap !important;}
.lot-draft-table .lot-col-totalLanded{width:8% !important;min-width:0 !important;text-align:right !important;white-space:nowrap !important;}
.lot-draft-table .lot-col-unitCost{width:7% !important;min-width:0 !important;text-align:right !important;white-space:nowrap !important;}
.lot-draft-table .lot-col-status{width:8% !important;min-width:0 !important;text-align:center !important;}
.lot-draft-table .lot-col-actions{width:10% !important;min-width:0 !important;text-align:center !important;overflow:visible !important;}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.15 !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:3px !important;
}

.lot-draft-table .lot-col-actions button{
  width:auto !important;
  min-width:0 !important;
  height:23px !important;
  min-height:23px !important;
  padding:3px 5px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.lot-draft-table .status-pill{
  font-size:10px !important;
  padding:3px 5px !important;
  line-height:1.05 !important;
  white-space:normal !important;
}

/* When extra optional columns are enabled, only the table gets horizontal scroll */
.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1360px !important;
  max-width:none !important;
}

.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  width:82px !important;
  min-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-notes{
  width:150px !important;
  min-width:150px !important;
}

.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{
  width:82px !important;
  min-width:82px !important;
}


/* V127 Add Lots list scrolls inside its own window */
.add-lots-page{
  height:calc(100vh - 92px) !important;
  max-height:calc(100vh - 92px) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.add-lots-page .panel-head,
.add-lots-page .lot-toolbar,
.add-lots-page .lot-import-help{
  flex:0 0 auto !important;
}

.lot-table-shell{
  flex:1 1 auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.lot-draft-table-wrap{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:100% !important;
  max-height:100% !important;
  overflow:auto !important;
  padding-bottom:10px !important;
}

.lot-draft-table thead th{
  position:sticky !important;
  top:0 !important;
  z-index:5 !important;
}

.main,
.content{
  overflow:hidden !important;
}

body{
  overflow:hidden !important;
}


/* V128 Add Lots column width adjustment */
.lot-draft-table .lot-col-usCost{
  width:6.5% !important;
  min-width:0 !important;
}

.lot-draft-table .lot-col-partnerAdvance{
  width:6.8% !important;
  min-width:0 !important;
}

.lot-draft-table .lot-col-unitCost{
  width:5.8% !important;
  min-width:0 !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:7.4% !important;
}

.lot-draft-table .lot-col-actions{
  width:14.5% !important;
  min-width:215px !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  gap:5px !important;
}

.lot-draft-table .lot-col-actions button{
  padding:4px 7px !important;
  font-size:10.5px !important;
}


/* V129 Add Lots final fixed-width table columns */
.lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  padding-bottom:10px !important;
}

.lot-draft-table{
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:5px 6px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  vertical-align:middle !important;
  box-sizing:border-box !important;
}

.lot-draft-table .lot-col-lotNo{width:120px !important;min-width:120px !important;max-width:120px !important;}
.lot-draft-table .lot-col-supplier{width:85px !important;min-width:85px !important;max-width:85px !important;}
.lot-draft-table .lot-col-description{width:410px !important;min-width:410px !important;max-width:410px !important;}
.lot-draft-table .lot-col-qty{width:50px !important;min-width:50px !important;max-width:50px !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost{
  width:92px !important;
  min-width:92px !important;
  max-width:92px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-partnerAdvance{
  width:92px !important;
  min-width:92px !important;
  max-width:92px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:95px !important;
  min-width:95px !important;
  max-width:95px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:105px !important;
  min-width:105px !important;
  max-width:105px !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:260px !important;
  min-width:260px !important;
  max-width:260px !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.15 !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
}

.lot-draft-table .lot-col-actions button{
  width:auto !important;
  min-width:auto !important;
  height:24px !important;
  min-height:24px !important;
  padding:4px 8px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
}

.lot-draft-table .lot-col-actions button.primary,
.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  min-width:94px !important;
}

/* Optional columns stay compact */
.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-notes{
  width:150px !important;
  min-width:150px !important;
  max-width:150px !important;
}

.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
}


/* V130 Add Lots action buttons alignment */
.lot-draft-table .lot-col-actions{
  width:210px !important;
  min-width:210px !important;
  max-width:210px !important;
  padding-left:6px !important;
  padding-right:6px !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:grid !important;
  grid-template-columns:88px 38px 50px !important;
  justify-content:center !important;
  align-items:center !important;
  column-gap:5px !important;
  width:100% !important;
  margin:0 auto !important;
}

.lot-draft-table .lot-col-actions button{
  height:24px !important;
  min-height:24px !important;
  padding:3px 5px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:88px !important;
  min-width:88px !important;
  max-width:88px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:38px !important;
  min-width:38px !important;
  max-width:38px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
}


/* V131 Add Lots meaningful statuses */
.lot-draft-table .status-pill{
  font-weight:900 !important;
}

.lot-draft-table .lot-status-imported-draft,
.lot-draft-table .lot-status-draft,
.lot-draft-table .lot-status-pending-receive{
  background:#fff7ed !important;
  color:#9a3412 !important;
}

.lot-draft-table .lot-status-partially-received{
  background:#eff6ff !important;
  color:#1d4ed8 !important;
}

.lot-draft-table .lot-status-received{
  background:#dcfce7 !important;
  color:#166534 !important;
}


/* V132 Add Lots professional spacing */
.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:5px 6px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  vertical-align:middle !important;
  box-sizing:border-box !important;
}

.lot-draft-table .lot-col-lotNo{width:9% !important;}
.lot-draft-table .lot-col-supplier{
  width:9% !important;
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
}
.lot-draft-table .lot-col-description{width:30% !important;}
.lot-draft-table .lot-col-qty{width:4% !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance,
.lot-draft-table .lot-col-totalLanded{
  width:7.2% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:6.4% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:8.2% !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:12.8% !important;
  min-width:205px !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:grid !important;
  grid-template-columns:92px 38px 50px !important;
  justify-content:center !important;
  align-items:center !important;
  gap:5px !important;
  width:100% !important;
}

.lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:3px 5px !important;
  font-size:10.25px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:92px !important;
  min-width:92px !important;
  max-width:92px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:38px !important;
  min-width:38px !important;
  max-width:38px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
}

.lot-draft-table .status-pill{
  font-size:10px !important;
  padding:3px 5px !important;
  line-height:1.05 !important;
  white-space:normal !important;
  max-width:100% !important;
}

.lot-draft-table .lot-status-imported-draft,
.lot-draft-table .lot-status-draft,
.lot-draft-table .lot-status-pending-receive,
.lot-draft-table .lot-status-ready-to-receive{
  background:#eef6ff !important;
  color:#1d4ed8 !important;
}


/* V133 Add Lots compact cost columns + wider action column */
.lot-draft-table-wrap{
  width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  padding:4px 6px !important;
  height:28px !important;
  font-size:12px !important;
  line-height:1.08 !important;
}

.lot-draft-table .lot-col-lotNo{width:10% !important;}
.lot-draft-table .lot-col-supplier{width:8.5% !important;}
.lot-draft-table .lot-col-description{width:25.5% !important;}
.lot-draft-table .lot-col-qty{width:4.5% !important; text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:7.1% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{width:7.2% !important; text-align:right !important; white-space:nowrap !important;}
.lot-draft-table .lot-col-unitCost{width:5.7% !important; text-align:right !important; white-space:nowrap !important;}
.lot-draft-table .lot-col-status{width:8.0% !important; text-align:center !important;}

.lot-draft-table .lot-col-actions{
  width:16.5% !important;
  min-width:225px !important;
  max-width:none !important;
  padding-left:4px !important;
  padding-right:4px !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:4px !important;
  width:100% !important;
  margin:0 auto !important;
}

.lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:2px 6px !important;
  font-size:10.25px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:98px !important;
  min-width:98px !important;
  max-width:98px !important;
}
.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:38px !important;
  min-width:38px !important;
  max-width:38px !important;
}
.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:48px !important;
  min-width:48px !important;
  max-width:48px !important;
}

.lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  max-width:100% !important;
  font-size:10px !important;
  padding:3px 6px !important;
}


/* V134 Add Lots fixed column widths - no overlap */
.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:1320px !important;
  max-width:none !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:5px 6px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-lotNo{
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
}

.lot-draft-table .lot-col-supplier{
  width:105px !important;
  min-width:105px !important;
  max-width:105px !important;
}

.lot-draft-table .lot-col-description{
  width:430px !important;
  min-width:430px !important;
  max-width:430px !important;
}

.lot-draft-table .lot-col-qty{
  width:48px !important;
  min-width:48px !important;
  max-width:48px !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:88px !important;
  min-width:88px !important;
  max-width:88px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:72px !important;
  min-width:72px !important;
  max-width:72px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:255px !important;
  min-width:255px !important;
  max-width:255px !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  width:100% !important;
}

.lot-draft-table .lot-col-actions button{
  height:24px !important;
  min-height:24px !important;
  padding:3px 7px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:104px !important;
  min-width:104px !important;
  max-width:104px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}


/* V135 Add Lots no-overlap final table layout */
.lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  padding-bottom:10px !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:5px 6px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  vertical-align:middle !important;
}

/* Default visible columns: totals add up to 100%, so no broken right edge */
.lot-draft-table .lot-col-lotNo{width:10% !important;min-width:0 !important;max-width:none !important;}
.lot-draft-table .lot-col-supplier{width:8% !important;min-width:0 !important;max-width:none !important;}
.lot-draft-table .lot-col-description{width:30% !important;min-width:0 !important;max-width:none !important;}
.lot-draft-table .lot-col-qty{width:4% !important;min-width:0 !important;max-width:none !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:7% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:7.5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:6% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:5.5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions{
  width:15% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.15 !important;
}

.lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  max-width:100% !important;
  padding:3px 6px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-status-imported-draft,
.lot-draft-table .lot-status-draft,
.lot-draft-table .lot-status-pending-receive,
.lot-draft-table .lot-status-ready-to-receive,
.lot-draft-table .lot-status-ready{
  background:#eef6ff !important;
  color:#1d4ed8 !important;
}

/* Three action buttons in one clean row */
.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:5px !important;
  width:100% !important;
  margin:0 auto !important;
}

.lot-draft-table .lot-col-actions button{
  height:24px !important;
  min-height:24px !important;
  padding:3px 6px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:96px !important;
  min-width:96px !important;
  max-width:96px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:38px !important;
  min-width:38px !important;
  max-width:38px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
}

/* Optional columns: local table scroll only */
.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}

.lot-draft-table .lot-col-stockPurchase,
.lot-draft-table .lot-col-usDomestic,
.lot-draft-table .lot-col-usToDubai,
.lot-draft-table .lot-col-dubaiFees,
.lot-draft-table .lot-col-kabulDelivery{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-notes{
  width:150px !important;
  min-width:150px !important;
  max-width:150px !important;
}

.lot-draft-table .lot-col-createdAt,
.lot-draft-table .lot-col-updatedAt{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
}


/* V136 Add Lots default view fits page - Action visible without horizontal scroll */
.lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  padding-bottom:0 !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:4px 5px !important;
  font-size:11.5px !important;
  line-height:1.08 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  vertical-align:middle !important;
}

.lot-draft-table th{
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-lotNo{
  width:8.5% !important;
  min-width:0 !important;
  max-width:none !important;
}

.lot-draft-table .lot-col-supplier{
  width:6.5% !important;
  min-width:0 !important;
  max-width:none !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}

.lot-draft-table .lot-col-description{
  width:26% !important;
  min-width:0 !important;
  max-width:none !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.12 !important;
}

.lot-draft-table .lot-col-qty{
  width:3.5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:6.4% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:6.8% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:5.5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:5.3% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:25.1% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  max-width:100% !important;
  padding:3px 5px !important;
  font-size:9.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:6px !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
}

.lot-draft-table .lot-col-actions button{
  height:24px !important;
  min-height:24px !important;
  padding:3px 8px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
  text-overflow:clip !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:106px !important;
  min-width:106px !important;
  max-width:106px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}

/* If optional columns are turned on, only then allow local table horizontal scroll */
.lot-draft-table-wrap:has(.lot-col-stockPurchase),
.lot-draft-table-wrap:has(.lot-col-usDomestic),
.lot-draft-table-wrap:has(.lot-col-usToDubai),
.lot-draft-table-wrap:has(.lot-col-dubaiFees),
.lot-draft-table-wrap:has(.lot-col-kabulDelivery),
.lot-draft-table-wrap:has(.lot-col-notes),
.lot-draft-table-wrap:has(.lot-col-createdAt),
.lot-draft-table-wrap:has(.lot-col-updatedAt){
  overflow-x:auto !important;
}

.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}


/* V137 Add Lots: shrink cost columns, double Action space */
.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:30px !important;
  padding:4px 5px !important;
  font-size:11.25px !important;
  line-height:1.05 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  vertical-align:middle !important;
}

.lot-draft-table .lot-col-lotNo{width:8% !important;}
.lot-draft-table .lot-col-supplier{width:6% !important;}
.lot-draft-table .lot-col-description{width:25% !important;}
.lot-draft-table .lot-col-qty{width:3.5% !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:5.2% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:5.5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:4.8% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:5% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
}

.lot-draft-table .lot-col-actions{
  width:31.8% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
  overflow:visible !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:8px !important;
  width:100% !important;
}

.lot-draft-table .lot-col-actions button{
  height:24px !important;
  min-height:24px !important;
  padding:3px 8px !important;
  font-size:10.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:118px !important;
  min-width:118px !important;
  max-width:118px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:46px !important;
  min-width:46px !important;
  max-width:46px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:62px !important;
  min-width:62px !important;
  max-width:62px !important;
}

.lot-draft-table .status-pill{
  font-size:9.5px !important;
  padding:3px 5px !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
}


/* V138 Add Lots hard layout correction: no Status/Action overlap */
.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
}

.lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
}

.lot-draft-table th,
.lot-draft-table td{
  height:28px !important;
  padding:4px 5px !important;
  font-size:11px !important;
  line-height:1.05 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  vertical-align:middle !important;
}

/* Width budget = 100%. Action gets real space. Cost columns are compact. */
.lot-draft-table .lot-col-lotNo{width:8% !important;}
.lot-draft-table .lot-col-supplier{width:6% !important;}
.lot-draft-table .lot-col-description{width:24% !important;}
.lot-draft-table .lot-col-qty{width:3.5% !important;text-align:center !important;}

.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance{
  width:5.7% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-totalLanded{
  width:6.1% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-unitCost{
  width:5% !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.lot-draft-table .lot-col-status{
  width:5.2% !important;
  text-align:center !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions{
  width:30.8% !important;
  text-align:center !important;
  overflow:hidden !important;
  padding-left:6px !important;
  padding-right:6px !important;
}

.lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.1 !important;
}

.lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  max-width:100% !important;
  padding:2px 5px !important;
  font-size:9px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
}

.lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  overflow:hidden !important;
}

.lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:3px 7px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-align:center !important;
  box-sizing:border-box !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:110px !important;
  min-width:110px !important;
  max-width:110px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;
}

.lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}

/* Optional columns may scroll locally only when enabled */
.lot-draft-table-wrap:has(.lot-col-stockPurchase),
.lot-draft-table-wrap:has(.lot-col-usDomestic),
.lot-draft-table-wrap:has(.lot-col-usToDubai),
.lot-draft-table-wrap:has(.lot-col-dubaiFees),
.lot-draft-table-wrap:has(.lot-col-kabulDelivery),
.lot-draft-table-wrap:has(.lot-col-notes),
.lot-draft-table-wrap:has(.lot-col-createdAt),
.lot-draft-table-wrap:has(.lot-col-updatedAt){
  overflow-x:auto !important;
}

.lot-draft-table:has(.lot-col-stockPurchase),
.lot-draft-table:has(.lot-col-usDomestic),
.lot-draft-table:has(.lot-col-usToDubai),
.lot-draft-table:has(.lot-col-dubaiFees),
.lot-draft-table:has(.lot-col-kabulDelivery),
.lot-draft-table:has(.lot-col-notes),
.lot-draft-table:has(.lot-col-createdAt),
.lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}


/* V139 Add Lots requested cost column widths */
.lot-draft-table .lot-col-usCost,
.lot-draft-table .lot-col-partnerAdvance,
.lot-draft-table .lot-col-totalLanded,
.lot-draft-table .lot-col-unitCost{
  width:4% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}


/* V140 Add Lots clean fixed layout reset */
.add-lots-page .lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  padding-bottom:0 !important;
}

.add-lots-page .lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
}

.add-lots-page .lot-draft-table th,
.add-lots-page .lot-draft-table td{
  height:28px !important;
  padding:4px 5px !important;
  font-size:11px !important;
  line-height:1.05 !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
  overflow:hidden !important;
}

.add-lots-page .lot-draft-table th{
  white-space:nowrap !important;
  text-overflow:clip !important;
}

/* Default Add Lots columns: exactly 100% total */
.add-lots-page .lot-draft-table .lot-col-lotNo{width:8% !important;min-width:0 !important;max-width:none !important;}
.add-lots-page .lot-draft-table .lot-col-supplier{width:6% !important;min-width:0 !important;max-width:none !important;}
.add-lots-page .lot-draft-table .lot-col-description{width:29% !important;min-width:0 !important;max-width:none !important;}
.add-lots-page .lot-draft-table .lot-col-qty{width:3% !important;min-width:0 !important;max-width:none !important;text-align:center !important;}

.add-lots-page .lot-draft-table .lot-col-usCost,
.add-lots-page .lot-draft-table .lot-col-partnerAdvance,
.add-lots-page .lot-draft-table .lot-col-totalLanded,
.add-lots-page .lot-draft-table .lot-col-unitCost{
  width:4% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:right !important;
  white-space:nowrap !important;
  font-size:10.5px !important;
}

.add-lots-page .lot-draft-table .lot-col-status{
  width:6% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
}

.add-lots-page .lot-draft-table .lot-col-actions{
  width:24% !important;
  min-width:0 !important;
  max-width:none !important;
  text-align:center !important;
  overflow:hidden !important;
}

/* Keep text controlled */
.add-lots-page .lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.1 !important;
}

.add-lots-page .lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  max-width:100% !important;
  padding:2px 5px !important;
  font-size:9px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}

/* Action buttons stay inside Action column */
.add-lots-page .lot-draft-table .lot-col-actions .row-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:6px !important;
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  margin:0 auto !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:3px 7px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:104px !important;
  min-width:104px !important;
  max-width:104px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:40px !important;
  min-width:40px !important;
  max-width:40px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}

/* Optional extra columns: local table scroll only when enabled */
.add-lots-page .lot-draft-table-wrap:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-notes),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-updatedAt){
  overflow-x:auto !important;
}

.add-lots-page .lot-draft-table:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table:has(.lot-col-notes),
.add-lots-page .lot-draft-table:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}


/* V141 Add Lots professional auto-adjust layout */
.add-lots-page .lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  padding-bottom:0 !important;
}

.add-lots-page .lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
}

.add-lots-page .lot-draft-table th,
.add-lots-page .lot-draft-table td{
  height:28px !important;
  padding:4px 6px !important;
  font-size:11px !important;
  line-height:1.05 !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
  overflow:hidden !important;
}

/* Fixed columns */
.add-lots-page .lot-draft-table .lot-col-lotNo{
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
}

.add-lots-page .lot-draft-table .lot-col-supplier{
  width:105px !important;
  min-width:105px !important;
  max-width:105px !important;
}

.add-lots-page .lot-draft-table .lot-col-qty{
  width:44px !important;
  min-width:44px !important;
  max-width:44px !important;
  text-align:center !important;
}

.add-lots-page .lot-draft-table .lot-col-usCost,
.add-lots-page .lot-draft-table .lot-col-partnerAdvance{
  width:82px !important;
  min-width:82px !important;
  max-width:82px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-draft-table .lot-col-totalLanded{
  width:88px !important;
  min-width:88px !important;
  max-width:88px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-draft-table .lot-col-unitCost{
  width:74px !important;
  min-width:74px !important;
  max-width:74px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-draft-table .lot-col-status{
  width:70px !important;
  min-width:70px !important;
  max-width:70px !important;
  text-align:center !important;
}

.add-lots-page .lot-draft-table .lot-col-actions{
  width:230px !important;
  min-width:230px !important;
  max-width:230px !important;
  text-align:center !important;
  overflow:hidden !important;
}

/* Description automatically takes the remaining page width */
.add-lots-page .lot-draft-table .lot-col-description{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
}

.add-lots-page .lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.1 !important;
}

/* Compact status */
.add-lots-page .lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  max-width:100% !important;
  padding:2px 5px !important;
  font-size:9px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}

/* Action buttons are fixed and always fit inside Action */
.add-lots-page .lot-draft-table .lot-col-actions .row-actions{
  display:grid !important;
  grid-template-columns:104px 40px 54px !important;
  justify-content:center !important;
  align-items:center !important;
  column-gap:6px !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  overflow:hidden !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:3px 5px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:104px !important;
  min-width:104px !important;
  max-width:104px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:40px !important;
  min-width:40px !important;
  max-width:40px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}

/* Extra optional columns: only then allow table-local horizontal scroll */
.add-lots-page .lot-draft-table-wrap:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-notes),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-updatedAt){
  overflow-x:auto !important;
}

.add-lots-page .lot-draft-table:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table:has(.lot-col-notes),
.add-lots-page .lot-draft-table:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}


/* V142 Add Lots: keep Action fixed, auto-adjust all other default columns */
.add-lots-page .lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:auto !important;
  border-collapse:collapse !important;
}

.add-lots-page .lot-draft-table th,
.add-lots-page .lot-draft-table td{
  height:28px !important;
  padding:4px 6px !important;
  font-size:11px !important;
  line-height:1.05 !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
  overflow:hidden !important;
}

/* Auto-adjust every default column except Action */
.add-lots-page .lot-draft-table .lot-col-lotNo,
.add-lots-page .lot-draft-table .lot-col-supplier,
.add-lots-page .lot-draft-table .lot-col-description,
.add-lots-page .lot-draft-table .lot-col-qty,
.add-lots-page .lot-draft-table .lot-col-usCost,
.add-lots-page .lot-draft-table .lot-col-partnerAdvance,
.add-lots-page .lot-draft-table .lot-col-totalLanded,
.add-lots-page .lot-draft-table .lot-col-unitCost,
.add-lots-page .lot-draft-table .lot-col-status{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
}

.add-lots-page .lot-draft-table .lot-col-description .lot-desc-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.1 !important;
}

.add-lots-page .lot-draft-table .lot-col-qty{
  text-align:center !important;
}

.add-lots-page .lot-draft-table .lot-col-usCost,
.add-lots-page .lot-draft-table .lot-col-partnerAdvance,
.add-lots-page .lot-draft-table .lot-col-totalLanded,
.add-lots-page .lot-draft-table .lot-col-unitCost{
  text-align:right !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-draft-table .lot-col-status{
  text-align:center !important;
}

.add-lots-page .lot-draft-table .status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  max-width:100% !important;
  padding:2px 5px !important;
  font-size:9px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}

/* Action column stays exactly fixed */
.add-lots-page .lot-draft-table .lot-col-actions{
  width:230px !important;
  min-width:230px !important;
  max-width:230px !important;
  text-align:center !important;
  overflow:hidden !important;
}

.add-lots-page .lot-draft-table .lot-col-actions .row-actions{
  display:grid !important;
  grid-template-columns:104px 40px 54px !important;
  justify-content:center !important;
  align-items:center !important;
  column-gap:6px !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  overflow:hidden !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button{
  height:23px !important;
  min-height:23px !important;
  padding:3px 5px !important;
  font-size:10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-align:center !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openReceiveLotStock"]{
  width:104px !important;
  min-width:104px !important;
  max-width:104px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="openLotDraftModal"]{
  width:40px !important;
  min-width:40px !important;
  max-width:40px !important;
}

.add-lots-page .lot-draft-table .lot-col-actions button[onclick*="deleteLotDraft"]{
  width:54px !important;
  min-width:54px !important;
  max-width:54px !important;
}

/* Optional extra columns still use local table scroll */
.add-lots-page .lot-draft-table-wrap:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-notes),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table-wrap:has(.lot-col-updatedAt){
  overflow-x:auto !important;
}

.add-lots-page .lot-draft-table:has(.lot-col-stockPurchase),
.add-lots-page .lot-draft-table:has(.lot-col-usDomestic),
.add-lots-page .lot-draft-table:has(.lot-col-usToDubai),
.add-lots-page .lot-draft-table:has(.lot-col-dubaiFees),
.add-lots-page .lot-draft-table:has(.lot-col-kabulDelivery),
.add-lots-page .lot-draft-table:has(.lot-col-notes),
.add-lots-page .lot-draft-table:has(.lot-col-createdAt),
.add-lots-page .lot-draft-table:has(.lot-col-updatedAt){
  width:max-content !important;
  min-width:1450px !important;
  max-width:none !important;
}


/* V144 Add Lots resize handles only - default column sizes stay unchanged */
.add-lots-page .lot-draft-table th{
  position:relative !important;
  user-select:none !important;
}

.add-lots-page .lot-th-label{
  display:block !important;
  padding-right:8px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-3px !important;
  width:7px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:20 !important;
}

.add-lots-page .lot-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:18% !important;
  right:3px !important;
  width:1px !important;
  height:64% !important;
  background:#cbd5e1 !important;
  opacity:.75 !important;
}

.add-lots-page .lot-col-resizer:hover::after{
  background:#2563eb !important;
  width:2px !important;
  opacity:1 !important;
}

body.resizing-lot-column{
  cursor:col-resize !important;
  user-select:none !important;
}

body.resizing-lot-column *{
  cursor:col-resize !important;
}


/* V145 Add Lots product columns */
.add-lots-page .lot-draft-table .lot-col-manufacturer,
.add-lots-page .lot-draft-table .lot-col-storage,
.add-lots-page .lot-draft-table .lot-col-grade{
  white-space:nowrap !important;
}

.add-lots-page .lot-draft-table .lot-col-model .lot-model-cell{
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  white-space:normal !important;
  line-height:1.1 !important;
}

.add-lots-page .lot-draft-table .lot-col-storage,
.add-lots-page .lot-draft-table .lot-col-grade{
  text-align:center !important;
}


/* V146 Add Lots filter/search panel */
.add-lots-page .lot-search-panel{
  background:#fff !important;
  border:1px solid #dbe7f7 !important;
  border-radius:14px !important;
  padding:10px !important;
  margin:10px 0 !important;
  box-shadow:0 1px 2px rgba(15,23,42,.04) !important;
}

.add-lots-page .lot-search-top{
  display:grid !important;
  grid-template-columns:1fr auto auto !important;
  gap:10px !important;
  align-items:center !important;
  margin-bottom:10px !important;
}

.add-lots-page .lot-search-top input{
  width:100% !important;
  height:40px !important;
  border-radius:10px !important;
}

.add-lots-page .lot-filter-grid{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(120px,1fr)) !important;
  gap:8px !important;
  align-items:end !important;
}

.add-lots-page .lot-filter-grid label{
  display:block !important;
  font-size:10px !important;
  font-weight:700 !important;
  color:#31506f !important;
  margin:0 0 3px !important;
}

.add-lots-page .lot-filter-grid select{
  width:100% !important;
  height:36px !important;
  border-radius:10px !important;
  padding:0 10px !important;
}

.add-lots-page .lot-filter-count{
  margin-top:8px !important;
  font-size:12px !important;
}

@media(max-width:1100px){
  .add-lots-page .lot-filter-grid{
    grid-template-columns:repeat(3,minmax(120px,1fr)) !important;
  }
}


/* V147 Add Lots top spacing cleanup */
.add-lots-page{
  padding-top:12px !important;
}

.add-lots-page .lot-actions-row{
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  margin:0 0 10px 0 !important;
  padding:0 !important;
}

.add-lots-page .lot-actions{
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:8px !important;
  margin:0 !important;
  padding:0 !important;
}

.add-lots-page .lot-search-panel{
  margin:0 0 10px 0 !important;
}

.add-lots-page .lot-search-top{
  margin-bottom:8px !important;
}

.add-lots-page .lot-filter-count{
  display:none !important;
}

.add-lots-page .lot-import-help{
  margin:8px 0 10px 0 !important;
}

.add-lots-page .lot-table-shell{
  margin-top:0 !important;
}


/* V148 Receive Stock modal flow */
.receive-stock-notice{
  margin-bottom:10px !important;
  font-weight:700 !important;
}
.alert.success{
  background:#ecfdf5 !important;
  border-color:#86efac !important;
  color:#166534 !important;
}


/* V149 Add Lots / Receive Stock polish */

/* Table model text must be left aligned */
.add-lots-page .lot-draft-table .lot-col-model,
.add-lots-page .lot-draft-table .lot-col-model .lot-model-cell{
  text-align:left !important;
}

/* Receive Stock modal fits on the screen with footer visible */
.modal.receive-stock-modal{
  width:min(900px,94vw) !important;
  max-height:calc(100vh - 28px) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.receive-stock-modal .modal-head{
  flex:0 0 auto !important;
  padding:10px 16px !important;
}

.receive-stock-modal .modal-body{
  flex:1 1 auto !important;
  overflow:hidden !important;
  padding:12px 18px !important;
}

.receive-stock-modal .modal-foot{
  flex:0 0 auto !important;
  padding:10px 18px !important;
}

.receive-stock-modal .receive-stock-notice,
.receive-stock-modal .receive-complete-note{
  margin:0 0 8px 0 !important;
  padding:8px 12px !important;
  line-height:1.2 !important;
  font-size:13px !important;
}

.receive-stock-modal .receive-lot-summary{
  margin:0 0 8px 0 !important;
  padding:9px 12px !important;
  gap:4px !important;
}

.receive-stock-modal .receive-lot-summary b{
  font-size:14px !important;
}

.receive-stock-modal .receive-lot-summary span{
  font-size:12px !important;
  line-height:1.25 !important;
}

.receive-stock-modal .receive-stock-grid{
  gap:8px 10px !important;
}

.receive-stock-modal .receive-stock-grid label{
  font-size:11px !important;
  margin-bottom:3px !important;
}

.receive-stock-modal .receive-stock-grid input,
.receive-stock-modal .receive-stock-grid select{
  height:36px !important;
  min-height:36px !important;
  padding:7px 10px !important;
  font-size:14px !important;
  border-radius:9px !important;
}

.receive-stock-modal .receive-imei-box textarea{
  height:68px !important;
  min-height:68px !important;
  padding:9px 10px !important;
  font-size:13px !important;
}

.receive-stock-modal .receive-stock-help{
  margin:8px 0 0 0 !important;
  padding:8px 12px !important;
  font-size:12.5px !important;
  line-height:1.25 !important;
}

/* Drag any modal by its header */
.modal-head.draggable-modal-head{
  cursor:move !important;
  user-select:none !important;
}

.modal-head.draggable-modal-head button{
  cursor:pointer !important;
}

body.dragging-modal,
body.dragging-modal *{
  cursor:move !important;
  user-select:none !important;
}

/* Do not show active resizing cursor until actual dragging starts */
.add-lots-page .lot-col-resizer{
  cursor:col-resize !important;
}


/* V152 Add Lots Columns modal cleanup */
.modal.lot-columns-modal{
  width:min(760px,94vw) !important;
  max-width:760px !important;
  max-height:calc(100vh - 36px) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.lot-columns-modal .modal-body{
  overflow:auto !important;
  padding:16px 18px !important;
}

.lot-columns-modal .modal-foot{
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  padding:14px 18px !important;
}

.lot-columns-note{
  margin:0 0 12px 0 !important;
}

.lot-columns-clean-list{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
}

.lot-col-option{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-height:44px !important;
  padding:9px 12px !important;
  border:1px solid #dbe7f7 !important;
  border-radius:10px !important;
  background:#fff !important;
  box-sizing:border-box !important;
  cursor:pointer !important;
  overflow:hidden !important;
}

.lot-col-option input{
  flex:0 0 auto !important;
  width:16px !important;
  height:16px !important;
  margin:0 !important;
}

.lot-col-option-main{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  min-width:0 !important;
  width:100% !important;
}

.lot-col-option-name{
  display:block !important;
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  font-size:13px !important;
  font-weight:700 !important;
  color:#0f172a !important;
}

.lot-col-badge{
  flex:0 0 auto !important;
  display:inline-flex !important;
  align-items:center !important;
  height:20px !important;
  padding:0 7px !important;
  border-radius:999px !important;
  background:#eaf2ff !important;
  color:#1d4ed8 !important;
  font-size:10px !important;
  font-weight:800 !important;
}

.lot-col-badge.optional{
  background:#f8fafc !important;
  color:#64748b !important;
}

@media(max-width:700px){
  .lot-columns-clean-list{
    grid-template-columns:1fr !important;
  }
}


/* V157 Responsive layout for Add Lots and app screens */
html,
body{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
}

#app,
.app,
.main,
.content,
.view,
.panel{
  max-width:100vw !important;
  box-sizing:border-box !important;
}

.panel{
  overflow:hidden !important;
}

/* Make all table wrappers usable on smaller screens */
.table-wrap,
.stock-table-wrap,
.lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior-x:contain !important;
  box-sizing:border-box !important;
}

/* Add Lots page should shrink to the screen, table scrolls internally */
.add-lots-page{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-actions-row,
.add-lots-page .panel-head{
  flex-wrap:wrap !important;
  gap:10px !important;
  max-width:100% !important;
}

.add-lots-page .lot-actions{
  flex-wrap:wrap !important;
  justify-content:flex-end !important;
  max-width:100% !important;
}

.add-lots-page .lot-actions button{
  white-space:nowrap !important;
}

.add-lots-page .lot-search-panel{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}

.add-lots-page .lot-search-top{
  grid-template-columns:minmax(0,1fr) auto auto !important;
}

.add-lots-page .lot-search-top input{
  min-width:0 !important;
}

.add-lots-page .lot-filter-grid{
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
}

.add-lots-page .lot-filter-grid select{
  min-width:0 !important;
}

/* Desktop: table fills normally */
.add-lots-page .lot-draft-table{
  width:100% !important;
}

/* Narrow screens: keep a real table but scroll it inside the panel */
@media(max-width:1200px){
  .add-lots-page .lot-filter-grid{
    grid-template-columns:repeat(3,minmax(150px,1fr)) !important;
  }

  .add-lots-page .lot-draft-table{
    width:max-content !important;
    min-width:1120px !important;
    max-width:none !important;
  }

  .add-lots-page .lot-draft-table-wrap{
    border:1px solid #dbe7f7 !important;
    border-radius:12px !important;
  }
}

@media(max-width:800px){
  body{
    font-size:14px !important;
  }

  .panel{
    border-radius:10px !important;
  }

  .add-lots-page{
    padding:10px !important;
  }

  .add-lots-page .lot-actions-row{
    justify-content:flex-start !important;
  }

  .add-lots-page .lot-actions{
    width:100% !important;
    justify-content:flex-start !important;
  }

  .add-lots-page .lot-actions button{
    flex:1 1 calc(50% - 8px) !important;
    min-width:135px !important;
  }

  .add-lots-page .lot-search-top{
    grid-template-columns:1fr !important;
  }

  .add-lots-page .lot-search-top button{
    width:100% !important;
  }

  .add-lots-page .lot-filter-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .add-lots-page .lot-draft-table{
    min-width:1040px !important;
  }

  .add-lots-page .lot-draft-table th,
  .add-lots-page .lot-draft-table td{
    font-size:10.5px !important;
    padding:5px 6px !important;
  }
}

@media(max-width:520px){
  .add-lots-page{
    padding:8px !important;
  }

  .add-lots-page .lot-actions button{
    flex:1 1 100% !important;
    min-width:0 !important;
  }

  .add-lots-page .lot-filter-grid{
    grid-template-columns:1fr !important;
  }

  .add-lots-page .lot-search-panel{
    padding:8px !important;
  }

  .add-lots-page .lot-draft-table{
    min-width:980px !important;
  }

  .add-lots-page .lot-draft-table-wrap::before{
    content:'Swipe left/right to view all columns' !important;
    display:block !important;
    position:sticky !important;
    left:0 !important;
    top:0 !important;
    z-index:3 !important;
    background:#eff6ff !important;
    color:#1d4ed8 !important;
    font-size:11px !important;
    font-weight:700 !important;
    padding:6px 8px !important;
    border-bottom:1px solid #bfdbfe !important;
  }
}

/* Keep important columns reachable while horizontally scrolling */
@media(max-width:1200px){
  .add-lots-page .lot-draft-table .lot-col-actions{
    position:sticky !important;
    right:0 !important;
    z-index:4 !important;
    background:#fff !important;
    box-shadow:-8px 0 12px rgba(15,23,42,.08) !important;
  }

  .add-lots-page .lot-draft-table th.lot-col-actions{
    background:#0f2d47 !important;
    z-index:6 !important;
  }

  .add-lots-page .lot-draft-table .lot-col-lotNo{
    position:sticky !important;
    left:0 !important;
    z-index:4 !important;
    background:#fff !important;
    box-shadow:8px 0 12px rgba(15,23,42,.05) !important;
  }

  .add-lots-page .lot-draft-table th.lot-col-lotNo{
    background:#0f2d47 !important;
    z-index:6 !important;
  }
}

/* Modals should fit phones/tablets */
@media(max-width:800px){
  .modal,
  .modal.large,
  .modal.receive-stock-modal,
  .modal.lot-columns-modal{
    width:calc(100vw - 18px) !important;
    max-width:calc(100vw - 18px) !important;
    max-height:calc(100vh - 18px) !important;
    left:9px !important;
    right:auto !important;
    top:9px !important;
    margin:0 !important;
    border-radius:14px !important;
  }

  .modal-body{
    overflow:auto !important;
    padding:12px !important;
  }

  .modal-foot{
    padding:10px 12px !important;
    gap:8px !important;
    flex-wrap:wrap !important;
  }

  .modal-foot button{
    flex:1 1 auto !important;
  }

  .form-grid,
  .receive-stock-modal .receive-stock-grid{
    grid-template-columns:1fr !important;
  }

  .receive-stock-modal .receive-imei-box textarea{
    height:86px !important;
  }

  .lot-columns-clean-list{
    grid-template-columns:1fr !important;
  }
}

/* Prevent long text from forcing page width */
td,
th,
button,
input,
select,
textarea{
  max-width:100% !important;
  box-sizing:border-box !important;
}


/* V159 safe Add Lots responsive table controls */
.add-lots-page .lots-scroll-controls{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:10px !important;
  width:100% !important;
  margin:8px 0 6px 0 !important;
  padding:6px 8px !important;
  background:#eff6ff !important;
  border:1px solid #bfdbfe !important;
  border-radius:10px !important;
  box-sizing:border-box !important;
}

.add-lots-page .lots-scroll-controls span{
  flex:1 1 auto !important;
  min-width:0 !important;
  text-align:center !important;
  font-size:12px !important;
  font-weight:700 !important;
  color:#1d4ed8 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.add-lots-page .lots-scroll-controls button{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-table-shell{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.add-lots-page .lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
  border:1px solid #dbe7f7 !important;
  border-radius:12px !important;
  box-sizing:border-box !important;
}

@media(max-width:1200px){
  .add-lots-page .lot-draft-table{
    width:max-content !important;
    min-width:1320px !important;
    max-width:none !important;
  }
}

@media(max-width:800px){
  .add-lots-page .lots-scroll-controls{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
  }

  .add-lots-page .lots-scroll-controls span{
    grid-column:1 / -1 !important;
    order:-1 !important;
    font-size:11px !important;
  }

  .add-lots-page .lot-draft-table{
    width:max-content !important;
    min-width:1220px !important;
    max-width:none !important;
  }
}


/* V161 remove Add Lots left/right button row */
.add-lots-page .lots-scroll-controls{
  display:none !important;
}


/* V163 Sales column resize and stock action menu */
.sales-main .stock-table th{
  position:relative !important;
  user-select:none !important;
}

.sales-th-label{
  display:block !important;
  padding-right:8px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-3px !important;
  width:7px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:20 !important;
}

.sales-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:18% !important;
  right:3px !important;
  width:1px !important;
  height:64% !important;
  background:#cbd5e1 !important;
  opacity:.75 !important;
}

.sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:2px !important;
  opacity:1 !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}

.sales-action-buttons{
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
}

.sales-action-buttons button{
  white-space:nowrap !important;
}

.stock-more-actions{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:10px !important;
  margin:14px 0 !important;
}

.stock-more-actions button{
  width:100% !important;
  justify-content:center !important;
  min-height:40px !important;
}

@media(max-width:700px){
  .stock-more-actions{
    grid-template-columns:1fr !important;
  }
}


/* V164 Sales column drag fix + label cleanup */
.sales-main .stock-table{
  table-layout:fixed !important;
}

.sales-main .stock-table th{
  position:relative !important;
  overflow:visible !important;
  user-select:none !important;
}

.sales-main .stock-table td{
  overflow:hidden !important;
}

.sales-main .sales-th-label{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  padding-right:14px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.sales-main .sortable-th .sales-th-label{
  cursor:pointer !important;
}

.sales-main .sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-6px !important;
  width:14px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:50 !important;
  pointer-events:auto !important;
  background:transparent !important;
}

.sales-main .sales-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:16% !important;
  right:6px !important;
  width:2px !important;
  height:68% !important;
  background:#cbd5e1 !important;
  opacity:.9 !important;
  border-radius:99px !important;
}

.sales-main .sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V165 Add Lots column resize fix */
.add-lots-page .lot-draft-table-wrap{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-width:100% !important;
  -webkit-overflow-scrolling:touch !important;
}

.add-lots-page .lot-draft-table th{
  position:relative !important;
  overflow:visible !important;
  user-select:none !important;
}

.add-lots-page .lot-draft-table td{
  overflow:hidden !important;
}

.add-lots-page .lot-th-label{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  padding-right:14px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-6px !important;
  width:14px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:60 !important;
  pointer-events:auto !important;
  background:transparent !important;
}

.add-lots-page .lot-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:16% !important;
  right:6px !important;
  width:2px !important;
  height:68% !important;
  background:#cbd5e1 !important;
  opacity:.9 !important;
  border-radius:99px !important;
}

.add-lots-page .lot-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
}

body.resizing-lot-column,
body.resizing-lot-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V166 Sales column resize hard fix using real pixel table/colgroup */
.sales-main .table-scroll{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-width:100% !important;
  -webkit-overflow-scrolling:touch !important;
}

.sales-main .stock-table{
  border-collapse:collapse !important;
  table-layout:fixed !important;
  max-width:none !important;
}

.sales-main .stock-table col{
  display:table-column !important;
}

.sales-main .stock-table th,
.sales-main .stock-table td{
  box-sizing:border-box !important;
  overflow:hidden !important;
}

.sales-main .stock-table th{
  position:relative !important;
  overflow:visible !important;
  user-select:none !important;
}

.sales-main .sales-th-label{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  padding-right:18px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

.sales-main .sortable-th .sales-th-label{
  cursor:pointer !important;
}

.sales-main .sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-7px !important;
  width:16px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:999 !important;
  pointer-events:auto !important;
  background:rgba(37,99,235,0) !important;
}

.sales-main .sales-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:14% !important;
  right:7px !important;
  width:2px !important;
  height:72% !important;
  background:#94a3b8 !important;
  opacity:.85 !important;
  border-radius:99px !important;
}

.sales-main .sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
  opacity:1 !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V167 Sales resize: natural layout until user drags */
.sales-main .stock-table:not([style]){
  max-width:none !important;
}

.sales-main .stock-table th{
  text-align:center !important;
}

.sales-main .sales-th-label{
  text-align:center !important;
  justify-content:center !important;
  padding-left:14px !important;
  padding-right:14px !important;
}

.sales-main .stock-table td.sales-col-actions,
.sales-main .stock-table td.sales-col-sell,
.sales-main .stock-table td.sales-col-available,
.sales-main .stock-table td.sales-col-price,
.sales-main .stock-table td.sales-col-storage,
.sales-main .stock-table td.sales-col-grade{
  text-align:center !important;
}

/* Keep resize divider easy to grab but do not force static column widths */
.sales-main .sales-col-resizer{
  right:-8px !important;
  width:18px !important;
  z-index:2000 !important;
}

.sales-main .sales-col-resizer::after{
  right:8px !important;
  width:2px !important;
  background:#94a3b8 !important;
}

.sales-main .sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
}


/* V168 Sales compact header labels + keep Action visible */
.sales-main .stock-table.default-cols{
  width:100% !important;
  table-layout:auto !important;
}

.sales-main .stock-table.default-cols th,
.sales-main .stock-table.default-cols td{
  overflow:visible !important;
}

.sales-main .stock-table.default-cols .sales-col-item{
  min-width:150px !important;
}

.sales-main .stock-table.default-cols .sales-col-manufacturer{
  min-width:85px !important;
}

.sales-main .stock-table.default-cols .sales-col-model{
  min-width:160px !important;
}

.sales-main .stock-table.default-cols .sales-col-storage{
  min-width:80px !important;
}

.sales-main .stock-table.default-cols .sales-col-color{
  min-width:105px !important;
}

.sales-main .stock-table.default-cols .sales-col-grade{
  min-width:70px !important;
}

.sales-main .stock-table.default-cols .sales-col-available{
  min-width:70px !important;
}

.sales-main .stock-table.default-cols .sales-col-price{
  min-width:90px !important;
}

.sales-main .stock-table.default-cols .sales-col-sell{
  min-width:80px !important;
}

.sales-main .stock-table.default-cols .sales-col-actions{
  min-width:210px !important;
  width:210px !important;
  overflow:visible !important;
}

.sales-main .stock-table.default-cols td.sales-col-actions{
  overflow:visible !important;
  white-space:nowrap !important;
}

.sales-main .stock-table.default-cols .sales-action-buttons{
  justify-content:flex-start !important;
  flex-wrap:nowrap !important;
  min-width:200px !important;
}

.sales-main .stock-table.default-cols .sales-action-buttons button{
  padding-left:12px !important;
  padding-right:12px !important;
}

/* When saved/dragged widths exist, let the saved width rules control the table. */
#salesColWidthRules:not(:empty) ~ .stock-table.default-cols{
  width:auto !important;
}


/* V169 Sales table resize final cleanup */
.sales-main .table-scroll{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-width:100% !important;
  -webkit-overflow-scrolling:touch !important;
}

.sales-main .stock-table{
  border-collapse:collapse !important;
  max-width:none !important;
}

.sales-main .stock-table.default-cols{
  width:max-content !important;
  min-width:100% !important;
  table-layout:auto !important;
}

.sales-main .stock-table th,
.sales-main .stock-table td{
  box-sizing:border-box !important;
}

.sales-main .stock-table th{
  position:relative !important;
  text-align:center !important;
  overflow:visible !important;
  user-select:none !important;
}

.sales-main .sales-th-label{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  min-width:0 !important;
  min-height:22px !important;
  padding:0 18px 0 8px !important;
  text-align:center !important;
  overflow:visible !important;
  text-overflow:clip !important;
  white-space:nowrap !important;
}

.sales-main .sortable-th .sales-th-label{
  cursor:pointer !important;
}

/* Visible/easy resize area on every header edge */
.sales-main .sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:0 !important;
  width:14px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:3000 !important;
  pointer-events:auto !important;
  background:transparent !important;
}

.sales-main .sales-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:14% !important;
  right:6px !important;
  width:2px !important;
  height:72% !important;
  background:#94a3b8 !important;
  opacity:.9 !important;
  border-radius:99px !important;
}

.sales-main .sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
  opacity:1 !important;
}

/* Natural minimums so titles do not collapse */
.sales-main .stock-table.default-cols .sales-col-item{min-width:165px !important;}
.sales-main .stock-table.default-cols .sales-col-manufacturer{min-width:85px !important;}
.sales-main .stock-table.default-cols .sales-col-model{min-width:150px !important;}
.sales-main .stock-table.default-cols .sales-col-storage{min-width:100px !important;}
.sales-main .stock-table.default-cols .sales-col-color{min-width:115px !important;}
.sales-main .stock-table.default-cols .sales-col-grade{min-width:85px !important;}
.sales-main .stock-table.default-cols .sales-col-available{min-width:75px !important;}
.sales-main .stock-table.default-cols .sales-col-price{min-width:90px !important;}
.sales-main .stock-table.default-cols .sales-col-sell{min-width:75px !important;}
.sales-main .stock-table.default-cols .sales-col-actions{min-width:215px !important;}

.sales-main .stock-table td.sales-col-actions,
.sales-main .stock-table td.sales-col-sell,
.sales-main .stock-table td.sales-col-available,
.sales-main .stock-table td.sales-col-price,
.sales-main .stock-table td.sales-col-storage,
.sales-main .stock-table td.sales-col-grade{
  text-align:center !important;
}

.sales-main .sales-action-buttons{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:6px !important;
  justify-content:center !important;
  align-items:center !important;
  white-space:nowrap !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V170 Sales column resize: no fixed/min-width locks */
.sales-main .table-scroll{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-width:100% !important;
}

.sales-main .stock-table{
  table-layout:auto !important;
  max-width:none !important;
}

.sales-main .stock-table.default-cols{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  table-layout:auto !important;
}

.sales-main .stock-table th,
.sales-main .stock-table td{
  box-sizing:border-box !important;
  min-width:0 !important;
  max-width:none !important;
}

/* Kill old fixed default column minimums */
.sales-main .stock-table.default-cols .sales-col-item,
.sales-main .stock-table.default-cols .sales-col-manufacturer,
.sales-main .stock-table.default-cols .sales-col-model,
.sales-main .stock-table.default-cols .sales-col-storage,
.sales-main .stock-table.default-cols .sales-col-color,
.sales-main .stock-table.default-cols .sales-col-grade,
.sales-main .stock-table.default-cols .sales-col-available,
.sales-main .stock-table.default-cols .sales-col-price,
.sales-main .stock-table.default-cols .sales-col-sell,
.sales-main .stock-table.default-cols .sales-col-actions{
  min-width:0 !important;
  width:auto !important;
  max-width:none !important;
}

.sales-main .sales-th-label{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  padding:0 10px 0 2px !important;
  text-align:center !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
}

.sales-main .sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:0 !important;
  width:14px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:5000 !important;
  pointer-events:auto !important;
}

.sales-main .sales-col-resizer::after{
  right:6px !important;
  width:2px !important;
  background:#94a3b8 !important;
}

.sales-main .sales-col-resizer:hover::after{
  background:#2563eb !important;
  width:3px !important;
}

/* After user drags, JS applies exact pixel widths. Let those exact widths win. */
#salesColWidthRules:not(:empty) ~ .stock-table{
  table-layout:fixed !important;
  min-width:0 !important;
  max-width:none !important;
}

#salesColWidthRules:not(:empty) ~ .stock-table th,
#salesColWidthRules:not(:empty) ~ .stock-table td{
  min-width:0 !important;
}

.sales-main .sales-action-buttons{
  min-width:0 !important;
  width:max-content !important;
  flex-wrap:nowrap !important;
  gap:6px !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V171 isolated Sales resize table: not using old .stock-table sizing */
.sales-resize-wrap{
  border:1px solid #d9e6f8 !important;
  border-radius:14px !important;
  background:#fff !important;
  overflow:hidden !important;
}

.sales-resize-scroll{
  max-width:100% !important;
  overflow:auto !important;
  max-height:calc(100vh - 300px) !important;
  -webkit-overflow-scrolling:touch !important;
}

.sales-resize-table{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  border-collapse:collapse !important;
  table-layout:auto !important;
  font-size:14px !important;
}

.sales-resize-table th{
  background:#0f2f4a !important;
  color:#fff !important;
  font-weight:800 !important;
  text-align:center !important;
  position:relative !important;
  height:40px !important;
  padding:0 !important;
  border-right:1px solid rgba(255,255,255,.22) !important;
  user-select:none !important;
  overflow:visible !important;
  white-space:nowrap !important;
}

.sales-resize-table td{
  padding:12px 10px !important;
  border-right:1px solid #e6eef8 !important;
  border-bottom:1px solid #e6eef8 !important;
  vertical-align:middle !important;
  background:#fff !important;
  box-sizing:border-box !important;
  min-width:0 !important;
  max-width:none !important;
  overflow:hidden !important;
}

.sales-resize-table tr:nth-child(even) td{
  background:#f8fbff !important;
}

.sales-resize-table .sales-th-label{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:100% !important;
  padding:0 14px 0 6px !important;
  box-sizing:border-box !important;
  text-align:center !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  white-space:nowrap !important;
}

.sales-resize-table .sortable-th .sales-th-label{
  cursor:pointer !important;
}

.sales-resize-table .sales-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:0 !important;
  width:16px !important;
  height:100% !important;
  cursor:col-resize !important;
  z-index:9000 !important;
  background:transparent !important;
  pointer-events:auto !important;
}

.sales-resize-table .sales-col-resizer::after{
  content:'' !important;
  position:absolute !important;
  top:12% !important;
  right:7px !important;
  width:2px !important;
  height:76% !important;
  background:#91a8bd !important;
  border-radius:99px !important;
  opacity:1 !important;
}

.sales-resize-table .sales-col-resizer:hover::after{
  background:#2f7df6 !important;
  width:3px !important;
}

.sales-resize-table .sales-col-item,
.sales-resize-table .sales-col-manufacturer,
.sales-resize-table .sales-col-model,
.sales-resize-table .sales-col-storage,
.sales-resize-table .sales-col-color,
.sales-resize-table .sales-col-grade,
.sales-resize-table .sales-col-available,
.sales-resize-table .sales-col-price,
.sales-resize-table .sales-col-sell,
.sales-resize-table .sales-col-actions{
  min-width:0 !important;
}

.sales-resize-table td.sales-col-actions,
.sales-resize-table td.sales-col-sell,
.sales-resize-table td.sales-col-available,
.sales-resize-table td.sales-col-price,
.sales-resize-table td.sales-col-storage,
.sales-resize-table td.sales-col-grade{
  text-align:center !important;
}

.sales-resize-table .sales-action-buttons{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
  min-width:0 !important;
  white-space:nowrap !important;
}

body.resizing-sales-column,
body.resizing-sales-column *{
  cursor:col-resize !important;
  user-select:none !important;
}


/* V172 Sales header/action bar full-width fix */
.sales-resize-scroll{
  background:#fff !important;
}

.sales-resize-table{
  min-width:100% !important;
}

#salesColWidthRules:not(:empty) ~ .sales-resize-table{
  min-width:100% !important;
}

/* When resized columns total less than the wrapper, let Action absorb the leftover space cleanly */
.sales-resize-table .sales-col-actions{
  min-width:64px !important;
}

.sales-resize-table th.sales-col-actions,
.sales-resize-table td.sales-col-actions{
  width:auto;
}


/* V173 stability/business logic UI helpers */
.credit-money{color:#166534;font-weight:800}
.customer-balance-warning.credit{border-color:#bbf7d0;background:#f0fdf4}
.credit-line b{color:#166534}
.archived-row td{opacity:.72;background:#fff7ed!important}


/* V174 hide visible resize-handle lines but keep drag handles active */
.sales-resize-table .sales-col-resizer::after,
.sales-main .sales-col-resizer::after,
.add-lots-page .lot-col-resizer::after{
  background:transparent !important;
  opacity:0 !important;
}

.sales-resize-table .sales-col-resizer:hover::after,
.sales-main .sales-col-resizer:hover::after,
.add-lots-page .lot-col-resizer:hover::after{
  background:#2f7df6 !important;
  opacity:1 !important;
  width:2px !important;
}


/* V175 test cleanup */
button.danger{
  border:0 !important;
  background:#dc2626 !important;
  color:white !important;
  border-radius:10px !important;
  padding:10px 14px !important;
  cursor:pointer !important;
}
button.danger:hover{
  background:#b91c1c !important;
}






/* V188 Add Lots: no gap + row height synchronized Action */
.add-lots-page .lot-split-table-wrap{
  display:flex !important;
  align-items:flex-start !important;
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  background:#fff !important;
  border:1px solid #d8e6f7 !important;
  border-radius:10px !important;
}

.add-lots-page .lot-split-table-wrap .lot-draft-table-wrap{
  flex:1 1 auto !important;
  min-width:0 !important;
  overflow:auto !important;
  max-width:none !important;
  border:0 !important;
  border-radius:0 !important;
}

.add-lots-page .lot-action-fixed-wrap{
  flex:0 0 250px !important;
  width:250px !important;
  min-width:250px !important;
  max-width:250px !important;
  overflow:hidden !important;
  background:#fff !important;
  border-left:1px solid #d8e6f7 !important;
}

.add-lots-page .lot-main-table,
.add-lots-page .lot-action-table{
  border-collapse:collapse !important;
  border-spacing:0 !important;
}

.add-lots-page .lot-action-table{
  width:100% !important;
  table-layout:fixed !important;
}

.add-lots-page .lot-main-table th,
.add-lots-page .lot-main-table td,
.add-lots-page .lot-action-table th,
.add-lots-page .lot-action-table td{
  box-sizing:border-box !important;
  vertical-align:middle !important;
}

.add-lots-page .lot-action-table th{
  background:#0f2f4a !important;
  color:#fff !important;
  text-align:center !important;
}

.add-lots-page .lot-action-table td{
  background:#fff !important;
  text-align:center !important;
  overflow:visible !important;
  white-space:nowrap !important;
  padding:3px 6px !important;
}

.add-lots-page .lot-action-table tr:nth-child(even) td{
  background:#f8fbff !important;
}

.add-lots-page .lot-action-table .row-actions{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}

.add-lots-page .lot-action-table .row-actions button{
  height:24px !important;
  min-height:24px !important;
  max-height:24px !important;
  padding:0 10px !important;
  font-size:11px !important;
  line-height:22px !important;
}

.add-lots-page .lot-action-table .row-actions .primary{
  min-width:110px !important;
}

.add-lots-page .lot-col-fill,
.add-lots-page .lot-main-table .lot-col-fill,
.add-lots-page .lot-main-table col[data-lot-fill="1"]{
  display:none !important;
  width:0 !important;
  min-width:0 !important;
  max-width:0 !important;
  padding:0 !important;
}



/* V193 scoped title/header alignment */
.main .topbar > div:first-child{
  flex:1 1 auto !important;
  text-align:center !important;
}

.main .topbar h1,
.main .topbar p{
  text-align:center !important;
}

.section-head,
.customer-section-head{
  justify-content:center !important;
  text-align:center !important;
}

.section-head > div,
.customer-section-head > div{
  width:100% !important;
  text-align:center !important;
}

.section-head h2,
.section-head p,
.customer-section-head h2,
.customer-section-head p{
  text-align:center !important;
}

/* Scoped data-table header centering. No naked table/th selector. */
.sales-layout .sales-resize-table th,
.add-lots-page .stock-table th,
.returns-page .stock-table th,
.customer-page .stock-table th,
.reports-content .stock-table th,
.settings-content .stock-table th,
.purchase-list-card .stock-table th{
  text-align:center !important;
  vertical-align:middle !important;
}

.stock-table td{
  vertical-align:middle !important;
}

.stock-table td .status-pill,
.stock-table td .customer-type,
.stock-table td .badge{
  margin-left:auto !important;
  margin-right:auto !important;
}

/* V191 Customers: make the table use the full card width */
.clean-customer-page .customer-card-pro{
  width:100% !important;
  max-width:none !important;
}

.clean-customer-page .customer-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow:auto !important;
  border:1px solid #d8e6f7 !important;
  border-radius:10px !important;
}

.clean-customer-page .professional-customer-table,
.clean-customer-page .customer-table{
  width:100% !important;
  min-width:100% !important;
  max-width:none !important;
  table-layout:auto !important;
}

.clean-customer-page .professional-customer-table th,
.clean-customer-page .professional-customer-table td{
  box-sizing:border-box !important;
}

/* Give the wide text fields the space instead of leaving blank card space */
.clean-customer-page .professional-customer-table th:nth-child(1),
.clean-customer-page .professional-customer-table td:nth-child(1){
  width:18% !important;
  min-width:180px !important;
}

.clean-customer-page .professional-customer-table th:nth-child(3),
.clean-customer-page .professional-customer-table td:nth-child(3){
  width:12% !important;
  min-width:120px !important;
}

.clean-customer-page .professional-customer-table th:nth-child(4),
.clean-customer-page .professional-customer-table td:nth-child(4){
  width:12% !important;
  min-width:120px !important;
}

.clean-customer-page .professional-customer-table th:nth-child(5),
.clean-customer-page .professional-customer-table td:nth-child(5){
  width:14% !important;
  min-width:140px !important;
}

.clean-customer-page .professional-customer-table th:nth-child(6),
.clean-customer-page .professional-customer-table td:nth-child(6){
  width:14% !important;
  min-width:150px !important;
}

.clean-customer-page .professional-customer-table th:nth-child(9),
.clean-customer-page .professional-customer-table td:nth-child(9){
  width:15% !important;
  min-width:220px !important;
}

.clean-customer-page .customer-actions{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  gap:8px !important;
  white-space:nowrap !important;
}

.clean-customer-page .customer-name-cell{
  text-align:left !important;
}

.clean-customer-page .professional-customer-table td:nth-child(2),
.clean-customer-page .professional-customer-table td:nth-child(7),
.clean-customer-page .professional-customer-table td:nth-child(8),
.clean-customer-page .professional-customer-table td:nth-child(9){
  text-align:center !important;
}


/* V192 Add Lots column title alignment */
.add-lots-page .lot-draft-table th,
.add-lots-page .lot-main-table th,
.add-lots-page .lot-action-table th{
  text-align:center !important;
  vertical-align:middle !important;
}

.add-lots-page .lot-th-label{
  text-align:center !important;
  justify-content:center !important;
  width:100% !important;
}

.add-lots-page .lot-draft-table th .lot-th-label,
.add-lots-page .lot-main-table th .lot-th-label{
  display:block !important;
  text-align:center !important;
}

/* Keep Add Lots row data readable while titles are centered */
.add-lots-page .lot-draft-table td,
.add-lots-page .lot-main-table td{
  vertical-align:middle !important;
}


/* Removed historical Add Lots table overrides from V193-V203. V204 below is the active table layout. */

/* V204 final table/accounting UI stabilization
   This block intentionally overrides older historical table rules with a single
   current behavior for Add Lots and accounting screens. */
.add-lots-page .lot-single-table-shell{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  border:1px solid #d8e6f7 !important;
  border-radius:10px !important;
  background:#fff !important;
}
.add-lots-page .lot-single-table-shell .lot-draft-table-wrap{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}
.add-lots-page .lot-single-table-shell .lot-draft-table-wrap.lot-needs-horizontal,
.add-lots-page .lot-single-table-shell .lot-draft-table-wrap.lot-wide-table-wrap{
  overflow-x:auto !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table{
  border-collapse:separate !important;
  border-spacing:0 !important;
  table-layout:fixed !important;
  max-width:none !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th,
.add-lots-page .lot-single-table-shell .lot-main-table td{
  box-sizing:border-box !important;
  height:34px !important;
  padding:6px 8px !important;
  vertical-align:middle !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th{
  height:40px !important;
  padding:0 8px !important;
  background:#102a43 !important;
  color:#fff !important;
  text-align:center !important;
  text-transform:uppercase !important;
  font-size:12px !important;
  letter-spacing:.035em !important;
  position:relative !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th .lot-th-label{
  display:block !important;
  line-height:40px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  padding-right:10px !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th[data-lot-col="lotNo"],
.add-lots-page .lot-single-table-shell .lot-main-table td.lot-col-lotNo{
  position:sticky !important;
  left:0 !important;
  z-index:12 !important;
  box-shadow:1px 0 0 #e2e8f0 !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th[data-lot-col="actions"],
.add-lots-page .lot-single-table-shell .lot-main-table td.lot-col-actions{
  position:sticky !important;
  right:0 !important;
  z-index:12 !important;
  box-shadow:-1px 0 0 #e2e8f0 !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table th[data-lot-col="lotNo"],
.add-lots-page .lot-single-table-shell .lot-main-table th[data-lot-col="actions"]{
  z-index:20 !important;
  background:#102a43 !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table td.lot-col-lotNo,
.add-lots-page .lot-single-table-shell .lot-main-table td.lot-col-actions{
  background:#fff !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table tbody tr:nth-child(even) td.lot-col-lotNo,
.add-lots-page .lot-single-table-shell .lot-main-table tbody tr:nth-child(even) td.lot-col-actions{
  background:#f8fafc !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table tbody tr:hover td.lot-col-lotNo,
.add-lots-page .lot-single-table-shell .lot-main-table tbody tr:hover td.lot-col-actions{
  background:#eef6ff !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table td.lot-col-actions{
  overflow:visible !important;
  text-overflow:clip !important;
}
.add-lots-page .lot-single-table-shell .lot-main-table .row-actions{
  display:flex !important;
  gap:6px !important;
  justify-content:center !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
}
.add-lots-page .lot-single-table-shell .lot-col-spacer,
.add-lots-page .lot-single-table-shell .lot-action-spacer,
.add-lots-page .lot-single-table-shell .lot-white-spacer,
.add-lots-page .lot-single-table-shell col[data-lot-spacer="1"]{
  display:none !important;
  width:0 !important;
  min-width:0 !important;
  max-width:0 !important;
  padding:0 !important;
  border:0 !important;
}
.add-lots-page .lot-single-table-shell .lot-col-resizer{
  position:absolute !important;
  top:0 !important;
  right:-4px !important;
  width:9px !important;
  height:40px !important;
  cursor:col-resize !important;
  z-index:40 !important;
  background:transparent !important;
}
.add-lots-page .lot-single-table-shell .lot-col-resizer:hover{
  background:rgba(255,255,255,.22) !important;
}
.resizing-lot-column,
.resizing-lot-column *{
  cursor:col-resize !important;
  user-select:none !important;
}
.compact-imei-list{
  max-height:180px !important;
  overflow:auto !important;
  border:1px solid var(--line) !important;
  border-radius:10px !important;
  padding:8px !important;
  background:#f8fafc !important;
}

/* V208 Professional Reports redesign - report page only */
.content.reports-content .reports-fixed-pro{
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:auto auto minmax(0,1fr) !important;
  gap:12px !important;
}
.content.reports-content .report-controls-pro{
  padding:12px 14px !important;
  border-radius:16px !important;
  display:grid !important;
  gap:10px !important;
}
.content.reports-content .report-range-pro{
  display:grid !important;
  grid-template-columns:150px 150px minmax(280px,1fr) !important;
  gap:10px !important;
  align-items:end !important;
}
.content.reports-content .report-buttons-pro{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
}
.content.reports-content .report-tabs-pro{
  display:flex !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  align-items:center !important;
}
.content.reports-content .report-tabs-pro button{
  height:40px !important;
  padding:0 14px !important;
  border-radius:12px !important;
  border:1px solid #dbe7f5 !important;
  background:#fff !important;
  color:#102a43 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}
.content.reports-content .report-tabs-pro button.active{
  background:#2563eb !important;
  border-color:#2563eb !important;
  color:#fff !important;
}
.content.reports-content .report-active-panel-pro{
  min-height:0 !important;
  overflow:hidden !important;
  display:block !important;
}
.content.reports-content .reports-dashboard-pro{
  height:100% !important;
  min-height:0 !important;
  overflow:auto !important;
  display:grid !important;
  grid-template-rows:auto auto auto !important;
  gap:12px !important;
  padding-bottom:4px !important;
}
.content.reports-content .main-kpis-pro{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:10px !important;
}
.content.reports-content .report-kpi-card{
  min-height:88px !important;
  padding:12px 14px !important;
  border:1px solid #dbe7f5 !important;
  border-radius:16px !important;
  box-shadow:0 6px 16px rgba(15,23,42,.045) !important;
}
.content.reports-content .report-kpi-card.warn{background:#fffbeb !important;border-color:#fde68a !important;}
.content.reports-content .report-kpi-card.danger{background:#fef2f2 !important;border-color:#fecaca !important;}
.content.reports-content .report-kpi-card span{
  display:block !important;
  font-size:11px !important;
  color:#64748b !important;
  font-weight:900 !important;
  text-transform:uppercase !important;
  letter-spacing:.04em !important;
}
.content.reports-content .report-kpi-card b{
  display:block !important;
  margin-top:5px !important;
  font-size:20px !important;
  color:#0f172a !important;
  line-height:1.1 !important;
}
.content.reports-content .report-kpi-card small{
  display:block !important;
  margin-top:5px !important;
  color:#64748b !important;
  font-size:11px !important;
}
.content.reports-content .dashboard-grid-pro,
.content.reports-content .report-lower-grid{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:12px !important;
  min-height:0 !important;
}
.content.reports-content .report-ceo-panel{
  overflow:hidden !important;
  min-height:0 !important;
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) !important;
}
.content.reports-content .report-panel-head,
.content.reports-content .report-module-head{
  display:flex !important;
  justify-content:space-between !important;
  gap:12px !important;
  align-items:flex-start !important;
  margin-bottom:12px !important;
}
.content.reports-content .report-panel-head h2,
.content.reports-content .report-module-head h2{
  margin:0 !important;
  font-size:18px !important;
}
.content.reports-content .report-panel-head p,
.content.reports-content .report-module-head p{
  margin:2px 0 0 !important;
  color:#64748b !important;
  font-size:13px !important;
}
.content.reports-content .mini-metrics-pro{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:10px !important;
  overflow:auto !important;
}
.content.reports-content .mini-metrics-pro div{
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  padding:12px !important;
  background:#f8fbff !important;
}
.content.reports-content .mini-metrics-pro span{
  display:block !important;
  color:#64748b !important;
  font-size:12px !important;
  font-weight:800 !important;
}
.content.reports-content .mini-metrics-pro b{
  display:block !important;
  margin-top:4px !important;
  font-size:18px !important;
}
.content.reports-content .mini-metrics-pro small{
  display:block !important;
  margin-top:4px !important;
  color:#64748b !important;
  font-size:11px !important;
}
.content.reports-content .report-module-card{
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) !important;
  padding:14px !important;
}
.content.reports-content .report-scroll-box{
  min-height:0 !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:minmax(0,1fr) 36px !important;
  border:1px solid #dbe7f5 !important;
  border-radius:14px !important;
  background:#fff !important;
}
.content.reports-content .compact-report-box{
  height:100% !important;
}
.content.reports-content .report-scroll{
  min-height:0 !important;
  overflow:auto !important;
}
.content.reports-content .report-table{
  width:max-content !important;
  min-width:1100px !important;
  table-layout:auto !important;
}
.content.reports-content .compact-report-box .report-table{
  min-width:780px !important;
}
.content.reports-content .inventory-register-box .report-table,
.content.reports-content .sales-ledger-box .report-table,
.content.reports-content .lot-performance-box .report-table{
  min-width:1380px !important;
}
.content.reports-content .report-table th{
  position:sticky !important;
  top:0 !important;
  z-index:20 !important;
  background:#102a43 !important;
  color:#fff !important;
}
.content.reports-content .report-table td,
.content.reports-content .report-table th{
  white-space:nowrap !important;
}
.content.reports-content .report-table-footer{
  height:36px !important;
  min-height:36px !important;
  display:flex !important;
  justify-content:space-between !important;
  gap:12px !important;
  align-items:center !important;
  padding:0 12px !important;
  border-top:1px solid #dbe7f5 !important;
  background:#f8fbff !important;
  color:#64748b !important;
  font-size:12px !important;
}
.content.reports-content .profit-report-layout,
.content.reports-content .inventory-report-layout,
.content.reports-content .lot-report-layout,
.content.reports-content .cash-report-layout{
  grid-template-rows:auto minmax(0,1fr) !important;
}
.content.reports-content .inventory-report-layout,
.content.reports-content .cash-report-layout{
  grid-template-rows:auto auto minmax(0,1fr) !important;
}
.content.reports-content .report-inventory-table-card,
.content.reports-content .lot-performance-card,
.content.reports-content .credit-ledger-card{
  min-height:420px !important;
}
.content.reports-content .report-action-list{
  overflow:auto !important;
}
@media(max-width:1500px){
  .content.reports-content .main-kpis-pro{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
}
@media(max-width:1100px){
  .content.reports-content{overflow:auto !important;}
  .content.reports-content .reports-fixed-pro{height:auto !important;overflow:visible !important;}
  .content.reports-content .report-active-panel-pro{overflow:visible !important;}
  .content.reports-content .reports-dashboard-pro{height:auto !important;overflow:visible !important;}
  .content.reports-content .dashboard-grid-pro,
  .content.reports-content .report-lower-grid{grid-template-columns:1fr !important;}
  .content.reports-content .main-kpis-pro{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .content.reports-content .report-range-pro{grid-template-columns:1fr 1fr !important;}
  .content.reports-content .report-search{grid-column:1/-1 !important;}
  .content.reports-content .report-module-card{height:auto !important;min-height:520px !important;}
}
@media(max-width:640px){
  .content.reports-content .main-kpis-pro,
  .content.reports-content .mini-metrics-pro,
  .content.reports-content .report-range-pro{grid-template-columns:1fr !important;}
  .content.reports-content .report-search{grid-column:auto !important;}
}

/* V209 simplified reports redesign: reports page only */
.reports-simple-frame{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:0;
  height:100%;
}
.report-controls-simple{
  flex:0 0 auto;
  padding:12px 14px !important;
}
.report-simple-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.report-simple-title h2{
  margin:0 0 3px;
  font-size:20px;
}
.report-simple-title p{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.report-simple-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.report-range-simple{
  display:grid;
  grid-template-columns:150px 150px minmax(260px,1fr) auto;
  gap:10px;
  align-items:end;
}
.report-range-simple input{
  height:38px;
  padding:8px 10px;
}
.report-quick-buttons{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.report-quick-buttons button,
.report-simple-actions button{
  padding:8px 11px !important;
}
.report-tabs-simple{
  flex:0 0 auto;
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 2px 6px;
}
.report-tabs-simple button{
  white-space:nowrap;
  background:#fff;
  border:1px solid var(--line);
  padding:9px 13px;
  border-radius:999px;
  font-weight:700;
  color:#334155;
}
.report-tabs-simple button.active{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
}
.report-active-panel-simple{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-right:2px;
}
.reports-simple{
  display:grid;
  gap:12px;
}
.report-explain-card{
  display:flex;
  gap:10px;
  align-items:center;
  padding:11px 13px !important;
  background:#f8fafc;
}
.report-explain-card b{
  font-size:14px;
}
.report-explain-card span{
  color:var(--muted);
  font-size:13px;
}
.report-kpis-simple{
  display:grid;
  grid-template-columns:repeat(6,minmax(130px,1fr));
  gap:10px;
}
.report-kpi-simple{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  box-shadow:0 4px 14px rgba(15,23,42,.04);
  min-width:0;
}
.report-kpi-simple span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  margin-bottom:5px;
}
.report-kpi-simple b{
  display:block;
  font-size:20px;
  line-height:1.15;
  overflow:hidden;
  text-overflow:ellipsis;
}
.report-kpi-simple small{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}
.report-kpi-simple.warn{
  border-color:#fed7aa;
  background:#fff7ed;
}
.report-kpi-simple.danger{
  border-color:#fecaca;
  background:#fef2f2;
}
.report-simple-grid.two{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.report-simple-section{
  padding:13px !important;
  min-width:0;
}
.report-simple-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}
.report-simple-head h2{
  margin:0 0 3px;
  font-size:17px;
}
.report-simple-head p{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.report-simple-table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  max-height:440px;
}
.report-simple-table{
  min-width:760px;
  width:100%;
}
.report-simple-table th{
  padding:9px 10px !important;
  font-size:11px !important;
  background:#102a43;
  color:#fff;
  position:sticky;
  top:0;
  z-index:2;
}
.report-simple-table td{
  padding:9px 10px !important;
  font-size:12.5px !important;
  vertical-align:middle;
}
.report-simple-filterbar{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(150px,1fr) 140px auto;
  gap:10px;
  align-items:end;
  padding:12px !important;
}
.report-filter-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.report-filter-actions button{
  padding:8px 10px !important;
}
.report-table .right{
  text-align:right;
}
@media(max-width:1450px){
  .report-kpis-simple{grid-template-columns:repeat(3,minmax(140px,1fr));}
  .report-range-simple{grid-template-columns:140px 140px minmax(220px,1fr);}
  .report-quick-buttons{grid-column:1/-1;justify-content:flex-start;}
}
@media(max-width:1050px){
  .report-simple-grid.two{grid-template-columns:1fr;}
  .report-range-simple{grid-template-columns:1fr 1fr;}
  .report-range-simple .report-search{grid-column:1/-1;}
  .report-simple-filterbar{grid-template-columns:1fr 1fr;}
  .report-filter-actions{grid-column:1/-1;}
}
@media(max-width:650px){
  .report-simple-title{flex-direction:column;}
  .report-simple-actions{justify-content:flex-start;}
  .report-kpis-simple{grid-template-columns:1fr 1fr;}
  .report-range-simple{grid-template-columns:1fr;}
  .report-simple-filterbar{grid-template-columns:1fr;}
  .report-kpi-simple b{font-size:18px;}
}
