/* MBus WMS Pro v172 – KONČNI popravek glave/seznama na Artikli in Zaloga.
   Rešitev: strani uporabljata grid seznam; če se iz cache še pojavi stara HTML tabela, jo ta CSS prisili v grid vrstni red. */

/* Correct React grid lists */
.mbus-artikli-grid-card,
.mbus-zaloga-grid-card {
  overflow: hidden !important;
  border: 1px solid rgba(203,213,225,.95) !important;
  border-radius: 12px !important;
  background: #fff !important;
}
.mbus-artikli-grid-wrap,
.mbus-zaloga-grid-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
}
.mbus-artikli-grid-head,
.mbus-artikli-grid-row,
.mbus-zaloga-grid-head,
.mbus-zaloga-grid-row {
  align-items: center !important;
  width: 100% !important;
  position: static !important;
  transform: none !important;
  float: none !important;
}
.mbus-artikli-grid-head,
.mbus-zaloga-grid-head {
  order: -999 !important;
  min-height: 38px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 1px solid rgba(203,213,225,.95) !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  font-weight: 900 !important;
  letter-spacing: .045em !important;
  text-transform: uppercase !important;
}
.mbus-artikli-grid-row,
.mbus-zaloga-grid-row {
  order: 0 !important;
  min-height: 42px !important;
  background: #fff !important;
  border-bottom: 1px solid rgba(226,232,240,.95) !important;
  font-size: 14px !important;
}
.mbus-artikli-grid-head,
.mbus-artikli-grid-row {
  display: grid !important;
  grid-template-columns: 110px minmax(210px, 1.6fr) 180px 115px 115px 110px 70px 120px 180px !important;
  min-width: 1210px !important;
}
.mbus-zaloga-grid-head,
.mbus-zaloga-grid-row {
  display: grid !important;
  grid-template-columns: 100px 150px minmax(230px, 1.7fr) 90px 100px 110px 80px 125px 115px !important;
  min-width: 1100px !important;
}
.mbus-artikli-grid-head > div,
.mbus-artikli-grid-row > div,
.mbus-zaloga-grid-head > div,
.mbus-zaloga-grid-row > div {
  min-width: 0 !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
.mbus-artikli-right,
.mbus-zaloga-right { text-align: right !important; }
.mbus-artikli-actions,
.mbus-zaloga-actions { overflow: visible !important; white-space: nowrap !important; text-align: right !important; }
.mbus-artikli-actions > div { justify-content: flex-end !important; flex-wrap: nowrap !important; }
.mbus-artikli-sku,
.mbus-artikli-ean,
.mbus-zaloga-sku,
.mbus-zaloga-ean { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important; }
.mbus-artikli-name,
.mbus-zaloga-name,
.mbus-zaloga-sku,
.mbus-zaloga-strong { font-weight: 800 !important; color: #0f172a !important; }
.mbus-zaloga-green { color:#15803d !important; font-weight:800 !important; }
.mbus-zaloga-blue { color:#1d4ed8 !important; font-weight:700 !important; }
.mbus-artikli-empty,
.mbus-zaloga-empty { min-width:100% !important; padding:18px !important; text-align:center !important; color:#64748b !important; font-size:14px !important; }

/* Fallback for any remaining OLD HTML table on /artikli and /zaloga. */
body.mbus-v172-route-artikli main table.mbus-v172-force-artikli,
body.mbus-v172-route-zaloga main table.mbus-v172-force-zaloga,
body.mbus-desktop-route-artikli main table.mbus-v172-force-artikli,
body.mbus-desktop-route-zaloga main table.mbus-v172-force-zaloga {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: visible !important;
  background: #fff !important;
}
body.mbus-v172-route-artikli main table.mbus-v172-force-artikli > thead,
body.mbus-v172-route-artikli main table.mbus-v172-force-artikli > tbody,
body.mbus-v172-route-zaloga main table.mbus-v172-force-zaloga > thead,
body.mbus-v172-route-zaloga main table.mbus-v172-force-zaloga > tbody,
body.mbus-desktop-route-artikli main table.mbus-v172-force-artikli > thead,
body.mbus-desktop-route-artikli main table.mbus-v172-force-artikli > tbody,
body.mbus-desktop-route-zaloga main table.mbus-v172-force-zaloga > thead,
body.mbus-desktop-route-zaloga main table.mbus-v172-force-zaloga > tbody {
  display: contents !important;
  position: static !important;
  transform: none !important;
}
body main table.mbus-v172-force-artikli > thead > tr,
body main table.mbus-v172-force-artikli > tbody > tr,
body main table.mbus-v172-force-zaloga > thead > tr,
body main table.mbus-v172-force-zaloga > tbody > tr {
  display: grid !important;
  align-items: center !important;
  width: 100% !important;
  position: static !important;
  top: auto !important;
  transform: none !important;
  float: none !important;
  z-index: auto !important;
}
body main table.mbus-v172-force-artikli > thead > tr {
  order: -999 !important;
  grid-template-columns: 110px minmax(210px, 1.6fr) 180px 115px 115px 110px 70px 120px 180px !important;
  min-width: 1210px !important;
}
body main table.mbus-v172-force-zaloga > thead > tr {
  order: -999 !important;
  grid-template-columns: 100px 150px minmax(230px, 1.7fr) 90px 100px 110px 80px 125px 115px !important;
  min-width: 1100px !important;
}
body main table.mbus-v172-force-artikli > tbody > tr {
  order: 0 !important;
  grid-template-columns: 110px minmax(210px, 1.6fr) 180px 115px 115px 110px 70px 120px 180px !important;
  min-width: 1210px !important;
  min-height: 42px !important;
  border-bottom: 1px solid rgba(226,232,240,.95) !important;
  background:#fff !important;
}
body main table.mbus-v172-force-zaloga > tbody > tr {
  order: 0 !important;
  grid-template-columns: 100px 150px minmax(230px, 1.7fr) 90px 100px 110px 80px 125px 115px !important;
  min-width: 1100px !important;
  min-height: 42px !important;
  border-bottom: 1px solid rgba(226,232,240,.95) !important;
  background:#fff !important;
}
body main table.mbus-v172-force-artikli > thead > tr,
body main table.mbus-v172-force-zaloga > thead > tr {
  min-height: 38px !important;
  background:#f1f5f9 !important;
  color:#475569 !important;
  border-bottom:1px solid rgba(203,213,225,.95) !important;
}
body main table.mbus-v172-force-artikli th,
body main table.mbus-v172-force-artikli td,
body main table.mbus-v172-force-zaloga th,
body main table.mbus-v172-force-zaloga td {
  display: block !important;
  position: static !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
  z-index:auto !important;
  transform:none !important;
  min-width:0 !important;
  min-height:0 !important;
  height:auto !important;
  padding:8px 10px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  box-sizing:border-box !important;
  border:0 !important;
  background:transparent !important;
  vertical-align:middle !important;
}
body main table.mbus-v172-force-artikli th,
body main table.mbus-v172-force-zaloga th {
  font-size:12px !important;
  line-height:1.1 !important;
  font-weight:900 !important;
  letter-spacing:.045em !important;
  text-transform:uppercase !important;
  color:#475569 !important;
}
body main table.mbus-v172-force-artikli td,
body main table.mbus-v172-force-zaloga td { font-size:14px !important; color:#0f172a !important; }

body.mbus-v172-route-artikli main [class*="overflow-x-auto"]:has(> table.mbus-v172-force-artikli),
body.mbus-v172-route-zaloga main [class*="overflow-x-auto"]:has(> table.mbus-v172-force-zaloga) {
  overflow-x: auto !important;
  overflow-y: visible !important;
  max-height: none !important;
  height: auto !important;
}

@media (max-width: 900px) {
  .mbus-artikli-grid-head,.mbus-artikli-grid-row,
  body main table.mbus-v172-force-artikli > thead > tr,
  body main table.mbus-v172-force-artikli > tbody > tr {
    min-width: 980px !important;
    grid-template-columns: 100px minmax(180px,1.4fr) 150px 100px 100px 90px 60px 105px 165px !important;
  }
  .mbus-zaloga-grid-head,.mbus-zaloga-grid-row,
  body main table.mbus-v172-force-zaloga > thead > tr,
  body main table.mbus-v172-force-zaloga > tbody > tr {
    min-width: 960px !important;
    grid-template-columns: 95px 135px minmax(190px,1.5fr) 80px 90px 100px 70px 115px 105px !important;
  }
}
