/* ==========================================================================
   css/iba-14-patch.css  —  14.0.0 patch 1
   Styling for the features brought back from 13.0.1 into the 14.0.0 glass UI.
   Loaded after every 14.0.0 stylesheet. Each rule is scoped to its own page or
   popup, so nothing here can change another page. Removing this file only
   removes the look of these new elements; no logic depends on it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Invoice / Inventory History popup — Maximize button and expanded size
   (13.0.1 feature; selectors match the strength used in css/iba-1298.css)
   -------------------------------------------------------------------------- */
html body #history-modal#history-modal#history-modal .history-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
html body #history-modal#history-modal#history-modal .history-modal-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
html body #history-modal#history-modal#history-modal #history-modal-expand-btn,
html body #history-modal#history-modal#history-modal #history-modal-expand-btn-footer {
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.45) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  cursor: pointer !important;
}
html body #history-modal#history-modal#history-modal #history-modal-expand-btn:hover,
html body #history-modal#history-modal#history-modal #history-modal-expand-btn-footer:hover {
  background: rgba(255,255,255,0.30) !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded {
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 12px !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded > .modal-container {
  width: min(1100px, calc(100vw - 24px)) !important;
  max-width: min(1100px, calc(100vw - 24px)) !important;
  height: 92vh !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded .modal-header,
html body #history-modal#history-modal#history-modal.history-modal-expanded .modal-footer {
  flex: 0 0 auto !important;
  position: relative !important;
  bottom: auto !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded .modal-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded .history-modal-summary {
  flex: 0 0 auto !important;
}
html body #history-modal#history-modal#history-modal.history-modal-expanded .history-table-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
}

/* --------------------------------------------------------------------------
   2. Material Stock — expanded row (stock breakdown + movement history)
   The 14.0.0 panels are dark glass with white text, and css/iba-1298.css forces
   every element inside the breakdown table to white on transparent. These
   selectors are one step stronger so the warning, Align button and route
   colours stay visible. Light accent colours keep contrast on dark glass.
   -------------------------------------------------------------------------- */
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td .ms-bd-gap,
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td .ms-bd-gap i {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  font-style: normal !important;
  line-height: 1.4 !important;
  color: #fcd34d !important;
  -webkit-text-fill-color: #fcd34d !important;
}
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td .ms-bd-gap {
  display: block !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  background: rgba(252, 211, 77, 0.14) !important;
  border: 1px solid rgba(252, 211, 77, 0.35) !important;
}
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td button.ms-align-site-btn {
  margin-left: 6px !important;
  vertical-align: middle !important;
  padding: 3px 14px !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  font-style: normal !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #0f766e !important;
  background-color: #0f766e !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-shadow: none !important;
  cursor: pointer !important;
}
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td button.ms-align-site-btn:hover { background: #0d9488 !important; background-color: #0d9488 !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td.ms-bd-dup {
  padding: 8px 10px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: rgba(252, 211, 77, 0.18) !important;
  background-color: rgba(252, 211, 77, 0.18) !important;
  color: #fde68a !important;
  -webkit-text-fill-color: #fde68a !important;
}
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td span.ms-site-delete {
  float: right;
  margin-left: 10px;
  font-weight: 900 !important;
  font-style: normal !important;
  cursor: pointer;
  color: #fca5a5 !important;
  -webkit-text-fill-color: #fca5a5 !important;
}
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel:nth-child(2) .stock-detail-table tbody td.ms-bd-qty { font-weight: 800 !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td span.ms-route-add { font-weight: 700 !important; color: #86efac !important; -webkit-text-fill-color: #86efac !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td span.ms-route-return { font-weight: 700 !important; color: #fca5a5 !important; -webkit-text-fill-color: #fca5a5 !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td span.ms-route-usage { font-weight: 700 !important; color: #c4b5fd !important; -webkit-text-fill-color: #c4b5fd !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td.ms-hist-type { font-weight: 700 !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td.ms-hist-qty { font-weight: 800 !important; text-align: center !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td.ms-hist-action { text-align: center !important; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td.ms-hist-empty { padding: 18px !important; text-align: center !important; opacity: 0.85; }
html body.iba-shell-on.inventory-mode #workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view#workdesk-view #wd-material-stock .ms-glass-detail-grid > .ms-glass-panel.ms-glass-panel-wide .stock-detail-table tbody td button.ms-hist-return-btn {
  padding: 2px 12px !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  font-style: normal !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #f5b301 !important;
  background-color: #f5b301 !important;
  color: #1f1300 !important;
  -webkit-text-fill-color: #1f1300 !important;
  text-shadow: none !important;
  cursor: pointer !important;
}

/* Fallback (same look when the page is opened outside the 14.0.0 shell). */
#wd-material-stock .ms-bd-gap { margin-top: 4px; font-size: 0.78rem; font-weight: 700; color: #7a4a00; }
#wd-material-stock .ms-bd-qty { font-weight: 800; text-align: right; }
#wd-material-stock .ms-align-site-btn { margin-left: 6px; padding: 3px 12px; font-size: 0.75rem; font-weight: 800; border-radius: 999px; border: 0; background: #0f766e; color: #fff; cursor: pointer; }
#wd-material-stock .ms-route-add { color: #146c2e; font-weight: 700; }
#wd-material-stock .ms-route-return { color: #b42318; font-weight: 700; }
#wd-material-stock .ms-route-usage { color: #5b21b6; font-weight: 700; }
#wd-material-stock .ms-site-delete { float: right; margin-left: 10px; color: #b42318; font-weight: 900; cursor: pointer; }
#wd-material-stock .ms-hist-return-btn { padding: 2px 10px; font-size: 0.74rem; font-weight: 800; border-radius: 999px; border: 0; background: #f5b301; color: #1f1300; cursor: pointer; }

/* --------------------------------------------------------------------------
   3. Material Stock toolbar — Merge Selected / Stock Check / Titles buttons
   keep their own colours next to the 14.0.0 toolbar buttons.
   -------------------------------------------------------------------------- */
#wd-material-stock #ms-merge-selected-btn:not(.hidden),
#wd-material-stock #ms-stock-check-btn:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   4. PO Close Out — report buttons sit on the same row as the tabs
   -------------------------------------------------------------------------- */
#im-po-closeout #im-po-closeout-tabs #im-po-closeout-print-btn {
  margin-left: auto;
}
